diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/102_gendata_h48/00_all.in | 0 | ||||
| -rw-r--r-- | test/102_gendata_h48/00_all.out | 1 | ||||
| -rw-r--r-- | test/102_gendata_h48/00_h_0.in | 1 | ||||
| -rw-r--r-- | test/102_gendata_h48/00_h_0.out | 23 | ||||
| -rw-r--r-- | test/102_gendata_h48/gendata_h48_tests.c | 31 |
5 files changed, 49 insertions, 7 deletions
diff --git a/test/102_gendata_h48/00_all.in b/test/102_gendata_h48/00_all.in deleted file mode 100644 index e69de29..0000000 --- a/test/102_gendata_h48/00_all.in +++ /dev/null | |||
diff --git a/test/102_gendata_h48/00_all.out b/test/102_gendata_h48/00_all.out deleted file mode 100644 index deba01f..0000000 --- a/test/102_gendata_h48/00_all.out +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | something | ||
diff --git a/test/102_gendata_h48/00_h_0.in b/test/102_gendata_h48/00_h_0.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/102_gendata_h48/00_h_0.in | |||
| @@ -0,0 +1 @@ | |||
| 0 | |||
diff --git a/test/102_gendata_h48/00_h_0.out b/test/102_gendata_h48/00_h_0.out new file mode 100644 index 0000000..8c629f8 --- /dev/null +++ b/test/102_gendata_h48/00_h_0.out | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | 59903545 | ||
| 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: 3608 | ||
diff --git a/test/102_gendata_h48/gendata_h48_tests.c b/test/102_gendata_h48/gendata_h48_tests.c index f918e4d..35e6f42 100644 --- a/test/102_gendata_h48/gendata_h48_tests.c +++ b/test/102_gendata_h48/gendata_h48_tests.c | |||
| @@ -1,18 +1,37 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | #define H 0 | 3 | #define MAXH 1 |
| 4 | #define SIZE (120000000 << (H)) | 4 | #define MAXDEPTH 5 |
| 5 | #define COCSEPSIZE 1119792 | ||
| 6 | #define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (h)) | ||
| 7 | #define SIZE (60000000 << MAXH) | ||
| 5 | 8 | ||
| 6 | uint32_t buf[SIZE]; | 9 | uint32_t buf[SIZE/4]; |
| 7 | 10 | ||
| 8 | size_t gendata_h48(void *, uint8_t); | 11 | size_t gendata_h48(void *, uint8_t, uint8_t); |
| 9 | 12 | ||
| 10 | int main(void) { | 13 | int main(void) { |
| 14 | char str[STRLENMAX]; | ||
| 15 | uint8_t h, i; | ||
| 16 | uint32_t *h48info; | ||
| 11 | size_t result; | 17 | size_t result; |
| 12 | 18 | ||
| 13 | result = gendata_h48(buf, H); | 19 | fgets(str, STRLENMAX, stdin); |
| 20 | h = atoi(str); | ||
| 21 | result = gendata_h48(buf, h, MAXDEPTH); | ||
| 22 | h48info = buf + (ETABLESIZE(h) + COCSEPSIZE) / 4; | ||
| 14 | 23 | ||
| 15 | printf("nothing\n"); | 24 | printf("%zu\n\n", result); |
| 25 | |||
| 26 | printf("cocsepdata:\n"); | ||
| 27 | printf("Classes: %" PRIu32 "\n", buf[COCSEPSIZE/4-12]); | ||
| 28 | printf("Max value: %" PRIu32 "\n", buf[COCSEPSIZE/4-11]); | ||
| 29 | for (i = 0; i < 10; i++) | ||
| 30 | printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]); | ||
| 31 | |||
| 32 | printf("\nh48:\n"); | ||
| 33 | for (i = 0; i < MAXDEPTH+1; i++) | ||
| 34 | printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); | ||
| 16 | 35 | ||
| 17 | return 0; | 36 | return 0; |
| 18 | } | 37 | } |
