35#ifndef NUMERICFILECOMPARISON_HPP_
36#define NUMERICFILECOMPARISON_HPP_
40#include "AbstractFileComparison.hpp"
43#include <cxxtest/TestSuite.h>
46#define NOTHING_TO_READ DBL_MIN
77 if (word ==
"#" || word ==
"!")
80 pFile->ignore(1024,
'\n');
86 rData = NOTHING_TO_READ;
102 NumericFileComparison(std::string fileName1, std::string fileName2,
bool calledCollectively=
true,
bool suppressOutput =
false)
133 bool CompareFiles(
double absTol=DBL_EPSILON,
unsigned ignoreFirstFewLines=0,
134 double relTol=DBL_EPSILON,
bool doTsAssert=
true)
145 unsigned failures = 0;
146 unsigned max_display_failures = 10;
164 while (data1 != NOTHING_TO_READ && data2 != NOTHING_TO_READ);
169 TS_ASSERT_EQUALS(failures, 0u);
180 return (failures==0);
void SkipHeaderLines(unsigned numLinesToSkip)
static bool WithinAnyTolerance(double number1, double number2, double relTol=DBL_EPSILON, double absTol=DBL_EPSILON, bool printError=false)
void ReadNextToken(std::ifstream *pFile, double &rData)
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)
bool CompareFiles(double absTol=DBL_EPSILON, unsigned ignoreFirstFewLines=0, double relTol=DBL_EPSILON, bool doTsAssert=true)