minix/test/test39.c
Ben Gras 5977114c42 tests cleanup
. make common.o link with the tests instead of being
	  #included as common.c
	. fix warnings about missing prototypes by declaring functions
	  static
	. reduces some duplicated code

Change-Id: Ic2a765d7f5886add5863190efec3fdd2d2ea2137
2013-04-17 22:00:59 +00:00

37 lines
625 B
C

#include <stdio.h>
#include <minix/endpoint.h>
#include <minix/sys_config.h>
int max_error = 1;
#include "common.h"
void test39a(void);
int main(int argc, char *argv[])
{
start(39);
test39a();
quit();
return(-1); /* Unreachable */
}
void test39a()
{
int g, p;
subtest = 1;
for (g = 0; g <= _ENDPOINT_MAX_GENERATION; g++) {
for (p = -MAX_NR_TASKS; p < _NR_PROCS; p++) {
endpoint_t ept;
int mg, mp;
ept = _ENDPOINT(g, p);
mg = _ENDPOINT_G(ept);
mp = _ENDPOINT_P(ept);
if (mg != g || mp != p) e(1);
if (g == 0 && ept != p) e(2);
if (ept == ANY || ept == SELF || ept == NONE) e(3);
}
}
}