These macros can be used in the post-condition section of the test case definition to report actual values of the test case outcomes. Such reports can be then automatically changed into assertions by C++test.

MacroDefinition
CPPTEST_POST_CONDITION_BOOL(value_string, value)Reports the given boolean 'value' using 'value_string' for identification.
CPPTEST_POST_CONDITION_INTEGER(value _string, value) Reports the given integer 'value' using 'value_string' for identification.
CPPTEST_POST_CONDITION_UINTEGER(value_string, value) Reports the given unsigned integer 'value' using 'value_string' for identification.
CPPTEST_POST_CONDITION_FLOAT(value_string, value) Reports the given floating point 'value' using 'value_string' for identification.
CPPTEST_POST_CONDITION_CSTR(value_string, value) Reports the given null-terminated string 'value' using 'value_string' for identification.
CPPTEST_POST_CONDITION_CSTR_N(value_ string, value, max_size) Reports the given null-terminated string 'value' using 'value_string' for identification. Only first 'max_size' characters are reported.
CPPTEST_POST_CONDITION_MEM_BUFFER(value_string, value, size) Reports the given memory buffer 'value' using 'value_string' for identification.  First 'size' bytes of the buffer are reported.
CPPTEST_POST_CONDITION_PTR(value_string, value) Reports the given pointer 'value' using 'value_string' for identification.
CPPTEST_POST_CONDITION_EXTERNAL(value_string, program, param1, param2, param3)Uses external application to produce the value to be reported using 'value_string' for identification. Runs 'program' executable which receives three parameters (param1, param2, param3). Program stdout is used as a message to be reported.
  • No labels