File: check_help.c

package info (click to toggle)
bitlbee 3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,392 kB
  • sloc: ansic: 29,135; xml: 2,282; sh: 905; makefile: 389; python: 221; perl: 41
file content (35 lines) | stat: -rw-r--r-- 699 bytes parent folder | download | duplicates (6)
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
35
#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;
}