From 67c35b638c04ab7a860aac0c166936e9481633c9 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 15 Jul 2024 09:15:35 +0200 Subject: Added test for selfsim distribution --- test/104_cocsep_ttrep/00_all.in | 0 test/104_cocsep_ttrep/00_all.out | 0 test/104_cocsep_ttrep/cocsep_ttrep_tests.c | 36 ++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 test/104_cocsep_ttrep/00_all.in create mode 100644 test/104_cocsep_ttrep/00_all.out create mode 100644 test/104_cocsep_ttrep/cocsep_ttrep_tests.c (limited to 'test/104_cocsep_ttrep') diff --git a/test/104_cocsep_ttrep/00_all.in b/test/104_cocsep_ttrep/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/104_cocsep_ttrep/00_all.out b/test/104_cocsep_ttrep/00_all.out new file mode 100644 index 0000000..e69de29 diff --git a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c new file mode 100644 index 0000000..f0da151 --- /dev/null +++ b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c @@ -0,0 +1,36 @@ +#include "../test.h" + +#define COCSEP_CLASSES 3393 +#define TTREP_MASK (UINT32_C(0xFF) << UINT32_C(8)) +#define TTREP(x) (((x) & TTREP_MASK) >> UINT32_C(8)) + +uint8_t inverse_trans(uint8_t); +cube_t transform_corners(cube_t, uint8_t); +int64_t coord_cocsep(cube_t); +size_t gendata_cocsep(void *, uint64_t *, cube_t *); + +void run(void) { + uint8_t t; + uint32_t buf[300000], tt; + uint64_t selfsim[COCSEP_CLASSES]; + int64_t i, j, k, l; + 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++) { + d = transform_corners(c, t); + j = coord_cocsep(d); + tt = TTREP(buf[j]); + d = transform_corners(d, tt); + k = coord_cocsep(d); + l = coord_cocsep(c); + if (k != l) + printf("cocsep %" PRId64 " (%" PRId64 "): " + "%" PRId64 " ttrep %" PRIu8 + " -> %" PRId64 "\n", i, l, j, tt, k); + } + } +} -- cgit v1.3