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 ( T  real,
T  ideal,
double  error,
std::string  whatIsChecked 
)
10 {
11  logger.assert_always(mathsFunc::isEqual(real, ideal, error),
12  whatIsChecked + ": % (should be %) ", real, ideal);
13  logger(INFO, whatIsChecked + ": % (correct)", real);
14 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
#define INFO(i)
Definition: mumps_solver.h:54
int error
Definition: calibrate.py:297
bool isEqual(Mdouble v1, Mdouble v2, Mdouble absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
Definition: ExtendedMath.cc:230
Definition: main.h:115

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

Referenced by helpers::check().