aboutsummaryrefslogtreecommitdiff
path: root/test/085_invcoord_epudsep/invcoord_epudsep_tests.c
blob: 709e5d82844cafcf2642ec648bbfd8228379a240 (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
#include "../test.h"

#define COMB_8_4 70

uint64_t coord_epudsep(cube_t);
cube_t invcoord_epudsep(uint64_t);

void run(void) {
	oriented_cube_t cube;
	uint64_t coord, coord2;

	cube.orientation = 0;

	/* Test all possible values for CP coordinate */
	for (coord = 0; coord < COMB_8_4; coord++) {
		cube.cube = invcoord_epudsep(coord);

		if (!isconsistent(cube)) {
			printf("Not consistent\n");
			return;
		}

		coord2 = coord_epudsep(cube.cube);
		if (coord != coord2) {
			printf("Error: invcoord of %" PRIu64
			    " returns %" PRIu64 "\n", coord, coord2);
			return;
		}
	}

	printf("All good\n");
}

Generated with cgit - Back to sebastiano.tronto.net