35 #ifndef NUMERICFILECOMPARISON_HPP_ 36 #define NUMERICFILECOMPARISON_HPP_ 40 #include "AbstractFileComparison.hpp" 43 #define A_WORD DBL_MAX 44 #define NOTHING_TO_READ DBL_MIN 75 if (word ==
"#" || word ==
"!")
78 pFile->ignore(1024,
'\n');
84 rData = NOTHING_TO_READ;
100 NumericFileComparison(std::string fileName1, std::string fileName2,
bool calledCollectively=
true,
bool suppressOutput =
false)
131 bool CompareFiles(
double absTol=DBL_EPSILON,
unsigned ignoreFirstFewLines=0,
132 double relTol=DBL_EPSILON,
bool doTsAssert=
true)
143 unsigned failures = 0;
144 unsigned max_display_failures = 10;
162 while (data1 != NOTHING_TO_READ && data2 != NOTHING_TO_READ);
167 TS_ASSERT_EQUALS(failures, 0u);
178 return (failures==0);
static bool WithinAnyTolerance(double number1, double number2, double relTol=DBL_EPSILON, double absTol=DBL_EPSILON, bool printError=false)
void SkipHeaderLines(unsigned numLinesToSkip)
NumericFileComparison(const FileFinder &rFileName1, const FileFinder &rFileName2, bool calledCollectively=true, bool suppressOutput=false)
NumericFileComparison(std::string fileName1, std::string fileName2, bool calledCollectively=true, bool suppressOutput=false)
void ReadNextToken(std::ifstream *pFile, double &rData)
bool CompareFiles(double absTol=DBL_EPSILON, unsigned ignoreFirstFewLines=0, double relTol=DBL_EPSILON, bool doTsAssert=true)