From b144ec8b96b5b71e409d2a692eac64b38120c9ba Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 20 May 2024 17:48:47 +0200 Subject: More tests for gendata h48 --- test/102_gendata_h48/gendata_h48_tests.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'test/102_gendata_h48/gendata_h48_tests.c') diff --git a/test/102_gendata_h48/gendata_h48_tests.c b/test/102_gendata_h48/gendata_h48_tests.c index 35e6f42..9d96e75 100644 --- a/test/102_gendata_h48/gendata_h48_tests.c +++ b/test/102_gendata_h48/gendata_h48_tests.c @@ -1,23 +1,20 @@ #include "../test.h" -#define MAXH 1 #define MAXDEPTH 5 #define COCSEPSIZE 1119792 #define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (h)) -#define SIZE (60000000 << MAXH) - -uint32_t buf[SIZE/4]; size_t gendata_h48(void *, uint8_t, uint8_t); int main(void) { char str[STRLENMAX]; uint8_t h, i; - uint32_t *h48info; + uint32_t *buf, *h48info; size_t result; fgets(str, STRLENMAX, stdin); h = atoi(str); + buf = (uint32_t *)malloc(sizeof(uint32_t) * (60000000 << h)); result = gendata_h48(buf, h, MAXDEPTH); h48info = buf + (ETABLESIZE(h) + COCSEPSIZE) / 4; @@ -33,5 +30,6 @@ int main(void) { for (i = 0; i < MAXDEPTH+1; i++) printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); + free(buf); return 0; } -- cgit v1.3