OSDN Git Service

5f00bb0651293e80757ca39bd8ff9762e11f2d17
[ccunit/ccunit.git] / src / ccunit / CCUnitTestCase.h
1 /* -*- mode: C; -*- */
2 /* Copyright (C) 2003 TSUTSUMI Kikuo.
3    This file is part of the CCUnit Library.
4
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.
9
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.
14
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.  
19 */
20
21 /*
22  * $Id$
23  */
24
25 /** @file
26  * TestCase module.
27  */
28
29 #ifndef CCUNITTESTCASE_H
30 #define CCUNITTESTCASE_H
31
32 #include <CCUnit/CCUnitConfig.h>
33
34 /**
35  * @ingroup CCUnitTestFixture
36  * @defgroup CCUnitTestCase TestCase
37  *
38  * A single test object.
39  *
40  * This class is used to implement a simple test case.
41  *
42  * @{
43  */
44
45 /**
46  * A single test object.
47  * @ingroup WritingTestFixture
48  */
49 typedef struct CCUnitTestCase
50 {
51   const char* name;                             /**< test case name */
52   const char* desc;                             /**< test description */
53   void (*runTest) ();                           /**< run test function */
54 } CCUnitTestCase;
55
56 /**
57  * Create new test case.
58  * @ingroup WritingTestFixture
59  * @param name case name.
60  * @param desc case description.
61  * @param runTest run test function.
62  * @return new test case
63  */
64 extern CCUnitTestCase* ccunit_newTestCase (const char* name,
65                                            const char* desc,
66                                            void (*runTest)());
67
68 /**
69  * Delete test case.
70  * @ingroup WritingTestFixture
71  * @param testCase deleting case.
72  */
73 extern void ccunit_deleteTestCase (CCUnitTestCase* testCase);
74
75 /** @} */
76
77 #endif  /* !CCUNITTESTCASE_H */