DCMTK
Version 3.6.2
OFFIS DICOM Toolkit
|
A simple framework for writing and running test cases. More...
Classes | |
class | OFTestTest |
A single test case which can be run. More... | |
class | OFTestManager |
The test manager singleton manages the list of available test cases and executes them. More... | |
Macros | |
#define | OFTEST_MAIN(module) |
Implement a main() function for running tests. More... | |
#define | OFTEST_CLASS(testName) |
Internal macro for generating a class definition, don't use yourself! | |
#define | OFTEST_REGISTER_INT(testName) OFTest ## testName OFTest ## testName ## instance |
Register a test to the test manager. More... | |
#define | OFTEST_REGISTER(testName) |
Register a test to the test manager. More... | |
#define | OFTEST(testName) OFTEST_FLAGS(testName, EF_None) |
Macro to define a new test case. More... | |
#define | OFTEST_FLAGS(testName, flags) |
Macro to define a new test case. More... | |
macros for checking conditions in tests | |
These macros can be used for doing various checks in test cases. In case their check fails, they emit a descriptive message explaining the problem. | |
#define | OFCHECK(condition) |
Check if a condition is true. More... | |
#define | OFCHECK_EQUAL(val1, val2) |
Check if two values are equal. More... | |
#define | OFCHECK_FAIL(message) |
Unconditionally add a failure. More... | |
A simple framework for writing and running test cases.
#define OFCHECK | ( | condition | ) |
#define OFCHECK_EQUAL | ( | val1, | |
val2 | |||
) |
Check if two values are equal.
Can only be used inside OFTEST(). Both arguments must be compatible with OFOStringStream's operator<<.
val1 | first value to compare |
val2 | second value to compare |
#define OFCHECK_FAIL | ( | message | ) |
Unconditionally add a failure.
message | string describing the failure |
#define OFTEST | ( | testName | ) | OFTEST_FLAGS(testName, EF_None) |
Macro to define a new test case.
Internally this defines a new class inheriting from OFTest. This is equivalent to OFTEST_FLAGS(testName, EF_None).
testName | name describing the test |
#define OFTEST_FLAGS | ( | testName, | |
flags | |||
) |
Macro to define a new test case.
Internally this defines a new class inheriting from OFTest.
flags | flags that should be set for this test |
testName | name describing the test |
#define OFTEST_MAIN | ( | module | ) |
Implement a main() function for running tests.
The main function will return the number of failed tests or -1 if an invalid test name was given.
module | the name of the module which is under test. |
#define OFTEST_REGISTER | ( | testName | ) |
Register a test to the test manager.
testName | name of the test to register |
#define OFTEST_REGISTER_INT | ( | testName | ) | OFTest ## testName OFTest ## testName ## instance |
Register a test to the test manager.
Normally you should use OFTEST_REGISTER instead, but that macro doesn't work if OFTEST and OFTEST_REGISTER are called in the same source file.
testName | name of the test to register |