Page tree

Skip to end of metadata
Go to start of metadata

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_ENUM(scoped_enum_name, value_string, value)

Reports the given integral value as the enumeration identifier 'value_string' for identification. See Handling Enum Values for details.
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 an 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