source: tests/check_help.c @ 2c2df7d

Last change on this file since 2c2df7d was c227706, checked in by Jelmer Vernooij <jelmer@…>, at 2006-12-24T19:35:13Z

Refactor the help code to take a filename rather than using the global struct.

  • Property mode set to 100644
File size: 643 bytes
Line 
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
9START_TEST(test_help_none)
10        help_t *h, *r;
11        r = help_init(&h, "/dev/null");
12        fail_if(r == NULL);
13        fail_if(r != h);
14END_TEST
15
16START_TEST(test_help_nonexistent)
17        help_t *h, *r;
18        r = help_init(&h, "/dev/null");
19        fail_unless(help_get(&h, "nonexistent") == NULL);
20END_TEST
21
22Suite *help_suite (void)
23{
24        Suite *s = suite_create("Help");
25        TCase *tc_core = tcase_create("Core");
26        suite_add_tcase (s, tc_core);
27        tcase_add_test (tc_core, test_help_none);
28        tcase_add_test (tc_core, test_help_nonexistent);
29        return s;
30}
Note: See TracBrowser for help on using the repository browser.