Orthodox |
The template Orthodox (see Figure C-9) is a subclass of TestCase . When specialized for a class, it tests the class for "orthodoxy," represented by the following conditions:
The class has a default (no argument) constructor
The class has equality (==) and inequality (!=) operators
The class has an assignment (=) operator
The class has a negation (!) operator
The class has a copy constructor
The test verifies not only that ClassUnderTest has these operations, but also that the operations' semantics are correct. For example, double negation should result in equality.
The main purpose of Orthodox is to serve as a working example of a templated test case.
Orthodox belongs to the namespace CppUnit . It is declared and implemented in extensions/Orthodox.h .
template<typename ClassUnderTest> class Orthodox : public TestCase
A constructor.
Returns object .
Runs the orthodoxy tests.
None.
None.