Go to the documentation of this file.
76 #define _test(cond) do_test(cond, #cond, __FILE__, __LINE__)
77 #define _numtest(num, orig) do_numtest(num, orig, #num, #orig, __FILE__, __LINE__)
79 #define _numtesttol(num, orig, tol) do_numtest(num, orig, #num, #orig, __FILE__, __LINE__, tol)
81 #define _fail(str) do_fail(str, __FILE__, __LINE__)
123 const char* fname,
long lineno);
126 const string& lbl2,
const char* fname,
long lineno,
127 const double tol = 1e-10);
128 bool do_numtest(std::complex<double> num, std::complex<double> orig,
129 const string& lbl,
const string& lbl2,
const char* fname,
130 long lineno,
const double tol = 1e-10);
135 const char* fname,
long lineno);
148 m_osptr(osptr), m_nPass(0), m_nFail(0) {
const ostream * getStream() const
Returns output stream.
bool do_numtest(std::complex< double > num, std::complex< double > orig, const string &lbl, const string &lbl2, const char *fname, long lineno, const double tol=1e-10)
TestCase & operator=(const TestCase &)
Disallowed.
long report() const
Prints a report on the number of passed and failed tests to the output stream.
void do_fail(const string &lbl, const char *fname, long lineno)
Internal function to report a failed test (besides increasing the failed counter)
TestCase(const TestCase &)
Disallowed.
virtual void reset()
Resets the counters for the failed and passed tests.
void setStream(ostream *osptr)
Sets the output stream.
bool do_test(bool cond, const string &lbl, const char *fname, long lineno)
Internal function to do a test.
bool do_numtest(double num, double orig, const string &lbl, const string &lbl2, const char *fname, long lineno, const double tol=1e-10)
Internal function to do a numerical test.
void _succeed()
Explicitly succeds a test.
long getNumFailed() const
Returns number of failed tests.
TestCase(ostream *osptr=0)
Constructor.
virtual void run()=0
Runs the tests. Must be overwritten by the specialization.
long getNumPassed() const
Returns number of passed tests.