#include <test_mgr.h>
Definition at line 38 of file test_mgr.h.
Public Member Functions | |
bool | report () |
Provide a report of all tests so far. | |
std::string | get_last_fail () |
Returns the description of the last test that failed. | |
void | set_output_level (int l) |
Set the output level. | |
int | get_ntests () |
Return the number of tests performed so far. | |
The testing methods | |
bool | test_rel (double result, double expected, double rel_error, std::string description) |
Test for ![]() | |
bool | test_abs (double result, double expected, double abs_error, std::string description) |
Test for ![]() | |
bool | test_fact (double result, double expected, double factor, std::string description) |
Test for ![]() | |
bool | test_str (std::string result, std::string expected, std::string description) |
Test for ![]() | |
bool | test_gen (bool value, std::string description) |
Test for ![]() | |
template<class vec_t , class vec2_t > | |
bool | test_rel_arr (int nv, vec_t &result, vec2_t &expected, double rel_error, std::string description) |
Test for ![]() | |
template<class mat_t , class mat2_t > | |
bool | test_rel_mat (int nr, int nc, mat_t &result, mat2_t &expected, double rel_error, std::string description) |
Test for ![]() | |
template<class vec_t , class vec2_t > | |
bool | test_abs_arr (int nv, vec_t &result, vec2_t &expected, double rel_error, std::string description) |
Test for ![]() | |
template<class vec_t , class vec2_t > | |
bool | test_fact_arr (int nv, vec_t &result, vec2_t &expected, double factor, std::string description) |
Test for ![]() | |
template<class vec_t > | |
bool | test_gen_arr (int nv, vec_t &result, vec_t &expected, std::string description) |
Test for equality of a generic array. | |
Data Fields | |
bool | success |
True if all tests have passed. | |
std::string | last_fail |
The description of the last failed test. | |
Protected Member Functions | |
void | process_test (bool ret, std::string d2, std::string description) |
A helper function for processing tests. | |
Protected Attributes | |
int | ntests |
The number of tests performed. | |
int | output_level |
The output level. | |
Friends | |
const test_mgr | operator+ (const test_mgr &left, const test_mgr &right) |
Add two test_mgr objects (if either failed, the sum fails). |
bool report | ( | ) |
Returns true if all tests have passed and false if at least one test failed.
void set_output_level | ( | int | l | ) | [inline] |
Possible values:
Definition at line 78 of file test_mgr.h.
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page