]>
Commit | Line | Data |
---|---|---|
eab1bdfb UD |
1 | #include <sched.h> |
2 | #include <stdio.h> | |
395a37e3 | 3 | #include <sys/param.h> |
eab1bdfb UD |
4 | |
5 | static int | |
6 | do_test (void) | |
7 | { | |
8 | cpu_set_t c; | |
9 | ||
10 | CPU_ZERO (&c); | |
11 | ||
395a37e3 | 12 | for (int cnt = 0; cnt < MIN (CPU_SETSIZE, 130); ++cnt) |
eab1bdfb UD |
13 | { |
14 | int n = CPU_COUNT (&c); | |
15 | if (n != cnt) | |
16 | { | |
17 | printf ("expected %d, not %d\n", cnt, n); | |
18 | return 1; | |
19 | } | |
20 | ||
21 | CPU_SET (cnt, &c); | |
22 | } | |
23 | ||
24 | return 0; | |
25 | } | |
26 | ||
27 | #define TEST_FUNCTION do_test () | |
28 | #include "../test-skeleton.c" |