source: trunk/minix/test/test41.c@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 692 bytes
Line 
1
2#include <stdio.h>
3#include <minix/endpoint.h>
4#include <minix/sys_config.h>
5
6int main(int argc, char *argv[])
7{
8 int g, p;
9
10 printf("Test 41 ");
11
12 for(g = 0; g <= _ENDPOINT_MAX_GENERATION; g++) {
13 for(p = -NR_TASKS; p < _NR_PROCS; p++) {
14 int e, mg, mp;
15 e = _ENDPOINT(g, p);
16 mg = _ENDPOINT_G(e);
17 mp = _ENDPOINT_P(e);
18 if(mg != g || mp != p) {
19 printf("%d != %d || %d != %d\n", mg, g, mp, p);
20 return 1;
21 }
22 if(g == 0 && e != p) {
23 printf("%d != %d and g=0\n", e, p);
24 return 1;
25 }
26 if(e == ANY || e == SELF || e == NONE) {
27 printf("endpoint (%d,%d) is %d; ANY, SELF or NONE\n",
28 g, p, e);
29 return 1;
30 }
31 }
32 }
33
34 printf("ok\n");
35
36 return 0;
37}
38
Note: See TracBrowser for help on using the repository browser.