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

WIN_ASSERT_NOT_EQUAL

WIN_ASSERT_NOT_EQUAL

Synopsis

WIN_ASSERT_NOT_EQUAL allows typesafe inequality comparisons of values. WIN_ASSERT_NOT_EQUAL works analogously to WIN_ASSERT_EQUAL.

Declaration
void WIN_ASSERT_NOT_EQUAL( 
	__in T Expected, 
	__in U Actual,
	...
	);
			

T and U may either be the same type or compatible types. That is, an appropriate operator!= must have been implemented that allows objects of type T and U to be checked for inequality.

Parameters

[in] Expected: The expected value.

[in] Actual: The actual value that 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.

Remarks

Please refer to the remarks section of CFIXCC_ASSERT_EQUALS for a discussion on how comparisons are conducted.

Usage example
int Foo = 2;
...
WIN_ASSERT_NOT_EQUAL( 0, Foo );
WIN_ASSERT_NOT_EQUAL( 0, Foo, "Foo should never be %s, "zero" );
			
Requirements

Table 7.43. 

 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.