ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::GTest::Predicate Namespace Reference

Functions

template<typename T>
inline ::testing::AssertionResult CheckMetaDataPredFormat (const char *metaDictExpr, const char *keyExpr, const char *knownValueExpr, itk::MetaDataDictionary &metaDict, const std::string &key, const T &knownValue)
 
template<typename T1, typename T2>
inline ::testing::AssertionResult VectorDoubleRMSPredFormat (const char *expr1, const char *expr2, const char *rmsErrorExpr, const T1 &val1, const T2 &val2, double rmsError)
 

Detailed Description

The Predicate namespace contains functions used to implement custom GTest Predicate-Formatters.

Function Documentation

◆ CheckMetaDataPredFormat()

template<typename T>
inline ::testing::AssertionResult itk::GTest::Predicate::CheckMetaDataPredFormat ( const char * metaDictExpr,
const char * keyExpr,
const char * knownValueExpr,
itk::MetaDataDictionary & metaDict,
const std::string & key,
const T & knownValue )

Implements GTest Predicate Formatter for ITK_EXPECT_METADATA_VALUE macro.

Definition at line 56 of file itkGTestPredicate.h.

References itk::Math::AlmostEquals(), itk::ExposeMetaData(), and itk::MetaDataDictionary::Print().

◆ VectorDoubleRMSPredFormat()

template<typename T1, typename T2>
inline ::testing::AssertionResult itk::GTest::Predicate::VectorDoubleRMSPredFormat ( const char * expr1,
const char * expr2,
const char * rmsErrorExpr,
const T1 & val1,
const T2 & val2,
double rmsError )

Implements GTest Predicate Formatter for ITK_EXPECT_VECTOR_NEAR macro. This macro and formatter work with any combination of ITK array-like objects which are supported by itk::NumericTraits. The arrays must be the same length, and the root mean squares error is used to check if the arrays are "near" each other.

Definition at line 173 of file itkGTestPredicate.h.

References itk::NumericTraits< T >::GetLength().