Chaste Release::3.1
|
#include <AbstractFileComparison.hpp>
Public Member Functions | |
AbstractFileComparison (const FileFinder &rFileFinder1, const FileFinder &rFileFinder2, bool calledCollectively, bool suppressOutput) | |
AbstractFileComparison (std::string fileName1, std::string fileName2, bool calledCollectively, bool suppressOutput) | |
virtual | ~AbstractFileComparison () |
Protected Member Functions | |
void | ResetFiles () |
void | SkipHeaderLines (unsigned numLinesToSkip) |
Protected Attributes | |
std::string | mFilename1 |
std::string | mFilename2 |
std::ifstream * | mpFile1 |
std::ifstream * | mpFile2 |
unsigned | mLineNum |
bool | mCalledCollectively |
bool | mSuppressOutput |
Private Member Functions | |
void | Setup () |
Abstract class for comparing two files, looking for differences in tests.
Definition at line 47 of file AbstractFileComparison.hpp.
AbstractFileComparison::AbstractFileComparison | ( | const FileFinder & | rFileFinder1, |
const FileFinder & | rFileFinder2, | ||
bool | calledCollectively, | ||
bool | suppressOutput | ||
) | [inline] |
Specify two files to compare, and open them for reading. Actual comparison is done by calling CompareFiles.
rFileFinder1 | first file |
rFileFinder2 | second file |
calledCollectively | If true there will be a barrier before opening files, and only master compares contents. |
suppressOutput | If true then no errors will go to TS_TRACE(). Should only be set for the test of this class. |
Definition at line 60 of file AbstractFileComparison.hpp.
References Setup().
AbstractFileComparison::AbstractFileComparison | ( | std::string | fileName1, |
std::string | fileName2, | ||
bool | calledCollectively, | ||
bool | suppressOutput | ||
) | [inline] |
Specify two files to compare, and open them for reading. Actual comparison is done by calling CompareFiles.
fileName1 | first file |
fileName2 | second file |
calledCollectively | If true there will be a barrier before opening files, and only master compares contents. |
suppressOutput | If true then no errors will go to TS_TRACE(). Should only be set for the test of this class. |
Definition at line 78 of file AbstractFileComparison.hpp.
References Setup().
virtual AbstractFileComparison::~AbstractFileComparison | ( | ) | [inline, virtual] |
Close the files being compared.
Definition at line 90 of file AbstractFileComparison.hpp.
void AbstractFileComparison::ResetFiles | ( | ) | [inline, protected] |
This method closes and reopens files so that another CompareFiles() command can be run on the same object.
Definition at line 122 of file AbstractFileComparison.hpp.
References PetscTools::AmMaster(), mCalledCollectively, mFilename1, mFilename2, mLineNum, mpFile1, and mpFile2.
Referenced by NumericFileComparison::CompareFiles(), and FileComparison::CompareFiles().
void AbstractFileComparison::Setup | ( | ) | [inline, private] |
Private method called only by the two constructors.
Definition at line 159 of file AbstractFileComparison.hpp.
References PetscTools::AmMaster(), PetscTools::Barrier(), EXCEPTION, mCalledCollectively, mFilename1, mFilename2, mLineNum, mpFile1, and mpFile2.
Referenced by AbstractFileComparison().
void AbstractFileComparison::SkipHeaderLines | ( | unsigned | numLinesToSkip | ) | [inline, protected] |
This helper method just moves forward the two file pointers to skip some header lines.
numLinesToSkip | The number of header lines to skip |
Definition at line 139 of file AbstractFileComparison.hpp.
References PetscTools::AmMaster(), mCalledCollectively, mLineNum, mpFile1, and mpFile2.
Referenced by NumericFileComparison::CompareFiles(), and FileComparison::CompareFiles().
bool AbstractFileComparison::mCalledCollectively [protected] |
If true there will be a barrier before opening files, and only master compares contents.
Definition at line 114 of file AbstractFileComparison.hpp.
Referenced by NumericFileComparison::CompareFiles(), FileComparison::CompareFiles(), ResetFiles(), Setup(), and SkipHeaderLines().
std::string AbstractFileComparison::mFilename1 [protected] |
First filename
Definition at line 106 of file AbstractFileComparison.hpp.
Referenced by NumericFileComparison::CompareFiles(), FileComparison::CompareFiles(), ResetFiles(), and Setup().
std::string AbstractFileComparison::mFilename2 [protected] |
Second filename
Definition at line 107 of file AbstractFileComparison.hpp.
Referenced by NumericFileComparison::CompareFiles(), FileComparison::CompareFiles(), ResetFiles(), and Setup().
unsigned AbstractFileComparison::mLineNum [protected] |
Counter for the line number we are on (in FileComparision)
Definition at line 112 of file AbstractFileComparison.hpp.
Referenced by FileComparison::CompareFiles(), ResetFiles(), Setup(), and SkipHeaderLines().
std::ifstream* AbstractFileComparison::mpFile1 [protected] |
First file
Definition at line 109 of file AbstractFileComparison.hpp.
Referenced by NumericFileComparison::CompareFiles(), FileComparison::CompareFiles(), ResetFiles(), Setup(), SkipHeaderLines(), and ~AbstractFileComparison().
std::ifstream* AbstractFileComparison::mpFile2 [protected] |
Second file
Definition at line 110 of file AbstractFileComparison.hpp.
Referenced by NumericFileComparison::CompareFiles(), FileComparison::CompareFiles(), ResetFiles(), Setup(), SkipHeaderLines(), and ~AbstractFileComparison().
bool AbstractFileComparison::mSuppressOutput [protected] |
Whether we should suppress output from this class, just for a clean looking test
Definition at line 117 of file AbstractFileComparison.hpp.
Referenced by NumericFileComparison::CompareFiles(), and FileComparison::CompareFiles().