minix/test/test39.c

39 lines
692 B
C
Raw Normal View History

2005-09-19 15:44:31 +02:00
2005-04-21 16:53:53 +02:00
#include <stdio.h>
2008-10-01 17:09:33 +02:00
#include <minix/endpoint.h>
#include <minix/sys_config.h>
int main(int argc, char *argv[])
{
int g, p;
printf("Test 39 ");
for(g = 0; g <= _ENDPOINT_MAX_GENERATION; g++) {
for(p = -NR_TASKS; p < _NR_PROCS; p++) {
int e, mg, mp;
e = _ENDPOINT(g, p);
mg = _ENDPOINT_G(e);
mp = _ENDPOINT_P(e);
if(mg != g || mp != p) {
printf("%d != %d || %d != %d\n", mg, g, mp, p);
return 1;
}
if(g == 0 && e != p) {
printf("%d != %d and g=0\n", e, p);
return 1;
}
if(e == ANY || e == SELF || e == NONE) {
printf("endpoint (%d,%d) is %d; ANY, SELF or NONE\n",
g, p, e);
return 1;
}
2005-09-19 15:44:31 +02:00
}
}
2008-10-01 17:09:33 +02:00
printf("ok\n");
2005-04-21 16:53:53 +02:00
2008-10-01 17:09:33 +02:00
return 0;
2005-04-21 16:53:53 +02:00
}