diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/102_gendata_h48/01_h_1.in | 1 | ||||
| -rw-r--r-- | test/102_gendata_h48/01_h_1.out | 23 | ||||
| -rw-r--r-- | test/102_gendata_h48/gendata_h48_tests.c | 8 |
3 files changed, 27 insertions, 5 deletions
diff --git a/test/102_gendata_h48/01_h_1.in b/test/102_gendata_h48/01_h_1.in new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/test/102_gendata_h48/01_h_1.in | |||
| @@ -0,0 +1 @@ | |||
| 1 | |||
diff --git a/test/102_gendata_h48/01_h_1.out b/test/102_gendata_h48/01_h_1.out new file mode 100644 index 0000000..56b7066 --- /dev/null +++ b/test/102_gendata_h48/01_h_1.out | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | 118687270 | ||
| 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: 377 | ||
| 23 | 5: 4113 | ||
diff --git a/test/102_gendata_h48/gendata_h48_tests.c b/test/102_gendata_h48/gendata_h48_tests.c index 35e6f42..9d96e75 100644 --- a/test/102_gendata_h48/gendata_h48_tests.c +++ b/test/102_gendata_h48/gendata_h48_tests.c | |||
| @@ -1,23 +1,20 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | #define MAXH 1 | ||
| 4 | #define MAXDEPTH 5 | 3 | #define MAXDEPTH 5 |
| 5 | #define COCSEPSIZE 1119792 | 4 | #define COCSEPSIZE 1119792 |
| 6 | #define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (h)) | 5 | #define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (h)) |
| 7 | #define SIZE (60000000 << MAXH) | ||
| 8 | |||
| 9 | uint32_t buf[SIZE/4]; | ||
| 10 | 6 | ||
| 11 | size_t gendata_h48(void *, uint8_t, uint8_t); | 7 | size_t gendata_h48(void *, uint8_t, uint8_t); |
| 12 | 8 | ||
| 13 | int main(void) { | 9 | int main(void) { |
| 14 | char str[STRLENMAX]; | 10 | char str[STRLENMAX]; |
| 15 | uint8_t h, i; | 11 | uint8_t h, i; |
| 16 | uint32_t *h48info; | 12 | uint32_t *buf, *h48info; |
| 17 | size_t result; | 13 | size_t result; |
| 18 | 14 | ||
| 19 | fgets(str, STRLENMAX, stdin); | 15 | fgets(str, STRLENMAX, stdin); |
| 20 | h = atoi(str); | 16 | h = atoi(str); |
| 17 | buf = (uint32_t *)malloc(sizeof(uint32_t) * (60000000 << h)); | ||
| 21 | result = gendata_h48(buf, h, MAXDEPTH); | 18 | result = gendata_h48(buf, h, MAXDEPTH); |
| 22 | h48info = buf + (ETABLESIZE(h) + COCSEPSIZE) / 4; | 19 | h48info = buf + (ETABLESIZE(h) + COCSEPSIZE) / 4; |
| 23 | 20 | ||
| @@ -33,5 +30,6 @@ int main(void) { | |||
| 33 | for (i = 0; i < MAXDEPTH+1; i++) | 30 | for (i = 0; i < MAXDEPTH+1; i++) |
| 34 | printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); | 31 | printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); |
| 35 | 32 | ||
| 33 | free(buf); | ||
| 36 | return 0; | 34 | return 0; |
| 37 | } | 35 | } |
