[ CCUnit project page ] [ CCUnit home page ]
Functions | Variables

CCUnitTestCase.c File Reference

TestCase module implementation. More...

#include <ccunit/CCUnitTestCase.h>
#include <ccunit/CCUnitTestResult.h>
#include <assert.h>
#include <setjmp.h>
Include dependency graph for CCUnitTestCase.c:

Functions

void _ccunit_startTest (CCUnitTestResult *result, CCUnitTestFunc *test)
 Informs the result that a test will be started.
void _ccunit_endTest (CCUnitTestResult *result, CCUnitTestFunc *test)
 Informs the result that a test was completed.
void ccunit_addTestFunc (CCUnitTestCase *testCase, CCUnitTestFunc *f)
 add test function to test case.
CCUnitTestFuncccunit_addNewTestFunc (CCUnitTestCase *testCase, const char *name, const char *desc, void(*runTest)())
 add new test func to test case.
static CCUnitTestFailurerunTest (CCUnitTestFunc *testFunc, CCUnitTestFunc *setUp, CCUnitTestFunc *tearDown, CCUnitTestResult *result)
 Runs the bare test sequence.
static void run (CCUnitTest *test, CCUnitTestResult *result)
 Runs the test case and collects the results in CCUnitTestResult.
static void destroy (CCUnitTest *test)
 Destruct test case.
CCUnitTestCaseccunit_newTestCase (const char *name)
 create new test case.
void ccunit_deleteTestCase (CCUnitTestCase *testCase)
 Destructs test case.
struct CCUnitTestResultccunit_runTestCase (CCUnitTestCase *testCase)
 run test cases and collect its results.

Variables

jmp_buf _ccunit_runTest_env
 run tests exception environment.
CCUnitTestFailure_ccunit_testFailure
 run tests exception.

Detailed Description

TestCase module implementation.


Function Documentation

static void destroy ( CCUnitTest test  )  [static]

Destruct test case.

Parameters:
test destruct test.

References ccunit_deleteList(), ccunit_deleteTestFunc(), ccunitTypeTestCase, CCUnitTestCase::name, safe_free, CCUnitTestCase::setUp, CCUnitTestCase::setup_setUp, CCUnitTestCase::setup_tearDown, CCUnitTestCase::tearDown, CCUnitTestCase::testFuncs, and CCUnitTest::type.

Referenced by ccunit_newTestCase().

Here is the call graph for this function:

Here is the caller graph for this function:

static void run ( CCUnitTest test,
CCUnitTestResult result 
) [static]

Runs the test case and collects the results in CCUnitTestResult.

Parameters:
test A test to run.
result A result container.

References _ccunit_endTest(), _ccunit_runTest_env, _ccunit_startTest(), ccunit_addFailure(), ccunit_initListIterator(), ccunit_nextListIterator(), ccunitTypeTestCase, runTest(), CCUnitTestFunc::runTest, CCUnitTestCase::setUp, CCUnitTestCase::setup_setUp, CCUnitTestCase::setup_tearDown, CCUnitTestCase::tearDown, CCUnitTestFailure::testFunc, CCUnitTestCase::testFuncs, and CCUnitTest::type.

Referenced by ccunit_newTestCase().

Here is the call graph for this function:

Here is the caller graph for this function:

static CCUnitTestFailure* runTest ( CCUnitTestFunc testFunc,
CCUnitTestFunc setUp,
CCUnitTestFunc tearDown,
CCUnitTestResult result 
) [static]

Runs the bare test sequence.

Returns:
failure

References _ccunit_runTest_env, ccunit_addFailure(), CCUnitTestResult::runCount, CCUnitTestFunc::runTest, and CCUnitTestFailure::testFunc.

Referenced by ccunit_addNewTestFunc(), and run().

Here is the call graph for this function:

Here is the caller graph for this function:

SourceForge.jp hosts this site. Send comments to: CCUnit Developer