|
DCMTK Version 3.6.9
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. | |
| #define | OFTEST_CLASS(testName) |
| Internal macro for generating a class definition, don't use yourself! | |
| #define | OFTEST_REGISTER_INT(testName) |
| Register a test to the test manager. | |
| #define | OFTEST_REGISTER(testName) |
| Register a test to the test manager. | |
| #define | OFTEST(testName) |
| Macro to define a new test case. | |
| #define | OFTEST_FLAGS(testName, flags) |
| Macro to define a new test case. | |
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. | |
| #define | OFCHECK_MSG(condition, errorDetails) |
| Check if a condition is true. | |
| #define | OFCHECK_EQUAL(val1, val2) |
| Check if two values are equal. | |
| #define | OFCHECK_FAIL(message) |
| Unconditionally add a failure. | |
A simple framework for writing and running test cases.
| #define OFCHECK | ( | condition | ) |
Check if a condition is true.
Can only be used inside OFTEST().
| condition | condition to check |
| #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 OFCHECK_MSG | ( | condition, | |
| errorDetails ) |
Check if a condition is true.
Can only be used inside OFTEST().
| condition | condition to check |
| errorDetails | additional error details (string) provided by caller |
| #define OFTEST | ( | testName | ) |
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 | ) |
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 |