diff options
Diffstat (limited to '')
| -rw-r--r-- | test/120_gendata_h48h0k4/00_h_0.in | 2 | ||||
| -rw-r--r-- | test/120_gendata_h48h0k4/00_h_0.out | 22 | ||||
| -rw-r--r-- | test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c | 84 |
3 files changed, 0 insertions, 108 deletions
diff --git a/test/120_gendata_h48h0k4/00_h_0.in b/test/120_gendata_h48h0k4/00_h_0.in deleted file mode 100644 index 661d826..0000000 --- a/test/120_gendata_h48h0k4/00_h_0.in +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | 4 | ||
| 2 | 0 | ||
diff --git a/test/120_gendata_h48h0k4/00_h_0.out b/test/120_gendata_h48h0k4/00_h_0.out deleted file mode 100644 index 6ca64de..0000000 --- a/test/120_gendata_h48h0k4/00_h_0.out +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | 59904493 | ||
| 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 | ||
diff --git a/test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c b/test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c deleted file mode 100644 index 7c5b441..0000000 --- a/test/120_gendata_h48h0k4/gendata_h48h0k4_tests.c +++ /dev/null | |||
| @@ -1,84 +0,0 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | #define COCSEP_CLASSES 3393 | ||
| 4 | #define INFOSIZE 512 | ||
| 5 | #define INFO_SOLVER_STRLEN 100 | ||
| 6 | #define INFO_DISTRIBUTION_LEN 21 | ||
| 7 | |||
| 8 | typedef struct { | ||
| 9 | uint64_t distribution[INFO_DISTRIBUTION_LEN]; | ||
| 10 | uint64_t type; | ||
| 11 | uint64_t infosize; | ||
| 12 | uint64_t fullsize; | ||
| 13 | uint64_t hash; | ||
| 14 | uint64_t entries; | ||
| 15 | uint64_t classes; /* Used only by cocsepdata, for now */ | ||
| 16 | uint64_t next; | ||
| 17 | char solver[INFO_SOLVER_STRLEN]; | ||
| 18 | uint8_t h48h; | ||
| 19 | uint8_t bits; | ||
| 20 | uint8_t base; | ||
| 21 | uint8_t maxvalue; | ||
| 22 | } tableinfo_t; | ||
| 23 | |||
| 24 | typedef struct { | ||
| 25 | uint8_t h; | ||
| 26 | uint8_t k; | ||
| 27 | uint8_t base; | ||
| 28 | uint8_t maxdepth; | ||
| 29 | tableinfo_t info; | ||
| 30 | void *buf; | ||
| 31 | void *h48buf; | ||
| 32 | uint32_t *cocsepdata; | ||
| 33 | uint64_t selfsim[COCSEP_CLASSES]; | ||
| 34 | cube_t crep[COCSEP_CLASSES]; | ||
| 35 | } gendata_h48_arg_t; | ||
| 36 | |||
| 37 | int64_t gendata_h48(gendata_h48_arg_t *); | ||
| 38 | bool readtableinfo(const void *, tableinfo_t *); | ||
| 39 | |||
| 40 | void run(void) { | ||
| 41 | char str[STRLENMAX]; | ||
| 42 | uint8_t i; | ||
| 43 | gendata_h48_arg_t arg; | ||
| 44 | size_t result, sz; | ||
| 45 | tableinfo_t cinfo, hinfo; | ||
| 46 | void *h48buf; | ||
| 47 | |||
| 48 | fgets(str, STRLENMAX, stdin); | ||
| 49 | arg.maxdepth = atoi(str); | ||
| 50 | fgets(str, STRLENMAX, stdin); | ||
| 51 | arg.h = atoi(str); | ||
| 52 | arg.k = 4; | ||
| 53 | |||
| 54 | sz = gendata_h48(&arg); /* With buf = NULL returns data size */ | ||
| 55 | arg.buf = malloc(sz); | ||
| 56 | |||
| 57 | result = gendata_h48(&arg); | ||
| 58 | |||
| 59 | if (!readtableinfo(arg.buf, &cinfo)) { | ||
| 60 | printf("Error reading cocsep info\n"); | ||
| 61 | goto end; | ||
| 62 | } | ||
| 63 | |||
| 64 | h48buf = (char *)arg.buf + cinfo.next; | ||
| 65 | if (!readtableinfo(h48buf, &hinfo)) { | ||
| 66 | printf("Error reading h48 info\n"); | ||
| 67 | goto end; | ||
| 68 | } | ||
| 69 | |||
| 70 | printf("%zu\n\n", result); | ||
| 71 | |||
| 72 | printf("cocsepdata:\n"); | ||
| 73 | printf("Classes: %" PRIu64 "\n", cinfo.classes); | ||
| 74 | printf("Max value: %" PRIu8 "\n", cinfo.maxvalue); | ||
| 75 | for (i = 0; i <= cinfo.maxvalue; i++) | ||
| 76 | printf("%" PRIu32 ": %" PRIu64 "\n", i, cinfo.distribution[i]); | ||
| 77 | |||
| 78 | printf("\nh48:\n"); | ||
| 79 | for (i = 0; i <= hinfo.maxvalue; i++) | ||
| 80 | printf("%" PRIu32 ": %" PRIu64 "\n", i, hinfo.distribution[i]); | ||
| 81 | |||
| 82 | end: | ||
| 83 | free(arg.buf); | ||
| 84 | } | ||
