]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/c-apps/tests/check_idl.c
C unit test examples for Evergreen
[working/Evergreen.git] / Open-ILS / src / c-apps / tests / check_idl.c
1 #include <check.h>
2 #include <ctype.h>
3 #include <limits.h>
4 #include "openils/oils_utils.h"
5 #include "openils/oils_idl.h"
6
7 osrfHash * my_idl;
8
9 //Set up the test fixture
10 void setup (void) {
11     my_idl = oilsInitIDL("../../../examples/fm_IDL.xml");
12 }
13
14 //Clean up the test fixture
15 void teardown (void) {
16     free(my_idl);
17 }
18
19 //Tests
20
21 START_TEST (test_loading_idl)
22 {
23     ck_assert(my_idl);
24 }
25 END_TEST
26
27 //END Tests
28
29 Suite *idl_suite (void) {
30   //Create test suite, test case, initialize fixture
31   Suite *s = suite_create("idl");
32   TCase *tc_core = tcase_create("Core");
33   tcase_add_checked_fixture(tc_core, setup, teardown);
34
35   //Add tests to test case
36   tcase_add_test(tc_core, test_loading_idl);
37
38   //Add test case to test suite
39   suite_add_tcase(s, tc_core);
40
41   return s;
42 }
43
44 void run_tests (SRunner *sr) {
45   srunner_add_suite (sr, idl_suite());
46 }