summaryrefslogtreecommitdiff
path: root/minix/tests/test39.c
blob: c1f4cb0330e822e3d05e11c0efd27d522a61075f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

#define _MINIX_SYSTEM

#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 < MAX_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);
	}
  }
}