2 /* Copyright (C) 2003 TSUTSUMI Kikuo.
3 This file is part of the CCUnit Library.
5 The CCUnit Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License
7 as published by the Free Software Foundation; either version 2.1 of
8 the License, or (at your option) any later version.
10 The CCUnit Library is distributed in the hope that it will be
11 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the CCUnit Library; see the file COPYING.LESSER.
17 If not, write to the Free Software Foundation, Inc., 59 Temple
18 Place - Suite 330, Boston, MA 02111-1307, USA.
29 #ifndef CCUNITTESTCASE_H
30 #define CCUNITTESTCASE_H
32 #include <CCUnit/CCUnitConfig.h>
35 * @ingroup CCUnitTestFixture
36 * @defgroup CCUnitTestCase TestCase
38 * A single test object.
40 * This class is used to implement a simple test case.
46 * A single test object.
48 * For each test implement a function which interacts with the
49 * case. Verify the expected results with assertions specified by
50 * calling CCUNIT_ASSERT on the expression you want to test:
55 * int result = value1 + value2;
56 * CCUNIT_ASSERT (result == 5);
61 * void MathTest_newTestCase_testAdd ()
63 * return ccunit_newTestCase ("addTest", "add test", addTest);
67 * @see CCUnitTestFixture, CCUnitTestSuite, CCUintMakeSuite
69 * @ingroup WritingTestFixture
71 typedef struct CCUnitTestCase
73 const char* name; /**< test case name */
74 const char* desc; /**< test description */
75 void (*runTest) (); /**< run test function */
79 * Create new test case.
80 * @ingroup WritingTestFixture
81 * @param name case name.
82 * @param desc case description.
83 * @param runTest run test function.
84 * @return new test case
86 extern CCUnitTestCase* ccunit_newTestCase (const char* name,
92 * @ingroup WritingTestFixture
93 * @param testCase deleting case.
95 extern void ccunit_deleteTestCase (CCUnitTestCase* testCase);
99 #endif /* !CCUNITTESTCASE_H */