1
2
3
4
5
6
7
8
9
10
11
12
13#define _GNU_SOURCE
14#include <errno.h>
15#include <stdio.h>
16#include <unistd.h>
17#include <sys/syscall.h>
18
19#include "utils.h"
20
21
22#define DO_TEST(_name, _num) \
23static int test_##_name(void) \
24{ \
25 int rc; \
26 printf("Testing " #_name); \
27 errno = 0; \
28 rc = syscall(_num, -1, 0, 0, 0, 0, 0); \
29 printf("\treturned %d, errno %d\n", rc, errno); \
30 return errno == ENOSYS; \
31}
32
33#include "ipc.h"
34#undef DO_TEST
35
36static int ipc_unmuxed(void)
37{
38 int tests_done = 0;
39
40#define DO_TEST(_name, _num) \
41 FAIL_IF(test_##_name()); \
42 tests_done++;
43
44#include "ipc.h"
45#undef DO_TEST
46
47
48
49
50
51
52
53 SKIP_IF(tests_done == 0);
54
55 return 0;
56}
57
58int main(void)
59{
60 return test_harness(ipc_unmuxed, "ipc_unmuxed");
61}
62