OSDN Git Service

Renamed ChangeLog to ChangeLog.2.
[ccunit/ccunit.git] / tests / testAssert.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 #include <stdio.h>
24 #include <limits.h>
25 #include <ccunit/CCUnitAssert.h>
26
27 /** test suite: assert test */
28
29 /** test case: assert macro test */
30
31 void setUp_testAssert ()
32 {
33 }
34
35 void tearDown_testAssert ()
36 {
37 }
38
39 /**
40  * assert success.
41  */
42 void test_assert_success ()
43 {
44   CCUNIT_ASSERT (1 == 1);
45 }
46
47 /**
48  * assert eq int success
49  */
50 void test_assertInt_equal ()
51 {
52   CCUNIT_ASSERT_EQ_INT (INT_MAX, INT_MAX);
53 }
54
55 /**
56  * assert !eq int success
57  */
58 void test_assertInt_notEqual ()
59 {
60   CCUNIT_ASSERT_NE_INT (INT_MAX, INT_MIN);
61 }
62
63 /**
64  * assert int compare
65  */
66 void test_assertInt_comp ()
67 {
68   CCUNIT_ASSERT_GT_INT (INT_MAX, INT_MIN);
69 }
70
71 /**
72  * assert str compare
73  */
74 void test_assertStr_comp ()
75 {
76   CCUNIT_ASSERT_EQ_STR ("string", "string");
77 }
78
79 /** end test case */