#include <elm/util/test.h>
|
| TestCase (CString name) |
|
void | initialize (void) |
|
virtual | ~TestCase (void) |
|
cstring | name (void) |
|
void | test (CString file, int line, CString text) |
|
void | failed (void) |
|
void | succeeded (void) |
|
void | check (CString file, int line, CString text, bool result) |
|
bool | require (CString file, int line, CString text, bool result) |
|
template<class T > |
void | check_equal (CString file, int line, CString text, const T &result, const T &reference) |
|
void | prepare (void) |
|
void | complete (void) |
|
void | perform (void) |
|
bool | hasFailed (void) const |
|
This class is used for implementing macro for unit tests.
TestSet, CHECK, TEST_BEGIN, CHECK_BEGIN
elm::TestCase::TestCase |
( |
CString |
name | ) |
|
elm::TestCase::~TestCase |
( |
void |
| ) |
|
|
virtual |
void elm::TestCase::check |
( |
CString |
file, |
|
|
int |
line, |
|
|
CString |
text, |
|
|
bool |
result |
|
) |
| |
Check if a test has returned true.
- Parameters
-
file | Source file containing the test. |
line | Line in the source file of the test. |
text | Explanation about the test. |
result | Result of the test. |
References failed(), succeeded(), and test().
Referenced by check_equal(), and require().
template<class T >
void elm::TestCase::check_equal |
( |
CString |
file, |
|
|
int |
line, |
|
|
CString |
text, |
|
|
const T & |
result, |
|
|
const T & |
reference |
|
) |
| |
void elm::TestCase::complete |
( |
void |
| ) |
|
void elm::TestCase::execute |
( |
void |
| ) |
|
|
protectedvirtual |
Actual actions of the test.
Referenced by perform().
void elm::TestCase::failed |
( |
void |
| ) |
|
Inform that the current test has failed.
References elm::cout.
Referenced by check().
bool elm::TestCase::hasFailed |
( |
void |
| ) |
const |
void elm::TestCase::initialize |
( |
void |
| ) |
|
cstring elm::TestCase::name |
( |
void |
| ) |
|
void elm::TestCase::perform |
( |
void |
| ) |
|
void elm::TestCase::prepare |
( |
void |
| ) |
|
bool elm::TestCase::require |
( |
CString |
file, |
|
|
int |
line, |
|
|
CString |
text, |
|
|
bool |
result |
|
) |
| |
Same as check but also returns value and specific message for ending the test due to main failure.
- Parameters
-
file | File containing the test source. |
line | Line where the test is implemented. |
text | Text describing the test. |
result | Result of the test. |
- Returns
- Result of the test.
References check(), and elm::cout.
void elm::TestCase::succeeded |
( |
void |
| ) |
|
Inform that the current test has succeeded.
References elm::cout.
Referenced by check().
Prepare to do a test.
- Parameters
-
file | Source file. |
line | Source line. |
text | Code text to test. |
References elm::cout.
Referenced by check().
The documentation for this class was generated from the following files:
- include/elm/util/test.h
- src/util_test.cpp