CUnit Programmers Reference  3.0
Data Fields
CU_Test Struct Reference

CUnit test case data type. More...

#include <TestDB.h>

Data Fields

char * pName
 Test name.
 
CU_BOOL fActive
 Flag for whether test is executed during a run.
 
CU_TestFunc pTestFunc
 Pointer to the test function.
 
jmp_buf * pJumpBuf
 Jump buffer for setjmp/longjmp test abort mechanism.
 
struct CU_TestpNext
 Pointer to the next test in linked list.
 
struct CU_TestpPrev
 Pointer to the previous test in linked list.
 
CU_BOOL fSkipped
 Flag for whether the test was skipped during a run.
 
unsigned uFailedRuns
 Number of times this test has failed.
 
double dEnded
 clock time test started
 
const char * pSkipReason
 clock time test ended
 
CU_BOOL fSuiteSetup
 Flag set if this is a suite setup entry (not an actual test)
 
CU_BOOL fSuiteCleanup
 Flag set if this is a suite cleanup entry (not an actual test)
 

Detailed Description

CUnit test case data type.

CU_Test is a double linked list of unit tests. Each test has a name, a callable test function, and a flag for whether the test is active and thus executed during a test run. A test also holds links to the next and previous tests in the list, as well as a jmp_buf reference for use in implementing fatal assertions.

Generally, the linked list includes tests which are associated with each other in a CU_Suite. As a result, tests are run in the order in which they are added to a suite (see CU_add_test()).

It is recommended that the name of each CU_Test in a suite have a unique name. Otherwise, only the first-registered test having a given name will be accessible by that name. There are no restrictions on the test function. This means that the same function could, in principle, be called more than once from different tests.

See also
CU_Suite
CU_TestRegistry

The documentation for this struct was generated from the following file: