File: check_help.c

package info (click to toggle)
bitlbee 3.2.2-2%2Bdeb8u1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd-proposed-updates
  • size: 3,424 kB
  • sloc: ansic: 46,362; xml: 2,118; sh: 792; python: 648; makefile: 545; perl: 41
file content (34 lines) | stat: -rw-r--r-- 710 bytes parent folder | download | duplicates (2)
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
31
32
33
34
#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);
	fail_if(r == 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;
}