Visual Assert – The Unit Testing Add-In for Visual C++
cfix – C/C++ Unit Testing for Win32 and NT
 
 

CFIXCC_BEGIN_CLASS_EX

CFIXCC_BEGIN_CLASS_EX

Synopsis

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.

Declaration
CFIXCC_BEGIN_CLASS_EX( ClassName, ULONG Flags )
				
[Note]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.
Parameters

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. 

FlagDescription
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.

Remarks

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.

Requirements

Table 7.37. 

 User ModeKernel Mode
Available since1.6Not supported
HeaderDeclared in cfixcc.hNot supported
IRQLN/AN/A