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

CFIX_FIXTURE_AFTER

CFIX_FIXTURE_AFTER

Synopsis

Used to specify a routine that is to be used as after-routine. The after-routine will be called once per test routine, after the test routine has been invoked. As such, the after-routine should be used to clean up any state set up by a before-routine or a test routine.

Specifying CFIX_FIXTURE_AFTER is optional. Note, however, that CFIX_FIXTURE_AFTER may be used at most once per fixture definition.

See here for an example of a complete fixture definition.

Declaration
CFIX_FIXTURE_AFTER( Routine )
				

Setup routines must have the following signature. Specifying __stdcall is only required if /Gz is not used as compiler switch.

void __stdcall AfterRoutine()
				
Remarks

The after-routine will be called regardless of whether the test routine succeeded or not. The only situation in which the after-routine is not called is when the before-routine has failed, in which case the test routine also did not run.

[Note]Note
For certain cleanup work that should occur only once per fixture (rather than once per test routine), use a teardown routine rather than an after-routine.
Requirements

Table 7.25. 

 User ModeKernel Mode
Available since1.21.2
HeaderDeclared in cfix.hDeclared in cfix.h
IRQLN/ACalled at PASSIVE_LEVEL