aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check_help.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-02 16:22:57 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-04-02 16:22:57 +0200
commit85d7b857fb8ca8e3c03d4abb3368a0966760630c (patch)
treea16163e557bcae3af41bde7d2d771d64ca248a97 /tests/check_help.c
parent875ad4201402b1a8f80ba22a6cdcdb152c6e5510 (diff)
parentdd345753c1742905c9f81aa71d8b09109fbc5456 (diff)
Merge trunk.
Diffstat (limited to 'tests/check_help.c')
-rw-r--r--tests/check_help.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/check_help.c b/tests/check_help.c
new file mode 100644
index 00000000..5a2f28d9
--- /dev/null
+++ b/tests/check_help.c
@@ -0,0 +1,33 @@
+#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_initfree)
+ help_t *h, *r;
+ r = help_init(&h, "/dev/null");
+ fail_if(r == NULL);
+ fail_if(r != h);
+
+ help_free(&h);
+ fail_if(h != NULL);
+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_initfree);
+ tcase_add_test (tc_core, test_help_nonexistent);
+ return s;
+}