File: activate_deactivate_test.c

package info (click to toggle)
globus-net-manager 1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,988 kB
  • sloc: sh: 11,139; ansic: 7,298; perl: 200; python: 181; makefile: 178
file content (39 lines) | stat: -rw-r--r-- 776 bytes parent folder | download | duplicates (5)
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
36
37
38
39
#include "globus_net_manager.h"
#include "globus_test_tap.h"

int
activate_deactivate(void)
{
    int rc = 0;
    rc = globus_module_activate(GLOBUS_NET_MANAGER_MODULE);
    TEST_ASSERT(rc == 0);
    rc = globus_module_deactivate(GLOBUS_NET_MANAGER_MODULE);
    TEST_ASSERT(rc == 0);

    return 0;
}

struct tests
{
    char * test_name;
    int (*test_func)(void);
};

#define TEST_INITIALIZER(name) { #name, name }

int
main(int argc, char *argv[])
{
    struct tests tests[] = {
        TEST_INITIALIZER(activate_deactivate),
        {NULL, NULL}
    };
    int i;

    printf("1..%d\n", (int) (sizeof(tests)/sizeof(tests[0]))-1);
    for (i = 0; tests[i].test_name; i++)
    {
        ok(tests[i].test_func() == 0, tests[i].test_name);
    }
    return TEST_EXIT_CODE;
}