diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/090_tables_readwrite/00_table.in | 2 | ||||
| -rw-r--r-- | test/090_tables_readwrite/00_table.out | 2 | ||||
| -rw-r--r-- | test/090_tables_readwrite/tables_readwrite_tests.c | 8 | ||||
| -rw-r--r-- | test/100_gendata_cocsep/gendata_cocsep_tests.c | 8 |
4 files changed, 11 insertions, 9 deletions
diff --git a/test/090_tables_readwrite/00_table.in b/test/090_tables_readwrite/00_table.in index 0423662..3c2da46 100644 --- a/test/090_tables_readwrite/00_table.in +++ b/test/090_tables_readwrite/00_table.in | |||
| @@ -2,7 +2,7 @@ Test solver | |||
| 2 | 2 | ||
| 3 | 0 | 3 | 0 |
| 4 | 512 | 4 | 512 |
| 5 | 100000000000 | 5 | 512 |
| 6 | 12345678912345 | 6 | 12345678912345 |
| 7 | 399999999998 | 7 | 399999999998 |
| 8 | 3393 | 8 | 3393 |
diff --git a/test/090_tables_readwrite/00_table.out b/test/090_tables_readwrite/00_table.out index 0423662..3c2da46 100644 --- a/test/090_tables_readwrite/00_table.out +++ b/test/090_tables_readwrite/00_table.out | |||
| @@ -2,7 +2,7 @@ Test solver | |||
| 2 | 2 | ||
| 3 | 0 | 3 | 0 |
| 4 | 512 | 4 | 512 |
| 5 | 100000000000 | 5 | 512 |
| 6 | 12345678912345 | 6 | 12345678912345 |
| 7 | 399999999998 | 7 | 399999999998 |
| 8 | 3393 | 8 | 3393 |
diff --git a/test/090_tables_readwrite/tables_readwrite_tests.c b/test/090_tables_readwrite/tables_readwrite_tests.c index 9238207..01c1172 100644 --- a/test/090_tables_readwrite/tables_readwrite_tests.c +++ b/test/090_tables_readwrite/tables_readwrite_tests.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | bool readtableinfo(const void *, tableinfo_t *); | 3 | bool readtableinfo(uint64_t, const char *, tableinfo_t *); |
| 4 | bool writetableinfo(const tableinfo_t *, void *); | 4 | bool writetableinfo(const tableinfo_t *, uint64_t, char *); |
| 5 | 5 | ||
| 6 | uint64_t readn(void) { | 6 | uint64_t readn(void) { |
| 7 | char str[STRLENMAX]; | 7 | char str[STRLENMAX]; |
| @@ -70,7 +70,7 @@ void run(void) { | |||
| 70 | tableinfo_t expected, actual; | 70 | tableinfo_t expected, actual; |
| 71 | 71 | ||
| 72 | expected = test_readinfo(); | 72 | expected = test_readinfo(); |
| 73 | writetableinfo(&expected, buf); | 73 | writetableinfo(&expected, INFOSIZE, buf); |
| 74 | readtableinfo(buf, &actual); | 74 | readtableinfo(INFOSIZE, buf, &actual); |
| 75 | test_writeinfo(actual); | 75 | test_writeinfo(actual); |
| 76 | } | 76 | } |
diff --git a/test/100_gendata_cocsep/gendata_cocsep_tests.c b/test/100_gendata_cocsep/gendata_cocsep_tests.c index 296df28..91ebb52 100644 --- a/test/100_gendata_cocsep/gendata_cocsep_tests.c +++ b/test/100_gendata_cocsep/gendata_cocsep_tests.c | |||
| @@ -1,10 +1,12 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | #define BUF_SIZE 2000000 | ||
| 4 | |||
| 3 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); | 5 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); |
| 4 | bool readtableinfo(const void *, tableinfo_t *); | 6 | bool readtableinfo(uint64_t, const char *, tableinfo_t *); |
| 5 | 7 | ||
| 6 | void run(void) { | 8 | void run(void) { |
| 7 | char buf[2000000]; | 9 | char buf[BUF_SIZE]; |
| 8 | uint32_t i; | 10 | uint32_t i; |
| 9 | uint64_t selfsim[COCSEP_CLASSES]; | 11 | uint64_t selfsim[COCSEP_CLASSES]; |
| 10 | cube_t rep[COCSEP_CLASSES]; | 12 | cube_t rep[COCSEP_CLASSES]; |
| @@ -12,7 +14,7 @@ void run(void) { | |||
| 12 | tableinfo_t info; | 14 | tableinfo_t info; |
| 13 | 15 | ||
| 14 | result = gendata_cocsep(buf, selfsim, rep); | 16 | result = gendata_cocsep(buf, selfsim, rep); |
| 15 | if (!readtableinfo(buf, &info)) { | 17 | if (readtableinfo(BUF_SIZE, buf, &info) != NISSY_OK) { |
| 16 | printf("Error reading info from table\n"); | 18 | printf("Error reading info from table\n"); |
| 17 | return; | 19 | return; |
| 18 | } | 20 | } |
