This topic provides details about results in the Assertion Failure category.

Description

A Fix Unit Test Problems> Assertion Failures message indicates that a test case  did not produce the correct outcome.

Recommended Response

Examine each failure and determine whether the code is functioning correctly. Unless the expected outcome has changed, a test case failure indicates a functional problem with the code.

  • Use a debugger to investigate the reason for the failure. See Using a Debugger During Test Execution  for details.
  • If the code is incorrect, correct the code.
  • If the failure is intentional and describes an error reported by C++test, (i.e., the message contains a C++test error code such as [CPPTEST_EXIT_CALLED]), change the test case registration to use CPPTEST_TEST_ERROR. See Test Suite/Test Case Registration Macros for details.
  • If the expected outcome has changed, modify the test case's expected outcome by editing the test case in the test suite file. During subsequent test runs, C++test will check if the actual test case outcome matches this modified outcome.
  • No labels