CFIXCC_BEGIN_CLASS_EX
CFIXCC_BEGIN_CLASS_EX 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.
CFIXCC_BEGIN_CLASS_EX behaves like CFIXCC_BEGIN_CLASS, but additionally allows flags to be specified. Flags can be used to enable/disable certain features for this specific fixture.
CFIXCC_BEGIN_CLASS_EX( ClassName, ULONG Flags )
![]() | 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. |
ClassName: name of the corresponding class. The class needs to publicly derive from TestFixture.
Flags: Flags for enabling/disabling certain features. The following flags are currently availale:
Table 7.36.
Flag | Description |
---|---|
CFIX_FIXTURE_USES_ANONYMOUS_THREADS | Enable Anonymous Thread Auto-Registration for this fixture. |
If Flags is set to 0, CFIXCC_BEGIN_CLASS_EX is equivalent to
CFIXCC_BEGIN_CLASS.
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_EX( SimpleFixture, CFIX_FIXTURE_USES_ANONYMOUS_THREADS ) 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_EX. 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.