Because the CUnit framework cannot be modified during a test run, CUnit cannot be used directly to test itself. That is, individual functions could set up and initiate CUnit test runs, but the functions themselves cannot be run as CUnit test functions.
The approach taken here is to set up a mimimal test framework to keep track of logical tests. The various unit test functions are then free to use the CUnit framework as needed.
#include "CUnit.h"
Go to the source code of this file.
Defines | |
#define | TEST(x) test_cunit_assert_impl((x), #x, __FILE__, __LINE__) |
Test a logical condition. | |
#define | TEST_FATAL(x) if (!test_cunit_assert_impl((x), #x, __FILE__, __LINE__)) return |
Test a logical condition with return on failure. | |
#define | FAIL(x) test_cunit_assert_impl(FALSE, #x, __FILE__, __LINE__) |
Record a failure. |