Jon Test
C++ Unit Test Tool. Not for production -- sample code only
Loading...
Searching...
No Matches
assertFail_teardown.cpp

Actual test of failing tests in the teardown().

Actual test of failing tests in the teardown().

#include "JonTest/Assert.h"
TEST_SUITE(AssertFailTeardown)
void teardown()
{
EXPECTED_FAILURE(assertFail("to be expected"), "expected failure)");
// This WILL fail the test to demonstrate feature, and will be monitored externally
assertFail("jontest_fail_assertFailTeardown");
}
TEST_CASE(jontest_fail_assertFailTeardown)
{
// Nothing to do, must pass and fail in teardown
}
#define assertFail(message)
Explicitly fail the current test case with the given message as explanation.
Definition Assert.h:27
#define EXPECTED_FAILURE(expression, message)
Fail this test if evaluating (expression) does not result itself in a failed test.
Definition Assert.h:83
#define TEST_SUITE_END()
Finish definition of a Test Suite started with TEST_SUITE().
Definition TestSuite.h:77
#define TEST_CASE(testCaseName)
Defines a Test Case method named testCaseName within a Test Suite defined by TEST_SUITE().
Definition TestSuite.h:91
#define TEST_SUITE(testSuiteName)
Defines a Test Suite named testSuiteName.
Definition TestSuite.h:63