Commit 531647be authored by Emmanuel Christophe's avatar Emmanuel Christophe

ENH: switch code from TestMain to TestHelper

parent bb39232a
This diff is collapsed.
......@@ -40,7 +40,13 @@ namespace otb
class /*ITK_EXPORT*/ TestHelper : itk::Object
{
public:
typedef std::vector<std::string> StringList;
typedef StringList::const_iterator StringListIt;
TestHelper() :
m_ToleranceDiffValue(0),
m_Epsilon(0),
m_EpsilonBoundaryChecking(1.0e-30),
m_ReportErrors(false),
m_IgnoreLineOrder(false)
......@@ -48,6 +54,22 @@ public:
~TestHelper(){}
int RegressionTestAllImages(const StringList& baselineFilenamesImage,
const StringList& testFilenamesImage);
int RegressionTestAllMetaData(const StringList& baselineFilenamesMetaData,
const StringList& testFilenamesMetaData);
int RegressionTestAllAscii(const StringList& baselineFilenamesAscii,
const StringList& testFilenamesAscii,
const StringList& ignoredLines);
int RegressionTestAllBinary(const StringList& baselineFilenamesBinary,
const StringList& testFilenamesBinary);
int RegressionTestAllOgr(const StringList& baselineFilenamesOgr,
const StringList& testFilenamesOgr);
std::map<std::string, int> RegressionTestBaselines(char *baselineFilename) const;
int RegressionTestImage(int cpt, const char *testImageFilename, const char *baselineImageFilename,
......@@ -69,10 +91,9 @@ public:
itkSetMacro(IgnoreLineOrder, bool);
itkBooleanMacro(IgnoreLineOrder);
void SetEpsilonBoundaryChecking(double epsilonBoundary)
{
m_EpsilonBoundaryChecking = epsilonBoundary;
}
itkSetMacro(ToleranceDiffValue, double);
itkSetMacro(Epsilon, double);
itkSetMacro(EpsilonBoundaryChecking, double);
private:
bool isNumber(int i) const;
......@@ -102,6 +123,8 @@ private:
static void DumpOGRFeature(FILE* fileid, OGRFeature* feature, char** papszOptions = NULL);
static void DumpOGRGeometry(FILE* fileid, OGRGeometry* geometry, const char * pszPrefix, char** papszOptions = NULL);
double m_ToleranceDiffValue;
double m_Epsilon;
double m_EpsilonBoundaryChecking;
bool m_ReportErrors;
bool m_IgnoreLineOrder;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment