xref: /minix/minix/tests/test39.c (revision 83133719)
1 
2 #define _MINIX_SYSTEM
3 
4 #include <stdio.h>
5 #include <minix/endpoint.h>
6 #include <minix/sys_config.h>
7 int max_error = 1;
8 #include "common.h"
9 
10 
11 void test39a(void);
12 
13 int main(int argc, char *argv[])
14 {
15   start(39);
16   test39a();
17   quit();
18   return(-1);	/* Unreachable */
19 }
20 
21 void test39a()
22 {
23   int g, p;
24 
25   subtest = 1;
26 
27   for (g = 0; g <= _ENDPOINT_MAX_GENERATION; g++) {
28 	for (p = -MAX_NR_TASKS; p < MAX_NR_PROCS; p++) {
29 		endpoint_t ept;
30 		int mg, mp;
31 		ept = _ENDPOINT(g, p);
32 		mg = _ENDPOINT_G(ept);
33 		mp = _ENDPOINT_P(ept);
34 		if (mg != g || mp != p) e(1);
35 		if (g == 0 && ept != p) e(2);
36 		if (ept == ANY || ept == SELF || ept == NONE) e(3);
37 	}
38   }
39 }
40