Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

TestDB.h File Reference


Detailed Description

Management functions for tests, suites, and the test registry (user interface).

Unit testing in CUnit follows the standard structure of unit tests aggregated in suites, which are themselves aggregated in a test registry. This module provides functions and typedef's to support the creation, registration, and manipulation of test cases, suites, and the registry.

#include <setjmp.h>
#include "CUnit.h"
#include "CUError.h"

Go to the source code of this file.

Data Structures

struct  CU_Test
 CUnit test case data type. More...
struct  CU_Suite
 CUnit suite data type. More...
struct  CU_TestRegistry
 CUnit test registry data type. More...
struct  CU_TestInfo
 Test case parameters. More...
struct  CU_SuiteInfo
 Suite parameters. More...
struct  test_suite
 Deprecated (version 1). More...

Defines

#define CU_ADD_TEST(suite, test)   (CU_add_test(suite, #test, (CU_TestFunc)test))
 Shortcut macro for adding a test to a suite.
#define CU_TEST_INFO_NULL   { NULL, NULL }
 NULL CU_test_info_t to terminate arrays of tests.
#define CU_SUITE_INFO_NULL   { NULL, NULL, NULL, NULL }
 NULL CU_suite_info_t to terminate arrays of suites.
#define TEST_CASE_NULL   { NULL, NULL }
 Deprecated (version 1).
#define TEST_GROUP_NULL   { NULL, NULL, NULL, NULL }
 Deprecated (version 1).
#define test_group_register(tg)   CU_register_suites(tg)
 Deprecated (version 1).
#define initialize_registry()   CU_initialize_registry()
 Deprecated (version 1).
#define cleanup_registry()   CU_cleanup_registry()
 Deprecated (version 1).
#define add_test_group(name, init, clean)   CU_add_suite(name, init, clean)
 Deprecated (version 1).
#define add_test_case(group, name, test)   CU_add_test(group, name, test)
 Deprecated (version 1).
#define get_registry()   CU_get_registry()
 Deprecated (version 1).
#define set_registry(reg)   CU_set_registry((reg))
 Deprecated (version 1).
#define get_group_by_name(group, reg)   CU_get_suite_by_name(group, reg)
 Deprecated (version 1).
#define get_test_by_name(test, group)   CU_get_test_by_name(test, group)
 Deprecated (version 1).
#define ADD_TEST_TO_GROUP(group, test)   (CU_add_test(group, #test, (CU_TestFunc)test))
 Deprecated (version 1).

Typedefs

typedef int(* CU_InitializeFunc )(void)
 Signature for suite initialization function.
typedef int(* CU_CleanupFunc )(void)
 Signature for suite cleanup function.
typedef void(* CU_TestFunc )(void)
 Signature for a testing function in a test case.
typedef CU_Test CU_Test
 CUnit test case data type.
typedef CU_TestCU_pTest
 Pointer to a CUnit test case.
typedef CU_Suite CU_Suite
 CUnit suite data type.
typedef CU_SuiteCU_pSuite
 Pointer to a CUnit suite.
typedef CU_TestRegistry CU_TestRegistry
 CUnit test registry data type.
typedef CU_TestRegistryCU_pTestRegistry
 Pointer to a CUnit test registry.
typedef CU_TestInfo CU_TestInfo
 Test case parameters.
typedef CU_TestInfoCU_pTestInfo
 Pointer to CU_TestInfo type.
typedef CU_SuiteInfo CU_SuiteInfo
 Suite parameters.
typedef CU_SuiteInfoCU_pSuiteInfo
 Pointer to CU_SuiteInfo type.
typedef CU_TestInfo test_case_t
 Deprecated (version 1).
typedef CU_SuiteInfo test_group_t
 Deprecated (version 1).
typedef test_suite test_suite_t
 Deprecated (version 1).
typedef CU_InitializeFunc InitializeFunc
 Deprecated (version 1).
typedef CU_CleanupFunc CleanupFunc
 Deprecated (version 1).
typedef CU_TestFunc TestFunc
 Deprecated (version 1).
typedef CU_Test _TestCase
 Deprecated (version 1).
typedef CU_pTest PTestCase
 Deprecated (version 1).
typedef CU_Suite _TestGroup
 Deprecated (version 1).
typedef CU_pSuite PTestGroup
 Deprecated (version 1).
typedef CU_TestRegistry _TestRegistry
 Deprecated (version 1).
typedef CU_pTestRegistry PTestRegistry
 Deprecated (version 1).

Functions

CU_ErrorCode CU_initialize_registry (void)
 Initialize the test registry.
void CU_cleanup_registry (void)
 Clear the test registry.
CU_pSuite CU_add_suite (const char *strName, CU_InitializeFunc pInit, CU_CleanupFunc pClean)
 Create a new test suite and add it to the test registry.
CU_pTest CU_add_test (CU_pSuite pSuite, const char *strName, CU_TestFunc pTestFunc)
 Create a new test case and add it to a test suite.
CU_ErrorCode CU_register_suites (CU_SuiteInfo suite_info[])
 Registers the suites in a single CU_SuiteInfo array..
CU_ErrorCode CU_register_nsuites (int suite_count,...)
 Registers multiple suite arrays in CU_SuiteInfo format.
int test_suite_register (test_suite_t *ts)
 Deprecated (version 1).
CU_pTestRegistry CU_get_registry (void)
 Retrieve a pointer to the current test registry.
CU_pTestRegistry CU_set_registry (CU_pTestRegistry pTestRegistry)
 Set the registry to an existing CU_pTestRegistry instance.
CU_pTestRegistry CU_create_new_registry (void)
 Create and initialize a new test registry.
void CU_destroy_existing_registry (CU_pTestRegistry *ppRegistry)
 Destroy and free all memory for an existing test registry.
CU_pSuite CU_get_suite_by_name (const char *szSuiteName, CU_pTestRegistry pRegistry)
 Retrieve a pointer to the suite having the specified name.
CU_pTest CU_get_test_by_name (const char *szTestName, CU_pSuite pSuite)
 Retrieve a pointer to the test case having the specified name.
void test_cunit_TestDB (void)


Generated on Thu Apr 28 12:36:09 2005 for CUnit by  doxygen 1.3.9.1