CFIXCC_ASSERT_GREATER[_OR_EQUAL]_MESSAGE
CFIXCC_ASSERT_GREATER_MESSAGE and CFIXCC_ASSERT_GREATER_OR_EQUAL_MESSAGE allow typesafe comparison of values. Failed comparisons are treated as a failure, i.e. in the same manner as a failed CFIX_ASSERT. The benefit over using CFIX_ASSERT( Expected > Actual )/CFIX_ASSERT( Expected >= Actual ) is that the expected and actual value will be visible in the failure report.
Unlike CFIXCC_ASSERT_GREATER, CFIXCC_ASSERT_GREATER_MESSAGE and CFIXCC_ASSERT_GREATER_OR_EQUAL_MESSAGE additionally allows a user defined message to be specified. This message will be contained in the failure report.
void CFIXCC_ASSERT_GREATER_MESSAGE( __in T Expected, __in T Actual, __in PCWSTR Message, ... ); void CFIXCC_ASSERT_GREATER_MESSAGE( __in T Expected, __in T Actual, __in PCSTR Message, ... ); void CFIXCC_ASSERT_GREATER_OR_EQUAL_MESSAGE( __in T Expected, __in T Actual, __in PCWSTR Message, ... ); void CFIXCC_ASSERT_GREATER_OR_EQUAL_MESSAGE( __in T Expected, __in T Actual, __in PCSTR Message, ... );
T can be any type, but the types of both values must be compatible. See discussion below.
[in] Expected: The expected value.
[in] Actual: The actual value that is to be checked.
[in] Message: Message to be included in a failure report. This parameter allows printf-style formatters to be used. The routine is overloaded and allows Message to be either a unicode or an ANSI string.
For a discussion on how the comparisons is conducted, see CFIXCC_ASSERT_GREATER.
CFIXCC_ASSERT_GREATER_OR_EQUAL_MESSAGE( 2.0f, FloatValue, "Checking that %f is greater than or equal to 2.0", FloatValue );
Table 7.34.
User Mode | Kernel Mode | |
---|---|---|
Available since | 1.2 | N/A |
Header | Declared in cfixcc.h | N/A |
Library | Link to cfix.lib | N/A |
DLL | cfix.dll | N/A |
IRQL | N/A | N/A |
Note that due to the use of variadic macro arguments, at least cl 14.00 (Visual Studio 2005) is required to use the formatting capabilities of this routine. For downlevel compilers, Message is treated as-is (i.e. without formatting) and the variadic argument list has to be empty.