From c558c7989eaa0921f7b29ee274b325f4f6d97f8c Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 26 Aug 2024 21:42:50 +0200 Subject: Gendata added for h48k2, need to verify with new tool --- test/120_gendata_h48h0k4/00_h_0.in | 2 + test/120_gendata_h48h0k4/00_h_0.out | 23 +++++++++++ test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c | 50 ++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 test/120_gendata_h48h0k4/00_h_0.in create mode 100644 test/120_gendata_h48h0k4/00_h_0.out create mode 100644 test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c (limited to 'test/120_gendata_h48h0k4') diff --git a/test/120_gendata_h48h0k4/00_h_0.in b/test/120_gendata_h48h0k4/00_h_0.in new file mode 100644 index 0000000..cb6e5ed --- /dev/null +++ b/test/120_gendata_h48h0k4/00_h_0.in @@ -0,0 +1,2 @@ +5 +0 diff --git a/test/120_gendata_h48h0k4/00_h_0.out b/test/120_gendata_h48h0k4/00_h_0.out new file mode 100644 index 0000000..04e8bf6 --- /dev/null +++ b/test/120_gendata_h48h0k4/00_h_0.out @@ -0,0 +1,23 @@ +59903605 + +cocsepdata: +Classes: 3393 +Max value: 9 +0: 1 +1: 6 +2: 63 +3: 468 +4: 3068 +5: 15438 +6: 53814 +7: 71352 +8: 8784 +9: 96 + +h48: +0: 1 +1: 1 +2: 4 +3: 34 +4: 331 +5: 3612 diff --git a/test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c b/test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c new file mode 100644 index 0000000..d6c6cb2 --- /dev/null +++ b/test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c @@ -0,0 +1,50 @@ +#include "../test.h" + +#define COCSEP_CLASSES 3393 +#define COCSEPSIZE 1119792 + +typedef struct { + uint8_t h; + uint8_t k; + uint8_t maxdepth; + void *buf; + uint32_t *info; + uint32_t *cocsepdata; + uint32_t *h48data; + uint64_t selfsim[COCSEP_CLASSES]; + cube_t crep[COCSEP_CLASSES]; +} gendata_h48_arg_t; + +int64_t gendata_h48(gendata_h48_arg_t *); + +void run(void) { + char str[STRLENMAX]; + uint8_t i; + gendata_h48_arg_t arg; + size_t result, sz; + + fgets(str, STRLENMAX, stdin); + arg.maxdepth = atoi(str); + fgets(str, STRLENMAX, stdin); + arg.h = atoi(str); + arg.k = 4; + + sz = gendata_h48(&arg); /* With buf = NULL returns data size */ + arg.buf = malloc(sz); + result = gendata_h48(&arg); + + printf("%zu\n\n", result); + + printf("cocsepdata:\n"); + printf("Classes: %" PRIu32 "\n", arg.cocsepdata[COCSEPSIZE/4-12]); + printf("Max value: %" PRIu32 "\n", arg.cocsepdata[COCSEPSIZE/4-11]); + for (i = 0; i < 10; i++) + printf("%" PRIu32 ": %" PRIu32 "\n", + i, arg.cocsepdata[COCSEPSIZE/4-10+i]); + + printf("\nh48:\n"); + for (i = 0; i < arg.maxdepth+1; i++) + printf("%" PRIu32 ": %" PRIu32 "\n", i, arg.info[i+1]); + + free(arg.buf); +} -- cgit v1.3