From 5727f06c5694a4831881322876e3ba4d8ce3b743 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 20 Jul 2024 10:05:51 +0200 Subject: Finally fixed selfsim logic --- test/112_gendata_h48/gendata_h48_tests.c | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test/112_gendata_h48/gendata_h48_tests.c (limited to 'test/112_gendata_h48/gendata_h48_tests.c') diff --git a/test/112_gendata_h48/gendata_h48_tests.c b/test/112_gendata_h48/gendata_h48_tests.c new file mode 100644 index 0000000..485d9d0 --- /dev/null +++ b/test/112_gendata_h48/gendata_h48_tests.c @@ -0,0 +1,43 @@ +#include "../test.h" + +#define COCSEPSIZE 1119792 +#define ETABLESIZE ((3393 * 495 * 70) >> 1) + +int64_t gendata_h48h0k4(void *, uint8_t); + +int64_t gendata_h48_fixture(void *buf, uint8_t maxdepth, uint8_t h) { + if (h == 0) + return gendata_h48h0k4(buf, maxdepth); + fprintf(stderr, "Error: gendata h48 for h>0 not implemented yet\n"); + exit(1); +} + +void run(void) { + char str[STRLENMAX]; + uint8_t i, maxdepth, h; + uint32_t *buf, *h48info; + size_t result; + + fgets(str, STRLENMAX, stdin); + maxdepth = atoi(str); + fgets(str, STRLENMAX, stdin); + h = atoi(str); + + buf = (uint32_t *)malloc(sizeof(uint32_t) * 60000000); + result = gendata_h48_fixture(buf, maxdepth, h); + h48info = buf + (ETABLESIZE + COCSEPSIZE) / 4; + + printf("%zu\n\n", result); + + printf("cocsepdata:\n"); + printf("Classes: %" PRIu32 "\n", buf[COCSEPSIZE/4-12]); + printf("Max value: %" PRIu32 "\n", buf[COCSEPSIZE/4-11]); + for (i = 0; i < 10; i++) + printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]); + + printf("\nh48:\n"); + for (i = 0; i < maxdepth+1; i++) + printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); + + free(buf); +} -- cgit v1.3