OSDN Git Service

deleted the ineffective keyword inline.
[ccunit/ccunit.git] / tests / runFailure.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 <ccunit/CCUnitTestRunner.h>
24
25 extern CCUnitTestSuite* failAssert_suite (const char* name);
26
27 int main ()
28 {
29   CCUnitTestRunner* runner;
30   CCUnitTestSuite* suite;
31   size_t fails;
32   size_t runs;
33 #if CCUNIT_WITH_DMALLOC
34   dmalloc_debug_setup ("log-stats,"
35                        "log-non-free,"
36                        "log-bad-space,"
37                        "log-elapsed-time,"
38                        "check-fence,"
39                        "free-blank,"
40                        "error-abort,"
41                        "alloc-blank,"
42                        "catch-null,"
43                        "inter=100,"
44                        "log=dm-runFailure.log");
45 #endif  /* CCUNIT_WITH_DMALLOC */
46   runner = ccunit_newTestRunner (NULL);
47   suite = failAssert_suite ("failure");
48   ccunit_runTestRunner (runner, suite);
49   runs = ccunit_runCount (runner->result);
50   fails = ccunit_failureCount (runner->result);
51   ccunit_deleteTestRunner (runner);
52   ccunit_deleteTestSuite (suite);
53 #if CCUNIT_WITH_DMALLOC && !CCUNIT_HAVE_ATEXIT && !CCUNIT_HAVE_ONEXIT
54   dmalloc_shutdown ();
55 #endif
56   return fails == runs + 5 ? -1 : 0;
57 }