CFIXCC_BEGIN_CLASS
CFIXCC_BEGIN_CLASS defines the start of a C++ fixture definition. For each class inheriting from TestFixture, one such definition must be provided. The name of the respective class must be provided as argument.
If, for example, you have written a class MyTestClass, publicly derviving from TestFixture, you need to provide a fixture definition initiated by a CFIXCC_BEGIN_CLASS( MyTestClass ).
CFIXCC_BEGIN_CLASS( ClassName )
![]() | Note |
---|---|
Do not put quotes around the class name. The name must match the name of the respective class, which in turn has to publicly derive from TestFixture. |
When the test class resides within a custom namespace, make sure to put the fixture definition into the same namespace. Example:
#include <cfixcc.h> namespace test { class SimpleFixture : public cfixcc::TestFixture { public: void Method01() { ... } }; CFIXCC_BEGIN_CLASS( SimpleFixture ) CFIXCC_METHOD( Method01 ) CFIXCC_END_CLASS() } // namespace
It is not allowed to specify a namespace-qualifed like test::SimpleFixture as argument to CFIXCC_BEGIN_CLASS. Please also note that cfix ignores the namespace when deriving the fixture name from the class. That is, the class name itself, without namespace qualification, must uniquely identify a fixture.