source:
tests/check_help.c
@
98d46d5
Last change on this file since 98d46d5 was 5ebff60, checked in by , at 2015-02-20T22:50:54Z | |
---|---|
|
|
File size: 699 bytes |
Rev | Line | |
---|---|---|
[c227706] | 1 | #include <stdlib.h> |
2 | #include <glib.h> | |
3 | #include <gmodule.h> | |
4 | #include <check.h> | |
5 | #include <string.h> | |
6 | #include <stdio.h> | |
7 | #include "help.h" | |
8 | ||
[2d88d25a] | 9 | START_TEST(test_help_initfree) |
[5ebff60] | 10 | help_t * h, *r; |
11 | r = help_init(&h, "/dev/null"); | |
12 | fail_if(r == NULL); | |
13 | fail_if(r != h); | |
[3e16fb8] | 14 | |
[5ebff60] | 15 | help_free(&h); |
16 | fail_if(h != NULL); | |
[c227706] | 17 | END_TEST |
18 | ||
19 | START_TEST(test_help_nonexistent) | |
[5ebff60] | 20 | help_t * h, *r; |
21 | r = help_init(&h, "/dev/null"); | |
22 | fail_unless(help_get(&h, "nonexistent") == NULL); | |
23 | fail_if(r == NULL); | |
[c227706] | 24 | END_TEST |
25 | ||
[5ebff60] | 26 | Suite *help_suite(void) |
[c227706] | 27 | { |
28 | Suite *s = suite_create("Help"); | |
29 | TCase *tc_core = tcase_create("Core"); | |
[5ebff60] | 30 | |
31 | suite_add_tcase(s, tc_core); | |
32 | tcase_add_test(tc_core, test_help_initfree); | |
33 | tcase_add_test(tc_core, test_help_nonexistent); | |
[c227706] | 34 | return s; |
35 | } |
Note: See TracBrowser
for help on using the repository browser.