Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TNONGRAPHICTEST_INCLUDED
Toshihiro Shimizu 890ddd
#define TNONGRAPHICTEST_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tcommon.h"
Toshihiro Shimizu 890ddd
#include "tlevel_io.h"
Toshihiro Shimizu 890ddd
#include "timage_io.h"
Toshihiro Shimizu 890ddd
#include "tvectorimage.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#ifdef TTEST_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI TTest
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int m_levelInstanceCount;
Toshihiro Shimizu 890ddd
	int m_imageInstanceCount;
Toshihiro Shimizu 890ddd
	int m_rasterInstanceCount;
Toshihiro Shimizu 890ddd
	int m_imageReaderInstanceCount;
Toshihiro Shimizu 890ddd
	int m_imageWriterInstanceCount;
Toshihiro Shimizu 890ddd
	int m_levelReaderInstanceCount;
Toshihiro Shimizu 890ddd
	int m_levelWriterInstanceCount;
Toshihiro Shimizu 890ddd
	int m_paramInstanceCount;
Toshihiro Shimizu 890ddd
	int m_fxInstanceCount;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 3bfa54
	TTest(const std::string &testName);
Toshihiro Shimizu 890ddd
	virtual ~TTest();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setInstanceCount();
Toshihiro Shimizu 890ddd
	void verifyInstanceCount();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	virtual void test() = 0;
Toshihiro Shimizu 890ddd
	virtual void before() { setInstanceCount(); };
Toshihiro Shimizu 890ddd
	virtual void after(){};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	static void runTests(std::string filename);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//Utility
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
DVAPI TFilePath getTestFile(std::string name);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI int areEqual(TRasterP ra, TRasterP rb, double err = 1e-8);
Toshihiro Shimizu 890ddd
DVAPI int areEqual(TVectorImageP va, TVectorImageP vb, double err = 1e-8);
Toshihiro Shimizu 890ddd
DVAPI int areEqual(TImageP a, TImageP b, double err = 1e-8);
Toshihiro Shimizu 890ddd
DVAPI bool areEqual(const TPalette *paletteA, const TPalette *paletteB);
Toshihiro Shimizu 890ddd
DVAPI bool areEqual(TLevelP la, TLevelP lb);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif