diff options
Diffstat (limited to 'test/100_gendata_cocsep/gendata_cocsep_tests.c')
| -rw-r--r-- | test/100_gendata_cocsep/gendata_cocsep_tests.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/test/100_gendata_cocsep/gendata_cocsep_tests.c b/test/100_gendata_cocsep/gendata_cocsep_tests.c index 4a29ebb..ee26de9 100644 --- a/test/100_gendata_cocsep/gendata_cocsep_tests.c +++ b/test/100_gendata_cocsep/gendata_cocsep_tests.c | |||
| @@ -1,20 +1,45 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | #define COCSEP_CLASSES 3393 | 3 | #define INFOSIZE 512 |
| 4 | #define INFO_SOLVER_STRLEN 100 | ||
| 5 | #define INFO_DISTRIBUTION_LEN 21 | ||
| 6 | #define COCSEP_CLASSES 3393 | ||
| 7 | |||
| 8 | typedef struct { | ||
| 9 | char solver[INFO_SOLVER_STRLEN]; | ||
| 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 | uint8_t bits; | ||
| 17 | uint8_t base; | ||
| 18 | uint8_t maxvalue; | ||
| 19 | uint64_t next; | ||
| 20 | uint64_t distribution[INFO_DISTRIBUTION_LEN]; | ||
| 21 | } tableinfo_t; | ||
| 4 | 22 | ||
| 5 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); | 23 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); |
| 24 | bool readtableinfo(const void *, tableinfo_t *); | ||
| 6 | 25 | ||
| 7 | void run(void) { | 26 | void run(void) { |
| 8 | uint32_t buf[300000], i; | 27 | char buf[2000000]; |
| 28 | uint32_t i; | ||
| 9 | uint64_t selfsim[COCSEP_CLASSES]; | 29 | uint64_t selfsim[COCSEP_CLASSES]; |
| 10 | cube_t rep[COCSEP_CLASSES]; | 30 | cube_t rep[COCSEP_CLASSES]; |
| 11 | size_t result; | 31 | size_t result; |
| 32 | tableinfo_t info; | ||
| 12 | 33 | ||
| 13 | result = gendata_cocsep(buf, selfsim, rep); | 34 | result = gendata_cocsep(buf, selfsim, rep); |
| 35 | if (!readtableinfo(buf, &info)) { | ||
| 36 | printf("Error reading info from table\n"); | ||
| 37 | return; | ||
| 38 | } | ||
| 14 | 39 | ||
| 15 | printf("%zu\n", result); | 40 | printf("%zu\n", result); |
| 16 | printf("Classes: %" PRIu32 "\n", buf[result/4-12]); | 41 | printf("Classes: %" PRIu64 "\n", info.classes); |
| 17 | printf("Max value: %" PRIu32 "\n", buf[result/4-11]); | 42 | printf("Max value: %" PRIu8 "\n", info.maxvalue); |
| 18 | for (i = 0; i < 10; i++) | 43 | for (i = 0; i < 10; i++) |
| 19 | printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[result/4-10+i]); | 44 | printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); |
| 20 | } | 45 | } |
