CFIX_FIXTURE_AFTER
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.
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()
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 |
---|---|
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. |