source: tests/check_help.c @ 946c6da

Last change on this file since 946c6da 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
RevLine 
[c227706]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
[2d88d25a]9START_TEST(test_help_initfree)
[6ff651b]10{
11    help_t * h, *r;
12    r = help_init(&h, "/dev/null");
13    fail_if(r == NULL);
14    fail_if(r != h);
[3e16fb8]15
[6ff651b]16    help_free(&h);
17    fail_if(h != NULL);
18}
[c227706]19END_TEST
20
21START_TEST(test_help_nonexistent)
[6ff651b]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}
[c227706]28END_TEST
29
[5ebff60]30Suite *help_suite(void)
[c227706]31{
32        Suite *s = suite_create("Help");
33        TCase *tc_core = tcase_create("Core");
[5ebff60]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);
[c227706]38        return s;
39}
Note: See TracBrowser for help on using the repository browser.