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

WIN_ASSERT_NOT_ZERO

WIN_ASSERT_NOT_ZERO

Synopsis

WIN_ASSERT_NOT_ZERO checks whether a given value is not equal to zero.

Declaration
void WIN_ASSERT_NOT_ZERO( 
	__in T Expression, 
	...
	);
			

T may be any signed or unsigned integer type.

Parameters

[in] Expression: The expression whose value is to be checked.

[in] ...: Optional: Message to be included in a failure report. This parameter allows printf-style formatters to be used, with the corresponding parameters being specified as subsequent arguments. The routine is overloaded and allows Message to be either a unicode or an ANSI string.

Usage example
int Foo = -1;
...
WIN_ASSERT_NOT_ZERO( 0, Foo );
WIN_ASSERT_NOT_ZERO( 0, Foo, "Foo should never be %s, "zero" );
			
Requirements

Table 7.46. 

 User ModeKernel Mode
Available since1.3N/A
HeaderDeclared in winunit.hN/A
LibraryLink to cfix.libN/A
DLLcfix.dllN/A
IRQLN/AN/A

Requires cl version 14.00 (VisualStudio 2005) or better.