OSDN Git Service

Generally I constructed the sample again.
[ccunit/ccunit.git] / examples / complex / complexTestSuite.c
1 /* Copyright (C) 2003 TSUTSUMI Kikuo.
2    This file is part of the CCUnit Library.
3
4    The CCUnit Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public License
6    as published by the Free Software Foundation; either version 2.1 of
7    the License, or (at your option) any later version.
8
9    The CCUnit Library is distributed in the hope that it will be
10    useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11    of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public
15    License along with the CCUnit Library; see the file COPYING.LESSER.
16    If not, write to the Free Software Foundation, Inc., 59 Temple
17    Place - Suite 330, Boston, MA 02111-1307, USA.  
18 */
19
20 /*
21  * $Id$
22  */
23
24 #include <ccunit/CCUnitTestSuite.h>
25
26 void setUp_complex_test ();
27 void tearDown_complex_test ();
28 void test_complex_equals ();
29 void test_complex_add ();
30 void test_complex_sub ();
31
32 void setUp_complex_mul_div ();
33 void tearDown_complex_mul_div ();
34 void test_complex_mul ();
35 void test_complex_div ();
36
37 CCUnitTestSuite* complex_add_sub_suite ()
38 {
39   CCUnitTestFixture* fixture;
40   CCUnitTestSuite* suite;
41   fixture = ccunit_newTestFixture ("complex add sub test",
42                                    CCUNIT_NEWTESTFUNC(setUp_complex_test),
43                                    CCUNIT_NEWTESTFUNC(tearDown_complex_test));
44   ccunit_addNewTestCase (fixture, 
45                          "test_complex_equals",
46                          "complex equals test",
47                          test_complex_equals);
48   ccunit_addNewTestCase (fixture,
49                          "test_complex_add",
50                          "complex add test",
51                          test_complex_add);
52   ccunit_addNewTestCase (fixture,
53                          "test_complex_sub",
54                          "complex sub test",
55                          test_complex_sub);
56   suite = ccunit_newTestSuite ("complex add/sub test");
57   ccunit_addTestFixture (suite, fixture);
58   return suite;
59 }
60
61 CCUnitTestSuite* complex_mul_div_suite ()
62 {
63   CCUnitTestFixture* fixture;
64   CCUnitTestSuite* suite;
65   fixture = ccunit_newTestFixture ("complex mul div test",
66                                    CCUNIT_NEWTESTFUNC(setUp_complex_mul_div),
67                                    CCUNIT_NEWTESTFUNC(tearDown_complex_mul_div));
68   ccunit_addNewTestCase (fixture, 
69                          "test_complex_mul",
70                          "complex mul test",
71                          test_complex_mul);
72   ccunit_addNewTestCase (fixture,
73                          "test_complex_div",
74                          "complex div test",
75                          test_complex_div);
76   suite = ccunit_newTestSuite ("complex mul/div test");
77   ccunit_addTestFixture (suite, fixture);
78   return suite;
79 }