diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-04 08:24:39 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-04 08:24:39 +0100 |
| commit | 7defd8041e6050a9adf7927b43fd249d75d6389f (patch) | |
| tree | 345675fbdbb94a8027e35556d3a116a48f486dd8 /test | |
| parent | 038469b6f27106ab2002c7da11c6bca2a5fe30ee (diff) | |
| download | nissy-core-7defd8041e6050a9adf7927b43fd249d75d6389f.tar.gz nissy-core-7defd8041e6050a9adf7927b43fd249d75d6389f.zip | |
Begin work for coordinate solver
Diffstat (limited to '')
| -rw-r--r-- | test/120_gendata_eo/00_all.in | 0 | ||||
| -rw-r--r-- | test/120_gendata_eo/00_all.out | 12 | ||||
| -rw-r--r-- | test/120_gendata_eo/gendata_eo_tests.c | 37 | ||||
| -rw-r--r-- | test/test.h | 1 |
4 files changed, 50 insertions, 0 deletions
diff --git a/test/120_gendata_eo/00_all.in b/test/120_gendata_eo/00_all.in new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/120_gendata_eo/00_all.in | |||
diff --git a/test/120_gendata_eo/00_all.out b/test/120_gendata_eo/00_all.out new file mode 100644 index 0000000..42e8c66 --- /dev/null +++ b/test/120_gendata_eo/00_all.out | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | 1536 | ||
| 2 | 0: 1 | ||
| 3 | 1: 2 | ||
| 4 | 2: 25 | ||
| 5 | 3: 202 | ||
| 6 | 4: 620 | ||
| 7 | 5: 900 | ||
| 8 | 6: 285 | ||
| 9 | 7: 13 | ||
| 10 | 8: 0 | ||
| 11 | 9: 0 | ||
| 12 | 10: 0 | ||
diff --git a/test/120_gendata_eo/gendata_eo_tests.c b/test/120_gendata_eo/gendata_eo_tests.c new file mode 100644 index 0000000..3a6ac07 --- /dev/null +++ b/test/120_gendata_eo/gendata_eo_tests.c | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* | ||
| 2 | Pruning table values (from nissy): | ||
| 3 | 0: 1 | ||
| 4 | 1: 2 | ||
| 5 | 2: 25 | ||
| 6 | 3: 202 | ||
| 7 | 4: 620 | ||
| 8 | 5: 900 | ||
| 9 | 6: 285 | ||
| 10 | 7: 13 | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include "../test.h" | ||
| 14 | |||
| 15 | #define ISIZE 512 | ||
| 16 | #define FULLSIZE (ISIZE + 1024) | ||
| 17 | |||
| 18 | char buf[FULLSIZE]; | ||
| 19 | |||
| 20 | size_t gendata_coordinate_name(const char *, void *); | ||
| 21 | bool readtableinfo(uint64_t, const char *, tableinfo_t *); | ||
| 22 | |||
| 23 | void run(void) { | ||
| 24 | uint32_t i; | ||
| 25 | size_t result; | ||
| 26 | tableinfo_t info; | ||
| 27 | |||
| 28 | result = gendata_coordinate_name("EO", buf); | ||
| 29 | if (readtableinfo(FULLSIZE, buf, &info) != NISSY_OK) { | ||
| 30 | printf("Error reading info from table\n"); | ||
| 31 | return; | ||
| 32 | } | ||
| 33 | |||
| 34 | printf("%zu\n", result); | ||
| 35 | for (i = 0; i <= 10; i++) | ||
| 36 | printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); | ||
| 37 | } | ||
diff --git a/test/test.h b/test/test.h index fe362c7..e144527 100644 --- a/test/test.h +++ b/test/test.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "../src/solvers/h48/coordinate_macros.h" | 14 | #include "../src/solvers/h48/coordinate_macros.h" |
| 15 | #include "../src/solvers/h48/map_types_macros.h" | 15 | #include "../src/solvers/h48/map_types_macros.h" |
| 16 | #include "../src/solvers/h48/gendata_types_macros.h" | 16 | #include "../src/solvers/h48/gendata_types_macros.h" |
| 17 | #include "../src/solvers/coord/coord_types_macros.h" | ||
| 17 | 18 | ||
| 18 | #define STRLENMAX 10000 | 19 | #define STRLENMAX 10000 |
| 19 | 20 | ||
