Shinya Kitaoka 810553
#pragma once
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
Shinya Kitaoka 120a6e
class DVAPI TTest {
Shinya Kitaoka 120a6e
  int m_levelInstanceCount;
Shinya Kitaoka 120a6e
  int m_imageInstanceCount;
Shinya Kitaoka 120a6e
  int m_rasterInstanceCount;
Shinya Kitaoka 120a6e
  int m_imageReaderInstanceCount;
Shinya Kitaoka 120a6e
  int m_imageWriterInstanceCount;
Shinya Kitaoka 120a6e
  int m_levelReaderInstanceCount;
Shinya Kitaoka 120a6e
  int m_levelWriterInstanceCount;
Shinya Kitaoka 120a6e
  int m_paramInstanceCount;
Shinya Kitaoka 120a6e
  int m_fxInstanceCount;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TTest(const std::string &testName);
Shinya Kitaoka 120a6e
  virtual ~TTest();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void setInstanceCount();
Shinya Kitaoka 120a6e
  void verifyInstanceCount();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual void test() = 0;
Shinya Kitaoka 120a6e
  virtual void before() { setInstanceCount(); };
Shinya Kitaoka 120a6e
  virtual void after(){};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  static void runTests(std::string filename);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
// 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