aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check_help.c
blob: 7e5283e3833a17a4d3099ff5ffa902ab960e8b88 (plain)
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
#include <stdlib.h>
#include <glib.h>
#include <gmodule.h>
#include <check.h>
#include <string.h>
#include <stdio.h>
#include "help.h"

START_TEST(test_help_none)
	help_t *h, *r;
	r = help_init(&h, "/dev/null");
	fail_if(r == NULL);
	fail_if(r != h);
END_TEST

START_TEST(test_help_nonexistent)
	help_t *h, *r;
	r = help_init(&h, "/dev/null");
	fail_unless(help_get(&h, "nonexistent") == NULL);
END_TEST

Suite *help_suite (void)
{
	Suite *s = suite_create("Help");
	TCase *tc_core = tcase_create("Core");
	suite_add_tcase (s, tc_core);
	tcase_add_test (tc_core, test_help_none);
	tcase_add_test (tc_core, test_help_nonexistent);
	return s;
}