[ CCUnit project page ] |  | [ CCUnit home page ]

Data Fields

# CCUnitTestCase Struct Reference
[TestCase, Writing test fixture]

A single test object. More...

`#include <CCUnitTestCase.h>`

## Data Fields
const char * | name
| test case name
const char * | desc
| test description
void(* | runTest )()
| run test function

## Detailed Description

A single test object.

For each test implement a function which interacts with the case. Verify the expected results with assertions specified by calling CCUNIT_ASSERT on the expression you want to test:

     void testAdd ()
     {
       int result = value1 + value2;
       CCUNIT_ASSERT (result == 5);
     }

     ...

     void MathTest_newTestCase_testAdd ()
     {
       return ccunit_newTestCase ("testAdd", "add test", testAdd);
     }

See also:
  CCUnitTestFixture, CCUnitTestSuite, MakeSuite

## Field Documentation

const char* CCUnitTestCase::desc

test description

Referenced by printFailures().

const char* CCUnitTestCase::name

test case name

void(* CCUnitTestCase::runTest)()

run test function

Referenced by run(), and runTest().

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

- CCUnitTestCase.h

| hosts this site. |  | Send comments to: CCUnit Developer |