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

CFIX_FAIL

CFIX_FAIL

Synopsis

Use CFIX_FAIL to unconditionally fail a test.

The macro allows printf-style formatting to construct the message. Consult the documentation of printf for a list of format specifiers.

Declaration
void CFIX_FAIL( 
	__in PCTSTR Format, 
	... 
	);
				

If UNICODE has been defined, string parameters are expected to by of type PCWSTR. Otherwise, ANSI is assumed and string parameters are expected to by of type PCSTR.

Remarks

In kernel mode, ANSI strings are not supported. Strings are always assumed to by of type PCWSTR. Moreover, formatting can only take place at IRQL <= APC_LEVEL. At higher IRQL, formatting is skipped and the Format string is used as-is.

As variadic macro arguments have not been supported until cl 14.00, this macro is not available if downlevel compilers are used.

Usage example
void SomeCallback()
{
  CFIX_FAIL( __TEXT( "SomeCallback should not be invoked" ) );
}
				
Requirements

Table 7.9. 

 User ModeKernel Mode
Available since1.51.5
HeaderDeclared in cfix.hDeclared in cfix.h
LibraryLink to cfix.libLink to cfixkdrv.lib
DLLcfix.dllN/A
IRQLN/ACallable at any IRQL