forked from libcheck/check
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_check_limit.c
65 lines (54 loc) · 1.62 KB
/
check_check_limit.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Check: a unit test framework for C
* Copyright (C) 2001, 2002 Arien Malec
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include "../lib/libcompat.h"
#include <stdlib.h>
#include <string.h>
#include <check.h>
#include "check_check.h"
#include "check_str.h"
static SRunner *sr;
static void limit_setup (void)
{
Suite *s = suite_create("Empty");
sr = srunner_create(s);
srunner_run_all(sr, CK_VERBOSE);
}
static void limit_teardown (void)
{
srunner_free(sr);
}
START_TEST(test_summary)
{
char * string = sr_stat_str(sr);
ck_assert_msg(strcmp(string,
"100%: Checks: 0, Failures: 0, Errors: 0") == 0,
"Bad statistics string for empty suite");
free(string);
}
END_TEST
Suite *make_limit_suite (void)
{
Suite *s = suite_create("Limit");
TCase *tc = tcase_create("Empty");
tcase_add_test(tc,test_summary);
tcase_add_unchecked_fixture(tc,limit_setup,limit_teardown);
suite_add_tcase(s, tc);
return s;
}