aboutsummaryrefslogtreecommitdiff
path: root/test/083_invcoord_epud/invcoord_epud_tests.c
blob: 6d7672bdc53bc96ef6ad3767e483593cba13f018 (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 FACT_8 40320

uint64_t coord_epud(cube_t);
cube_t invcoord_epud(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 < FACT_8; coord++) {
		cube.cube = invcoord_epud(coord);

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

		coord2 = coord_epud(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