diff options
Diffstat (limited to 'test/120_gendata_h48h0k4')
| -rw-r--r-- | test/120_gendata_h48h0k4/00_h_0.in | 2 | ||||
| -rw-r--r-- | test/120_gendata_h48h0k4/00_h_0.out | 23 | ||||
| -rw-r--r-- | test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c | 50 |
3 files changed, 75 insertions, 0 deletions
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 @@ | |||
| 1 | 5 | ||
| 2 | 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 @@ | |||
| 1 | 59903605 | ||
| 2 | |||
| 3 | cocsepdata: | ||
| 4 | Classes: 3393 | ||
| 5 | Max value: 9 | ||
| 6 | 0: 1 | ||
| 7 | 1: 6 | ||
| 8 | 2: 63 | ||
| 9 | 3: 468 | ||
| 10 | 4: 3068 | ||
| 11 | 5: 15438 | ||
| 12 | 6: 53814 | ||
| 13 | 7: 71352 | ||
| 14 | 8: 8784 | ||
| 15 | 9: 96 | ||
| 16 | |||
| 17 | h48: | ||
| 18 | 0: 1 | ||
| 19 | 1: 1 | ||
| 20 | 2: 4 | ||
| 21 | 3: 34 | ||
| 22 | 4: 331 | ||
| 23 | 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 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | #define COCSEP_CLASSES 3393 | ||
| 4 | #define COCSEPSIZE 1119792 | ||
| 5 | |||
| 6 | typedef struct { | ||
| 7 | uint8_t h; | ||
| 8 | uint8_t k; | ||
| 9 | uint8_t maxdepth; | ||
| 10 | void *buf; | ||
| 11 | uint32_t *info; | ||
| 12 | uint32_t *cocsepdata; | ||
| 13 | uint32_t *h48data; | ||
| 14 | uint64_t selfsim[COCSEP_CLASSES]; | ||
| 15 | cube_t crep[COCSEP_CLASSES]; | ||
| 16 | } gendata_h48_arg_t; | ||
| 17 | |||
| 18 | int64_t gendata_h48(gendata_h48_arg_t *); | ||
| 19 | |||
| 20 | void run(void) { | ||
| 21 | char str[STRLENMAX]; | ||
| 22 | uint8_t i; | ||
| 23 | gendata_h48_arg_t arg; | ||
| 24 | size_t result, sz; | ||
| 25 | |||
| 26 | fgets(str, STRLENMAX, stdin); | ||
| 27 | arg.maxdepth = atoi(str); | ||
| 28 | fgets(str, STRLENMAX, stdin); | ||
| 29 | arg.h = atoi(str); | ||
| 30 | arg.k = 4; | ||
| 31 | |||
| 32 | sz = gendata_h48(&arg); /* With buf = NULL returns data size */ | ||
| 33 | arg.buf = malloc(sz); | ||
| 34 | result = gendata_h48(&arg); | ||
| 35 | |||
| 36 | printf("%zu\n\n", result); | ||
| 37 | |||
| 38 | printf("cocsepdata:\n"); | ||
| 39 | printf("Classes: %" PRIu32 "\n", arg.cocsepdata[COCSEPSIZE/4-12]); | ||
| 40 | printf("Max value: %" PRIu32 "\n", arg.cocsepdata[COCSEPSIZE/4-11]); | ||
| 41 | for (i = 0; i < 10; i++) | ||
| 42 | printf("%" PRIu32 ": %" PRIu32 "\n", | ||
| 43 | i, arg.cocsepdata[COCSEPSIZE/4-10+i]); | ||
| 44 | |||
| 45 | printf("\nh48:\n"); | ||
| 46 | for (i = 0; i < arg.maxdepth+1; i++) | ||
| 47 | printf("%" PRIu32 ": %" PRIu32 "\n", i, arg.info[i+1]); | ||
| 48 | |||
| 49 | free(arg.buf); | ||
| 50 | } | ||
