4 #include "openils/oils_utils.h"
5 #include "openils/oils_idl.h"
7 //Set up the test fixture
11 //Clean up the test fixture
12 void teardown (void) {
17 START_TEST (test_oilsUtilsIsDBTrue)
19 ck_assert_msg( ! oilsUtilsIsDBTrue("0"), "oilsUtilIsDBTrue() should be false when passed '0'");
20 ck_assert_msg( oilsUtilsIsDBTrue("1"), "oilsUtilIsDBTrue() should be true when passed '1'");
21 ck_assert_msg( oilsUtilsIsDBTrue("-1"), "oilsUtilIsDBTrue() should be true when passed '-1'");
22 ck_assert_msg( oilsUtilsIsDBTrue("a"), "oilsUtilIsDBTrue() should be true when passed 'a'");
23 ck_assert_msg( ! oilsUtilsIsDBTrue("f"), "oilsUtilIsDBTrue() should be false when passed 'f'");
29 Suite *util_suite (void) {
30 //Create test suite, test case, initialize fixture
31 Suite *s = suite_create("util");
32 TCase *tc_core = tcase_create("Core");
33 tcase_add_checked_fixture(tc_core, setup, teardown);
35 //Add tests to test case
36 tcase_add_test(tc_core, test_oilsUtilsIsDBTrue);
38 //Add test case to test suite
39 suite_add_tcase(s, tc_core);
44 void run_tests (SRunner *sr) {
45 srunner_add_suite (sr, util_suite());