source: tests/check_help.c @ 7361a6a

Last change on this file since 7361a6a was 6ff651b, checked in by Dima <dgoldin+github@…>, at 2019-11-19T12:51:39Z

Fixing tests for libcheck 0.13.0

Since libcheck 0.13 it's mandatory to wrap the unit-test code
in a block. This updates the tests to comply with this.

This fix is backwards compatible with libcheck 0.12.

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