From 61e03f9f4eecf3d5811b11c44c9ef778f0a93bc7 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 14 Jul 2024 21:28:37 +0200 Subject: Found a sneaky bug (it's all a mess now) --- test/103_cocsep_ttrep/00_all.in | 0 test/103_cocsep_ttrep/00_all.out | 0 test/103_cocsep_ttrep/cocsep_ttrep_tests.c | 33 ++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 test/103_cocsep_ttrep/00_all.in create mode 100644 test/103_cocsep_ttrep/00_all.out create mode 100644 test/103_cocsep_ttrep/cocsep_ttrep_tests.c (limited to 'test/103_cocsep_ttrep') diff --git a/test/103_cocsep_ttrep/00_all.in b/test/103_cocsep_ttrep/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/103_cocsep_ttrep/00_all.out b/test/103_cocsep_ttrep/00_all.out new file mode 100644 index 0000000..e69de29 diff --git a/test/103_cocsep_ttrep/cocsep_ttrep_tests.c b/test/103_cocsep_ttrep/cocsep_ttrep_tests.c new file mode 100644 index 0000000..78f8014 --- /dev/null +++ b/test/103_cocsep_ttrep/cocsep_ttrep_tests.c @@ -0,0 +1,33 @@ +#include "../test.h" + +#define COCSEP_CLASSES 3393 + +uint8_t inverse_trans(uint8_t); +cube_t transform_corners(cube_t); +int64_t coord_cocsep(cube_t); +size_t gendata_cocsep(void *, uint64_t *, cube_t *); + +void run(void) { + uint8_t t, tinv; + uint32_t buf[300000], tt; + uint64_t selfsim[COCSEP_CLASSES]; + int64_t i, j; + cube_t rep[COCSEP_CLASSES], c, d; + + gendata_cocsep(buf, selfsim, rep); + + for (i = 0; i < COCSEP_CLASSES; i++) { + c = rep[i]; + for (t = 0; t < 48; t++) { + tinv = inverse_trans(t); + d = transform_corners(c); + j = coord_cocsep(d); + tt = (buf[j] & (0xFF << 8)) >> 8; + if (tt != tinv) + printf("cocsep %" PRId64 " <- %" PRId64 ": " + "expected t %" PRIu8 " (inverse of %" + PRIu8 "), got %" PRIu32 "\n", + i, j, tinv, t, tt); + } + } +} -- cgit v1.3