source: tests/check_help.c @ 2d88d25a

Last change on this file since 2d88d25a was 2d88d25a, checked in by Wilmer van der Gaast <wilmer@…>, at 2008-02-16T19:38:17Z

Added help_free() test, and fixed compiler warning in SASL test.

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