OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
otb::TestHelper Class Reference

#include <otbTestHelper.h>

+ Inheritance diagram for otb::TestHelper:
+ Collaboration diagram for otb::TestHelper:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef std::vector< double > EpsilonList
 
typedef EpsilonList::const_iterator EpsilonListIt
 
typedef itk::SmartPointer< SelfPointer
 
typedef TestHelper Self
 
typedef std::vector< std::string > StringList
 
typedef StringList::const_iterator StringListIt
 
typedef itk::Object Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
virtual void IgnoreLineOrderOff ()
 
virtual void IgnoreLineOrderOn ()
 
int RegressionTestAllAscii (const StringList &baselineFilenamesAscii, const StringList &testFilenamesAscii, const EpsilonList &epsilons, const StringList &ignoredLines)
 
int RegressionTestAllBinary (const StringList &baselineFilenamesBinary, const StringList &testFilenamesBinary)
 
int RegressionTestAllDiff (const StringList &baselineFilenamesAscii, const StringList &testFilenamesAscii, const EpsilonList &epsilons, const StringList &ignoredLines)
 
int RegressionTestAllImages (const StringList &baselineFilenamesImage, const StringList &testFilenamesImage, const EpsilonList &epsilons)
 
int RegressionTestAllMetaData (const StringList &baselineFilenamesMetaData, const StringList &testFilenamesMetaData, const EpsilonList &epsilons)
 
int RegressionTestAllOgr (const StringList &baselineFilenamesOgr, const StringList &testFilenamesOgr, const EpsilonList &epsilons)
 
virtual void ReportErrorsOff ()
 
virtual void ReportErrorsOn ()
 
virtual void SetEpsilonBoundaryChecking (double _arg)
 
virtual void SetIgnoreLineOrder (bool _arg)
 
virtual void SetReportErrors (bool _arg)
 
virtual void SetToleranceRatio (double _arg)
 
 TestHelper ()
 
 ~TestHelper () override
 

Static Public Member Functions

static Pointer New ()
 

Private Member Functions

void AddWhiteSpace (const std::string &strIn, std::string &strOut) const
 
void CheckValueTolerance (const char *Comment, double ref, double test, int &count, bool report, double epsilon) const
 
bool CompareLines (const std::string &strfileref, const std::string &strfiletest, int &nbdiff, std::ofstream &fluxfilediff, int &numLine, std::vector< std::string > &listStrDiffLineFileRef, std::vector< std::string > &listStrDiffLineFileTest, double epsilon) const
 
bool isAlphaNum (int i) const
 
bool isHexaNumber (int i) const
 
bool isHexaPointerAddress (const std::string &str) const
 
bool isHexaPointerAddress (const std::string &str, vcl_size_t pos, vcl_size_t size) const
 
bool IsLineValid (const std::string &str, const StringList &ignoredLines) const
 
bool isMinusSign (int i) const
 
bool isNumber (int i) const
 
bool isNumeric (const std::string &str) const
 
bool isPoint (int i) const
 
bool isScientificNumeric (const std::string &str) const
 
bool isToBeIgnoredForAnyComparison (const std::string &str) const
 
void ogrReportOnLayer (OGRLayer *ref_poLayer, const char *ref_pszWHERE, OGRGeometry *ref_poSpatialFilter, OGRLayer *test_poLayer, const char *test_pszWHERE, OGRGeometry *test_poSpatialFilter, int &nbdiff, double epsilon) const
 
int RegressionTestAsciiFile (const char *testAsciiFileName, const char *baselineAsciiFileName, const double epsilon, std::vector< std::string > ignoredLines) const
 
std::map< std::string, int > RegressionTestBaselines (char *baselineFilename) const
 
int RegressionTestBinaryFile (const char *testBinaryFileName, const char *baselineBinaryFileName) const
 
int RegressionTestDiffFile (const char *testAsciiFileName, const char *baselineAsciiFileName, const double epsilon, std::vector< std::string > ignoredLines) const
 
int RegressionTestImage (int cpt, const char *testImageFilename, const char *baselineImageFilename, const double toleranceDiffPixelImage) const
 
int RegressionTestMetaData (const char *testImageFilename, const char *baselineImageFilename, const double toleranceDiffPixelImage) const
 
int RegressionTestOgrFile (const char *testOgrFilename, const char *baselineOgrFilename, const double toleranceDiffValue) const
 
int TokenizeLine (const std::string &line, StringList &tokens) const
 
std::string VectorToString (const otb::MetaDataKey::VectorType &vector) const
 

Static Private Member Functions

static void DumpOGRFeature (FILE *fileid, OGRFeature *feature, char **papszOptions=nullptr)
 
static void DumpOGRGeometry (FILE *fileid, OGRGeometry *geometry, const char *pszPrefix, char **papszOptions=nullptr)
 
static bool IsTokenEmpty (boost::iterator_range< std::string::const_iterator > &token)
 

Private Attributes

double m_EpsilonBoundaryChecking
 
bool m_IgnoreLineOrder
 
const unsigned int m_MaxArea
 
bool m_ReportErrors
 
std::vector< std::pair< std::string, std::string > > m_SpecialTokens
 
double m_ToleranceRatio
 

Detailed Description

Helper class to perform the baseline comparisons during the tests.

Definition at line 47 of file otbTestHelper.h.

Member Typedef Documentation

◆ ConstPointer

typedef itk::SmartPointer<const Self> otb::TestHelper::ConstPointer

Definition at line 54 of file otbTestHelper.h.

◆ EpsilonList

typedef std::vector<double> otb::TestHelper::EpsilonList

Definition at line 63 of file otbTestHelper.h.

◆ EpsilonListIt

typedef EpsilonList::const_iterator otb::TestHelper::EpsilonListIt

Definition at line 64 of file otbTestHelper.h.

◆ Pointer

typedef itk::SmartPointer<Self> otb::TestHelper::Pointer

Definition at line 53 of file otbTestHelper.h.

◆ Self

Standard class typedefs.

Definition at line 52 of file otbTestHelper.h.

◆ StringList

typedef std::vector<std::string> otb::TestHelper::StringList

Definition at line 58 of file otbTestHelper.h.

◆ StringListIt

typedef StringList::const_iterator otb::TestHelper::StringListIt

Definition at line 61 of file otbTestHelper.h.

◆ Superclass

typedef itk::Object otb::TestHelper::Superclass

Definition at line 55 of file otbTestHelper.h.

Constructor & Destructor Documentation

◆ TestHelper()

otb::TestHelper::TestHelper ( )

◆ ~TestHelper()

otb::TestHelper::~TestHelper ( )
override

Member Function Documentation

◆ AddWhiteSpace()

void otb::TestHelper::AddWhiteSpace ( const std::string &  strIn,
std::string &  strOut 
) const
private

◆ CheckValueTolerance()

void otb::TestHelper::CheckValueTolerance ( const char *  Comment,
double  ref,
double  test,
int &  count,
bool  report,
double  epsilon 
) const
private

◆ CompareLines()

bool otb::TestHelper::CompareLines ( const std::string &  strfileref,
const std::string &  strfiletest,
int &  nbdiff,
std::ofstream &  fluxfilediff,
int &  numLine,
std::vector< std::string > &  listStrDiffLineFileRef,
std::vector< std::string > &  listStrDiffLineFileTest,
double  epsilon 
) const
private

◆ CreateAnother()

virtual::itk::LightObject::Pointer otb::TestHelper::CreateAnother ( void  ) const

◆ DumpOGRFeature()

static void otb::TestHelper::DumpOGRFeature ( FILE *  fileid,
OGRFeature *  feature,
char **  papszOptions = nullptr 
)
staticprivate

◆ DumpOGRGeometry()

static void otb::TestHelper::DumpOGRGeometry ( FILE *  fileid,
OGRGeometry *  geometry,
const char *  pszPrefix,
char **  papszOptions = nullptr 
)
staticprivate

◆ GetNameOfClass()

virtual const char* otb::TestHelper::GetNameOfClass ( ) const
virtual

◆ IgnoreLineOrderOff()

virtual void otb::TestHelper::IgnoreLineOrderOff ( )
virtual

◆ IgnoreLineOrderOn()

virtual void otb::TestHelper::IgnoreLineOrderOn ( )
virtual

◆ isAlphaNum()

bool otb::TestHelper::isAlphaNum ( int  i) const
private

◆ isHexaNumber()

bool otb::TestHelper::isHexaNumber ( int  i) const
private

◆ isHexaPointerAddress() [1/2]

bool otb::TestHelper::isHexaPointerAddress ( const std::string &  str) const
private

◆ isHexaPointerAddress() [2/2]

bool otb::TestHelper::isHexaPointerAddress ( const std::string &  str,
vcl_size_t  pos,
vcl_size_t  size 
) const
private

◆ IsLineValid()

bool otb::TestHelper::IsLineValid ( const std::string &  str,
const StringList ignoredLines 
) const
private

◆ isMinusSign()

bool otb::TestHelper::isMinusSign ( int  i) const
private

◆ isNumber()

bool otb::TestHelper::isNumber ( int  i) const
private

◆ isNumeric()

bool otb::TestHelper::isNumeric ( const std::string &  str) const
private

◆ isPoint()

bool otb::TestHelper::isPoint ( int  i) const
private

◆ isScientificNumeric()

bool otb::TestHelper::isScientificNumeric ( const std::string &  str) const
private

◆ isToBeIgnoredForAnyComparison()

bool otb::TestHelper::isToBeIgnoredForAnyComparison ( const std::string &  str) const
private

◆ IsTokenEmpty()

static bool otb::TestHelper::IsTokenEmpty ( boost::iterator_range< std::string::const_iterator > &  token)
staticprivate

◆ New()

static Pointer otb::TestHelper::New ( )
static

Referenced by main().

◆ ogrReportOnLayer()

void otb::TestHelper::ogrReportOnLayer ( OGRLayer *  ref_poLayer,
const char *  ref_pszWHERE,
OGRGeometry *  ref_poSpatialFilter,
OGRLayer *  test_poLayer,
const char *  test_pszWHERE,
OGRGeometry *  test_poSpatialFilter,
int &  nbdiff,
double  epsilon 
) const
private

◆ RegressionTestAllAscii()

int otb::TestHelper::RegressionTestAllAscii ( const StringList baselineFilenamesAscii,
const StringList testFilenamesAscii,
const EpsilonList epsilons,
const StringList ignoredLines 
)

◆ RegressionTestAllBinary()

int otb::TestHelper::RegressionTestAllBinary ( const StringList baselineFilenamesBinary,
const StringList testFilenamesBinary 
)

◆ RegressionTestAllDiff()

int otb::TestHelper::RegressionTestAllDiff ( const StringList baselineFilenamesAscii,
const StringList testFilenamesAscii,
const EpsilonList epsilons,
const StringList ignoredLines 
)

◆ RegressionTestAllImages()

int otb::TestHelper::RegressionTestAllImages ( const StringList baselineFilenamesImage,
const StringList testFilenamesImage,
const EpsilonList epsilons 
)

◆ RegressionTestAllMetaData()

int otb::TestHelper::RegressionTestAllMetaData ( const StringList baselineFilenamesMetaData,
const StringList testFilenamesMetaData,
const EpsilonList epsilons 
)

◆ RegressionTestAllOgr()

int otb::TestHelper::RegressionTestAllOgr ( const StringList baselineFilenamesOgr,
const StringList testFilenamesOgr,
const EpsilonList epsilons 
)

◆ RegressionTestAsciiFile()

int otb::TestHelper::RegressionTestAsciiFile ( const char *  testAsciiFileName,
const char *  baselineAsciiFileName,
const double  epsilon,
std::vector< std::string >  ignoredLines 
) const
private

◆ RegressionTestBaselines()

std::map<std::string, int> otb::TestHelper::RegressionTestBaselines ( char *  baselineFilename) const
private

◆ RegressionTestBinaryFile()

int otb::TestHelper::RegressionTestBinaryFile ( const char *  testBinaryFileName,
const char *  baselineBinaryFileName 
) const
private

◆ RegressionTestDiffFile()

int otb::TestHelper::RegressionTestDiffFile ( const char *  testAsciiFileName,
const char *  baselineAsciiFileName,
const double  epsilon,
std::vector< std::string >  ignoredLines 
) const
private

◆ RegressionTestImage()

int otb::TestHelper::RegressionTestImage ( int  cpt,
const char *  testImageFilename,
const char *  baselineImageFilename,
const double  toleranceDiffPixelImage 
) const
private

◆ RegressionTestMetaData()

int otb::TestHelper::RegressionTestMetaData ( const char *  testImageFilename,
const char *  baselineImageFilename,
const double  toleranceDiffPixelImage 
) const
private

◆ RegressionTestOgrFile()

int otb::TestHelper::RegressionTestOgrFile ( const char *  testOgrFilename,
const char *  baselineOgrFilename,
const double  toleranceDiffValue 
) const
private

◆ ReportErrorsOff()

virtual void otb::TestHelper::ReportErrorsOff ( )
virtual

◆ ReportErrorsOn()

virtual void otb::TestHelper::ReportErrorsOn ( )
virtual

◆ SetEpsilonBoundaryChecking()

virtual void otb::TestHelper::SetEpsilonBoundaryChecking ( double  _arg)
virtual

◆ SetIgnoreLineOrder()

virtual void otb::TestHelper::SetIgnoreLineOrder ( bool  _arg)
virtual

◆ SetReportErrors()

virtual void otb::TestHelper::SetReportErrors ( bool  _arg)
virtual

◆ SetToleranceRatio()

virtual void otb::TestHelper::SetToleranceRatio ( double  _arg)
virtual

◆ TokenizeLine()

int otb::TestHelper::TokenizeLine ( const std::string &  line,
StringList tokens 
) const
private

◆ VectorToString()

std::string otb::TestHelper::VectorToString ( const otb::MetaDataKey::VectorType vector) const
private

Member Data Documentation

◆ m_EpsilonBoundaryChecking

double otb::TestHelper::m_EpsilonBoundaryChecking
private

Definition at line 137 of file otbTestHelper.h.

◆ m_IgnoreLineOrder

bool otb::TestHelper::m_IgnoreLineOrder
private

Definition at line 139 of file otbTestHelper.h.

◆ m_MaxArea

const unsigned int otb::TestHelper::m_MaxArea
private

Definition at line 140 of file otbTestHelper.h.

◆ m_ReportErrors

bool otb::TestHelper::m_ReportErrors
private

Definition at line 138 of file otbTestHelper.h.

◆ m_SpecialTokens

std::vector<std::pair<std::string, std::string> > otb::TestHelper::m_SpecialTokens
private

Definition at line 146 of file otbTestHelper.h.

◆ m_ToleranceRatio

double otb::TestHelper::m_ToleranceRatio
private

Definition at line 136 of file otbTestHelper.h.


The documentation for this class was generated from the following file: