OSDN Git Service

upgrade version number
[ccunit/ccunit.git] / tests / failAssert.c
1 /* Copyright (C) 2003, 2010 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 #include <stdio.h>
24 #include <limits.h>
25 #include <ccunit/CCUnitAssert.h>
26
27 #include "failAssert.h"
28
29 /** test case: assert macro test */
30
31 /**
32  * assert fail.
33  */
34 static void test_assert_fail ()
35 {
36   CCUNIT_ASSERT (1 == 0);
37 }
38
39 /**
40  * assert eq int fail.
41  */
42 static void test_assertInt_equal ()
43 {
44   CCUNIT_ASSERT_EQ_INT (INT_MAX, INT_MIN);
45 }
46
47 /**
48  * assert !eq int fail
49  */
50 static void test_assertInt_notEqual ()
51 {
52   CCUNIT_ASSERT_NE_INT (INT_MAX, INT_MAX);
53 }
54
55 /**
56  * assert int compare fail
57  */
58 static void test_assertInt_comp_fail ()
59 {
60   CCUNIT_ASSERT_GT_INT (INT_MIN, INT_MAX);
61 }
62
63 /**
64  * assert str compare fail
65  */
66 static void test_assertStr_comp_fail ()
67 {
68   CCUNIT_ASSERT_EQ_STR ("string", "STRING");
69 }
70
71 /** end test case */
72
73 /** test case: assert setUp() */
74
75 static void setUp_setUp ()
76 {
77   CCUNIT_ASSERT_EQ_STR ("setUp", "");
78 }
79
80 static void tearDown_setUp ()
81 {
82   CCUNIT_ASSERT (false);
83 }
84
85 /** not reached */
86 static void test_setUp ()
87 {
88   CCUNIT_ASSERT(false);
89 }
90
91 /** end test case */
92
93 /** test case: assert tearDown() */
94
95 static void tearDown_tearDown ()
96 {
97   CCUNIT_ASSERT_EQ_STR ("tearDown", "");
98 }
99
100 /** be failed */
101 static void test_tearUp ()
102 {
103   CCUNIT_ASSERT(false);
104 }
105
106 /** end test case */
107
108 /** test case: assert in setup_setUp () */
109 static void setup_setUp_test_setup_setUp ()
110 {
111   CCUNIT_ASSERT(false);
112 }
113
114 /** not reached */
115 static void setUp_test_setup_setUp ()
116 {
117   CCUNIT_ASSERT(false);
118 }
119
120 /** not reached */
121 static void tearDown_test_setup_setUp ()
122 {
123   CCUNIT_ASSERT(false);
124 }
125
126 /** not reached */
127 static void test_test_setup_setUp ()
128 {
129   CCUNIT_ASSERT(false);
130 }
131
132 static void setup_tearDown_test_setup_setUp ()
133 {
134   CCUNIT_ASSERT(false);
135 }
136
137 /** end test case */