CCUnit: 構造体 CCUnitTestFunc

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

変数

# 構造体 CCUnitTestFunc
[TestFunc, テストケースを書く]

A single test function object. [詳細]

`#include <CCUnitTestFunc.h>`

## 変数
const char * | name
| test func name
const char * | desc
| test description
void(* | runTest )()
| run test function

## 説明

A single test function 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);
     }

     ...
     int main ()
     {
       CCUnitTestResult* r;
       CCUnitTestCase* c = ccunit_newTestCase ("math test");
       CCUnitTestFunc* f = ccunit_newTestFunc ("testAdd", "add test", testAdd);
       ccunit_addTestFunc (c, f);
       r = ccunit_runTestCase (c);
       return 0;
     }

参照:
  CCUnitTestCase, CCUnitTestSuite, MakeSuite

## 構造体

const char* CCUnitTestFunc::desc

test description

参照元 printFailures().

const char* CCUnitTestFunc::name

test func name

参照元 ccunit_addTestFunc().

void(* CCUnitTestFunc::runTest)()

run test function

参照元 run(), と runTest().

この構造体の説明は次のファイルから生成されました:

- CCUnitTestFunc.h

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