diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-20 10:05:51 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-20 10:05:51 +0200 |
| commit | 5727f06c5694a4831881322876e3ba4d8ce3b743 (patch) | |
| tree | 8ec57e5862b05464b54aad3aad6f3d37653066a6 /test | |
| parent | e20e4f550ae373414d9bc106b1615a5c5896c9c4 (diff) | |
| download | nissy-core-5727f06c5694a4831881322876e3ba4d8ce3b743.tar.gz nissy-core-5727f06c5694a4831881322876e3ba4d8ce3b743.zip | |
Finally fixed selfsim logic
Diffstat (limited to 'test')
| -rw-r--r-- | test/111_gendata_h48_h0/00_h_0.in | 0 | ||||
| -rw-r--r-- | test/111_h48map/00_small.in (renamed from test/112_h48map/00_small.in) | 0 | ||||
| -rw-r--r-- | test/111_h48map/00_small.out (renamed from test/112_h48map/00_small.out) | 0 | ||||
| -rw-r--r-- | test/111_h48map/01_large.in (renamed from test/112_h48map/01_large.in) | 0 | ||||
| -rw-r--r-- | test/111_h48map/01_large.out (renamed from test/112_h48map/01_large.out) | 0 | ||||
| -rw-r--r-- | test/111_h48map/h48map_tests.c (renamed from test/112_h48map/h48map_tests.c) | 0 | ||||
| -rw-r--r-- | test/112_gendata_h48/00_h_0.in | 2 | ||||
| -rw-r--r-- | test/112_gendata_h48/00_h_0.out (renamed from test/111_gendata_h48_h0/00_h_0.out) | 0 | ||||
| -rw-r--r-- | test/112_gendata_h48/gendata_h48_tests.c (renamed from test/111_gendata_h48_h0/gendata_h48_tests.c) | 18 |
9 files changed, 16 insertions, 4 deletions
diff --git a/test/111_gendata_h48_h0/00_h_0.in b/test/111_gendata_h48_h0/00_h_0.in deleted file mode 100644 index e69de29..0000000 --- a/test/111_gendata_h48_h0/00_h_0.in +++ /dev/null | |||
diff --git a/test/112_h48map/00_small.in b/test/111_h48map/00_small.in index ee8e591..ee8e591 100644 --- a/test/112_h48map/00_small.in +++ b/test/111_h48map/00_small.in | |||
diff --git a/test/112_h48map/00_small.out b/test/111_h48map/00_small.out index 260e804..260e804 100644 --- a/test/112_h48map/00_small.out +++ b/test/111_h48map/00_small.out | |||
diff --git a/test/112_h48map/01_large.in b/test/111_h48map/01_large.in index 1812b40..1812b40 100644 --- a/test/112_h48map/01_large.in +++ b/test/111_h48map/01_large.in | |||
diff --git a/test/112_h48map/01_large.out b/test/111_h48map/01_large.out index f5e00d8..f5e00d8 100644 --- a/test/112_h48map/01_large.out +++ b/test/111_h48map/01_large.out | |||
diff --git a/test/112_h48map/h48map_tests.c b/test/111_h48map/h48map_tests.c index d70bc3a..d70bc3a 100644 --- a/test/112_h48map/h48map_tests.c +++ b/test/111_h48map/h48map_tests.c | |||
diff --git a/test/112_gendata_h48/00_h_0.in b/test/112_gendata_h48/00_h_0.in new file mode 100644 index 0000000..cb6e5ed --- /dev/null +++ b/test/112_gendata_h48/00_h_0.in | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 5 | ||
| 2 | 0 | ||
diff --git a/test/111_gendata_h48_h0/00_h_0.out b/test/112_gendata_h48/00_h_0.out index 04e8bf6..04e8bf6 100644 --- a/test/111_gendata_h48_h0/00_h_0.out +++ b/test/112_gendata_h48/00_h_0.out | |||
diff --git a/test/111_gendata_h48_h0/gendata_h48_tests.c b/test/112_gendata_h48/gendata_h48_tests.c index e9de3c0..485d9d0 100644 --- a/test/111_gendata_h48_h0/gendata_h48_tests.c +++ b/test/112_gendata_h48/gendata_h48_tests.c | |||
| @@ -1,20 +1,30 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | #define MAXDEPTH 5 | ||
| 4 | #define COCSEPSIZE 1119792 | 3 | #define COCSEPSIZE 1119792 |
| 5 | #define ETABLESIZE ((3393 * 495 * 70) >> 1) | 4 | #define ETABLESIZE ((3393 * 495 * 70) >> 1) |
| 6 | 5 | ||
| 7 | int64_t gendata_h48h0k4(void *, uint8_t); | 6 | int64_t gendata_h48h0k4(void *, uint8_t); |
| 8 | 7 | ||
| 8 | int64_t gendata_h48_fixture(void *buf, uint8_t maxdepth, uint8_t h) { | ||
| 9 | if (h == 0) | ||
| 10 | return gendata_h48h0k4(buf, maxdepth); | ||
| 11 | fprintf(stderr, "Error: gendata h48 for h>0 not implemented yet\n"); | ||
| 12 | exit(1); | ||
| 13 | } | ||
| 14 | |||
| 9 | void run(void) { | 15 | void run(void) { |
| 10 | char str[STRLENMAX]; | 16 | char str[STRLENMAX]; |
| 11 | uint8_t i; | 17 | uint8_t i, maxdepth, h; |
| 12 | uint32_t *buf, *h48info; | 18 | uint32_t *buf, *h48info; |
| 13 | size_t result; | 19 | size_t result; |
| 14 | 20 | ||
| 15 | fgets(str, STRLENMAX, stdin); | 21 | fgets(str, STRLENMAX, stdin); |
| 22 | maxdepth = atoi(str); | ||
| 23 | fgets(str, STRLENMAX, stdin); | ||
| 24 | h = atoi(str); | ||
| 25 | |||
| 16 | buf = (uint32_t *)malloc(sizeof(uint32_t) * 60000000); | 26 | buf = (uint32_t *)malloc(sizeof(uint32_t) * 60000000); |
| 17 | result = gendata_h48h0k4(buf, MAXDEPTH); | 27 | result = gendata_h48_fixture(buf, maxdepth, h); |
| 18 | h48info = buf + (ETABLESIZE + COCSEPSIZE) / 4; | 28 | h48info = buf + (ETABLESIZE + COCSEPSIZE) / 4; |
| 19 | 29 | ||
| 20 | printf("%zu\n\n", result); | 30 | printf("%zu\n\n", result); |
| @@ -26,7 +36,7 @@ void run(void) { | |||
| 26 | printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]); | 36 | printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]); |
| 27 | 37 | ||
| 28 | printf("\nh48:\n"); | 38 | printf("\nh48:\n"); |
| 29 | for (i = 0; i < MAXDEPTH+1; i++) | 39 | for (i = 0; i < maxdepth+1; i++) |
| 30 | printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); | 40 | printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); |
| 31 | 41 | ||
| 32 | free(buf); | 42 | free(buf); |
