From 57a7520545134ab95f7bb0397dcbe991c906a3e9 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 6 Aug 2025 16:34:21 +0200 Subject: Added HTR solver --- test/083_invcoord_epudsep/00_all.in | 0 test/083_invcoord_epudsep/00_all.out | 1 + test/083_invcoord_epudsep/invcoord_epudsep_tests.c | 32 ++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 test/083_invcoord_epudsep/00_all.in create mode 100644 test/083_invcoord_epudsep/00_all.out create mode 100644 test/083_invcoord_epudsep/invcoord_epudsep_tests.c (limited to 'test') diff --git a/test/083_invcoord_epudsep/00_all.in b/test/083_invcoord_epudsep/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/083_invcoord_epudsep/00_all.out b/test/083_invcoord_epudsep/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/083_invcoord_epudsep/00_all.out @@ -0,0 +1 @@ +All good diff --git a/test/083_invcoord_epudsep/invcoord_epudsep_tests.c b/test/083_invcoord_epudsep/invcoord_epudsep_tests.c new file mode 100644 index 0000000..709e5d8 --- /dev/null +++ b/test/083_invcoord_epudsep/invcoord_epudsep_tests.c @@ -0,0 +1,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"); +} -- cgit v1.3