diff options
Diffstat (limited to 'test/110_gendata_cocsep/gendata_cocsep_tests.c')
| -rw-r--r-- | test/110_gendata_cocsep/gendata_cocsep_tests.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/110_gendata_cocsep/gendata_cocsep_tests.c b/test/110_gendata_cocsep/gendata_cocsep_tests.c new file mode 100644 index 0000000..c1eef77 --- /dev/null +++ b/test/110_gendata_cocsep/gendata_cocsep_tests.c | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | #define BUF_SIZE 2000000 | ||
| 4 | |||
| 5 | size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); | ||
| 6 | int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); | ||
| 7 | |||
| 8 | void run(void) { | ||
| 9 | unsigned char buf[BUF_SIZE]; | ||
| 10 | uint32_t i; | ||
| 11 | uint64_t selfsim[COCSEP_CLASSES]; | ||
| 12 | cube_t rep[COCSEP_CLASSES]; | ||
| 13 | size_t result; | ||
| 14 | tableinfo_t info; | ||
| 15 | |||
| 16 | result = gendata_cocsep(buf, selfsim, rep); | ||
| 17 | if (readtableinfo(BUF_SIZE, buf, &info) != NISSY_OK) { | ||
| 18 | printf("Error reading info from table\n"); | ||
| 19 | return; | ||
| 20 | } | ||
| 21 | |||
| 22 | printf("%zu\n", result); | ||
| 23 | printf("Classes: %" PRIu64 "\n", info.classes); | ||
| 24 | printf("Max value: %" PRIu8 "\n", info.maxvalue); | ||
| 25 | for (i = 0; i < 10; i++) | ||
| 26 | printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); | ||
| 27 | } | ||
