Updated to fedora-glibc-20051020T0651
[glibc.git] / stdlib / tst-ucontext-off.c
blob2e97f21aba69d591a19b06a6c7905acbb235a5f3
1 #include <stddef.h>
2 #include <stdio.h>
3 #include <sys/ucontext.h>
5 #include <ucontext_i.h>
7 static int
8 do_test (void)
10 int nerrors = 0;
11 int ntests = 0;
13 #define TEST(member, val) \
14 do { \
15 if (offsetof (struct ucontext, member) != val) \
16 { \
17 printf ("offsetof(%s) = %zu, %s = %zu\n", \
18 #member, offsetof (struct ucontext, member), \
19 #val, (size_t) val); \
20 ++nerrors; \
21 } \
22 ++ntests; \
23 } while (0)
25 #ifdef TESTS
26 TESTS
27 #endif
29 printf ("%d errors in %d tests\n", nerrors, ntests);
31 return nerrors != 0;
34 #define TEST_FUNCTION do_test ()
35 #include "../test-skeleton.c"