test41.c

Go to the documentation of this file.
00001 
00002 #include <stdio.h>
00003 #include <minix/endpoint.h>
00004 #include <minix/sys_config.h>
00005 
00006 int main(int argc, char *argv[])
00007 {
00008         int g, p;
00009 
00010         printf("Test 41 ");
00011 
00012         for(g = 0; g <= _ENDPOINT_MAX_GENERATION; g++) {
00013                 for(p = -NR_TASKS; p < _NR_PROCS; p++) {
00014                         int e, mg, mp;
00015                         e = _ENDPOINT(g, p);
00016                         mg = _ENDPOINT_G(e);
00017                         mp = _ENDPOINT_P(e);
00018                         if(mg != g || mp != p)  {
00019                                 printf("%d != %d || %d != %d\n", mg, g, mp, p);
00020                                 return 1;
00021                         }
00022                         if(g == 0 && e != p) {
00023                                 printf("%d != %d and g=0\n", e, p);
00024                                 return 1;
00025                         }
00026                         if(e == ANY || e == SELF || e == NONE) {
00027                                 printf("endpoint (%d,%d) is %d; ANY, SELF or NONE\n",
00028                                         g, p, e);
00029                                 return 1;
00030                         }
00031                 }
00032         }
00033 
00034         printf("ok\n");
00035 
00036         return 0;
00037 }
00038 

Generated on Fri Apr 14 22:57:35 2006 for minix by  doxygen 1.4.6