From 270e5b0444f67781856bf80db51650af9cb89b0c Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 17 Jul 2025 08:54:44 +0200 Subject: Renamed tests to make space for more coordinate tests --- test/120_coord_invcoord_h48/00_all.in | 8 +++++ test/120_coord_invcoord_h48/00_all.out | 8 +++++ .../coord_invcoord_h48_tests.c | 37 ++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 test/120_coord_invcoord_h48/00_all.in create mode 100644 test/120_coord_invcoord_h48/00_all.out create mode 100644 test/120_coord_invcoord_h48/coord_invcoord_h48_tests.c (limited to 'test/120_coord_invcoord_h48') diff --git a/test/120_coord_invcoord_h48/00_all.in b/test/120_coord_invcoord_h48/00_all.in new file mode 100644 index 0000000..0480485 --- /dev/null +++ b/test/120_coord_invcoord_h48/00_all.in @@ -0,0 +1,8 @@ +ABCDEFGH=BDCAEFGHIJKL=A +ABCDEFGH=ABCDEFGHIJKL=A +BACDFEGH=BACDFEGHIJKL=A +CILVXGMR=FKbGIDSXBJAU=A +WBCVEILH=ABCDIFGLHJKE=A +MBODSFQH=ZBCYEFGHQTKL=A +ABCDEFGH=ILKJEFGHDABC=A +ABCDEFGH=EFGHBADCIJKL=A diff --git a/test/120_coord_invcoord_h48/00_all.out b/test/120_coord_invcoord_h48/00_all.out new file mode 100644 index 0000000..e84be4b --- /dev/null +++ b/test/120_coord_invcoord_h48/00_all.out @@ -0,0 +1,8 @@ +1 ok +2 ok +3 ok +4 ok +5 ok +6 ok +7 ok +8 ok diff --git a/test/120_coord_invcoord_h48/coord_invcoord_h48_tests.c b/test/120_coord_invcoord_h48/coord_invcoord_h48_tests.c new file mode 100644 index 0000000..0333f27 --- /dev/null +++ b/test/120_coord_invcoord_h48/coord_invcoord_h48_tests.c @@ -0,0 +1,37 @@ +#include "../test.h" + +size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); +int64_t coord_h48(cube_t, const uint32_t *, uint8_t); +cube_t invcoord_h48(int64_t, const cube_t *, uint8_t); +cube_t transform(cube_t, uint8_t); + +void run(void) { + char str[STRLENMAX]; + int i; + bool found; + uint8_t h, t; + unsigned char buf[2000000]; + uint32_t *cocsepdata; + uint64_t selfsim[COCSEP_CLASSES]; + int64_t c, cc; + oriented_cube_t cube; + cube_t invc, rep[COCSEP_CLASSES]; + + gendata_cocsep(buf, selfsim, rep); + cocsepdata = (uint32_t *)(buf + INFOSIZE); + + i = 1; + h = 11; + while (fgets(str, STRLENMAX, stdin) != NULL) { + cube = readcube(str); + c = coord_h48(cube.cube, cocsepdata, h); + invc = invcoord_h48(c, rep, h); + for (t = 0, found = false; t < 48; t++) { + cube.cube = transform(invc, t); + cc = coord_h48(cube.cube, cocsepdata, h); + found = found || cc == c; + } + printf("%d %s\n", i, found ? "ok" : "ERROR"); + i++; + } +} -- cgit v1.3