CFIX_FIXTURE_BEFORE
Used to specify a routine that is to be used as before-routine. The before-routine will be called once per test routine, before the test routine is invoked. As such, the before-routine should be used to initialize any state required by the test routines. Use CfixPeSetValue to store any custom state information and make it available to test- and after routines.
Specifying CFIX_FIXTURE_BEFORE is optional. Note, however, that CFIX_FIXTURE_BEFORE may be used at most once per fixture definition.
See here for an example of a complete fixture definition.
CFIX_FIXTURE_BEFORE( Routine )
Setup routines must have the following signature. Specifying __stdcall is only required if /Gz is not used as compiler switch.
void __stdcall BeforeRoutine()
When the before-routine fails, the current test routine will not be called. The after-routine (if present) will not be called either.
![]() | Note |
---|---|
For certain initialization work that should occur only once per fixture (rather than once per test routine), use a setup routine rather than a before-routine. |