Next: assertions, Previous: groups, Up: Top [Contents][Index]
Test functions are where the meat of the tests is placed. We can define a test function as:
void
test_1_1 (cce_destination_t L)
{
...
}
Run the test function fun in the context of the currently active test group. Print reports on log stream. The string name of fun is used as follows:
cctests_name: this function executes the test. If cctests_name is unset or set to the
empty string: the test function name matches and the test is executed.
Prototype of test functions run by cctests_run(). When the test completes successfully:
cctests_condition_success_t
by performing a non–local exit to L.
If an error occurs: the test function must raise an exception of type
cctests_condition_failure_t by performing a non–local exit to L.
If the test function raises an exceptional condition of a type different from
cctests_condition_success_t and cctests_condition_failure_t: the function is
considered failed with a hard error.
Return true if the latest test function has completed successfully; otherwise return false.
Raise an exception of type cctests_condition_skipped_t to signal that this test function
skips its test. This is useful, for example, if a test function is written for a testee function
that may not exist on the underlying platform; so we can write a test like this:
void
test_1_1 (cce_destination_t upper_L)
{
#ifdef HAVE_TESTEE_FUNCTION
...
#else
cctests_skip();
#endif
}
Next: assertions, Previous: groups, Up: Top [Contents][Index]
This document describes version 0.4.1-devel.1 of CCTests.