source:
tests/check_help.c
@
fb774da
Last change on this file since fb774da was 6ff651b, checked in by , at 2019-11-19T12:51:39Z | |
---|---|
|
|
File size: 747 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) |
[6ff651b] | 10 | { |
11 | help_t * h, *r; | |
12 | r = help_init(&h, "/dev/null"); | |
13 | fail_if(r == NULL); | |
14 | fail_if(r != h); | |
[3e16fb8] | 15 | |
[6ff651b] | 16 | help_free(&h); |
17 | fail_if(h != NULL); | |
18 | } | |
[c227706] | 19 | END_TEST |
20 | ||
21 | START_TEST(test_help_nonexistent) | |
[6ff651b] | 22 | { |
23 | help_t * h, *r; | |
24 | r = help_init(&h, "/dev/null"); | |
25 | fail_unless(help_get(&h, "nonexistent") == NULL); | |
26 | fail_if(r == NULL); | |
27 | } | |
[c227706] | 28 | END_TEST |
29 | ||
[5ebff60] | 30 | Suite *help_suite(void) |
[c227706] | 31 | { |
32 | Suite *s = suite_create("Help"); | |
33 | TCase *tc_core = tcase_create("Core"); | |
[5ebff60] | 34 | |
35 | suite_add_tcase(s, tc_core); | |
36 | tcase_add_test(tc_core, test_help_initfree); | |
37 | tcase_add_test(tc_core, test_help_nonexistent); | |
[c227706] | 38 | return s; |
39 | } |
Note: See TracBrowser
for help on using the repository browser.