TestHelpers.cc File Reference
#include "Helpers/TestHelpers.h"
#include "Logger.h"

Functions

template<class T >
void checkTemplate (T real, T ideal, double error, std::string whatIsChecked)
 

Function Documentation

◆ checkTemplate()

template<class T >
void checkTemplate ( real,
ideal,
double  error,
std::string  whatIsChecked 
)
31 {
32  logger.assert_always(mathsFunc::isEqual(real, ideal, error),
33  whatIsChecked + ": % (should be %) ", real, ideal);
34  logger(INFO, whatIsChecked + ": % (correct)", real);
35 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
bool isEqual(Mdouble v1, Mdouble v2, Mdouble absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
Definition: ExtendedMath.cc:251

References INFO, mathsFunc::isEqual(), and logger.

Referenced by helpers::check().