OTB  6.7.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 Self
ConstPointer
 
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 Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

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
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
virtual ModifiedTimeType GetMTime () const
 
virtual const std::string & GetObjectName () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
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
 

Additional Inherited Members

- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Detailed Description

Helper class to perform the baseline comparisons during the tests.

Definition at line 47 of file otbTestHelper.h.

Member Typedef Documentation

Definition at line 54 of file otbTestHelper.h.

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

Definition at line 63 of file otbTestHelper.h.

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

Definition at line 64 of file otbTestHelper.h.

Definition at line 53 of file otbTestHelper.h.

Standard class typedefs.

Definition at line 52 of file otbTestHelper.h.

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

Definition at line 58 of file otbTestHelper.h.

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

Definition at line 61 of file otbTestHelper.h.

Definition at line 55 of file otbTestHelper.h.

Constructor & Destructor Documentation

otb::TestHelper::TestHelper ( )
otb::TestHelper::~TestHelper ( )
override

Member Function Documentation

void otb::TestHelper::AddWhiteSpace ( const std::string &  strIn,
std::string &  strOut 
) const
private
void otb::TestHelper::CheckValueTolerance ( const char *  Comment,
double  ref,
double  test,
int &  count,
bool  report,
double  epsilon 
) const
private
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
virtual::itk::LightObject::Pointer otb::TestHelper::CreateAnother ( void  ) const
virtual

Reimplemented from itk::Object.

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

Reimplemented from itk::Object.

virtual void otb::TestHelper::IgnoreLineOrderOff ( )
virtual
virtual void otb::TestHelper::IgnoreLineOrderOn ( )
virtual
bool otb::TestHelper::isAlphaNum ( int  i) const
private
bool otb::TestHelper::isHexaNumber ( int  i) const
private
bool otb::TestHelper::isHexaPointerAddress ( const std::string &  str) const
private
bool otb::TestHelper::isHexaPointerAddress ( const std::string &  str,
vcl_size_t  pos,
vcl_size_t  size 
) const
private
bool otb::TestHelper::IsLineValid ( const std::string &  str,
const StringList ignoredLines 
) const
private
bool otb::TestHelper::isMinusSign ( int  i) const
private
bool otb::TestHelper::isNumber ( int  i) const
private
bool otb::TestHelper::isNumeric ( const std::string &  str) const
private
bool otb::TestHelper::isPoint ( int  i) const
private
bool otb::TestHelper::isScientificNumeric ( const std::string &  str) const
private
bool otb::TestHelper::isToBeIgnoredForAnyComparison ( const std::string &  str) const
private
static bool otb::TestHelper::IsTokenEmpty ( boost::iterator_range< std::string::const_iterator > &  token)
staticprivate
static Pointer otb::TestHelper::New ( )
static

Referenced by main().

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
int otb::TestHelper::RegressionTestAllAscii ( const StringList baselineFilenamesAscii,
const StringList testFilenamesAscii,
const EpsilonList epsilons,
const StringList ignoredLines 
)
int otb::TestHelper::RegressionTestAllBinary ( const StringList baselineFilenamesBinary,
const StringList testFilenamesBinary 
)
int otb::TestHelper::RegressionTestAllDiff ( const StringList baselineFilenamesAscii,
const StringList testFilenamesAscii,
const EpsilonList epsilons,
const StringList ignoredLines 
)
int otb::TestHelper::RegressionTestAllImages ( const StringList baselineFilenamesImage,
const StringList testFilenamesImage,
const EpsilonList epsilons 
)
int otb::TestHelper::RegressionTestAllMetaData ( const StringList baselineFilenamesMetaData,
const StringList testFilenamesMetaData,
const EpsilonList epsilons 
)
int otb::TestHelper::RegressionTestAllOgr ( const StringList baselineFilenamesOgr,
const StringList testFilenamesOgr,
const EpsilonList epsilons 
)
int otb::TestHelper::RegressionTestAsciiFile ( const char *  testAsciiFileName,
const char *  baselineAsciiFileName,
const double  epsilon,
std::vector< std::string >  ignoredLines 
) const
private
std::map<std::string, int> otb::TestHelper::RegressionTestBaselines ( char *  baselineFilename) const
private
int otb::TestHelper::RegressionTestBinaryFile ( const char *  testBinaryFileName,
const char *  baselineBinaryFileName 
) const
private
int otb::TestHelper::RegressionTestDiffFile ( const char *  testAsciiFileName,
const char *  baselineAsciiFileName,
const double  epsilon,
std::vector< std::string >  ignoredLines 
) const
private
int otb::TestHelper::RegressionTestImage ( int  cpt,
const char *  testImageFilename,
const char *  baselineImageFilename,
const double  toleranceDiffPixelImage 
) const
private
int otb::TestHelper::RegressionTestMetaData ( const char *  testImageFilename,
const char *  baselineImageFilename,
const double  toleranceDiffPixelImage 
) const
private
int otb::TestHelper::RegressionTestOgrFile ( const char *  testOgrFilename,
const char *  baselineOgrFilename,
const double  toleranceDiffValue 
) const
private
virtual void otb::TestHelper::ReportErrorsOff ( )
virtual
virtual void otb::TestHelper::ReportErrorsOn ( )
virtual
virtual void otb::TestHelper::SetEpsilonBoundaryChecking ( double  _arg)
virtual
virtual void otb::TestHelper::SetIgnoreLineOrder ( bool  _arg)
virtual
virtual void otb::TestHelper::SetReportErrors ( bool  _arg)
virtual
virtual void otb::TestHelper::SetToleranceRatio ( double  _arg)
virtual
int otb::TestHelper::TokenizeLine ( const std::string &  line,
StringList tokens 
) const
private
std::string otb::TestHelper::VectorToString ( const otb::MetaDataKey::VectorType vector) const
private

Member Data Documentation

double otb::TestHelper::m_EpsilonBoundaryChecking
private

Definition at line 168 of file otbTestHelper.h.

bool otb::TestHelper::m_IgnoreLineOrder
private

Definition at line 170 of file otbTestHelper.h.

const unsigned int otb::TestHelper::m_MaxArea
private

Definition at line 171 of file otbTestHelper.h.

bool otb::TestHelper::m_ReportErrors
private

Definition at line 169 of file otbTestHelper.h.

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

Definition at line 177 of file otbTestHelper.h.

double otb::TestHelper::m_ToleranceRatio
private

Definition at line 167 of file otbTestHelper.h.


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