diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/080_allowednext/01_F_F2.in (renamed from test/080_allowednext/02_F_F2.in) | 2 | ||||
| -rw-r--r-- | test/080_allowednext/01_F_F2.out (renamed from test/080_allowednext/02_F_F2.out) | 0 | ||||
| -rw-r--r-- | test/080_allowednext/02_U_F.in | 2 | ||||
| -rw-r--r-- | test/080_allowednext/03_R_L_R.in | 2 | ||||
| -rw-r--r-- | test/080_allowednext/04_longer_true.in | 2 | ||||
| -rw-r--r-- | test/080_allowednext/05_longer_false.in | 2 | ||||
| -rw-r--r-- | test/080_allowednext/06_D_U_false_order.in | 2 | ||||
| -rw-r--r-- | test/080_allowednext/allowednext_tests.c | 15 | ||||
| -rw-r--r-- | test/101_gendata_eoesep/00_all.in | 0 | ||||
| -rw-r--r-- | test/101_gendata_eoesep/00_all.out | 1 | ||||
| -rw-r--r-- | test/101_gendata_eoesep/gendata_eoesep_tests.c | 22 |
11 files changed, 34 insertions, 16 deletions
diff --git a/test/080_allowednext/02_F_F2.in b/test/080_allowednext/01_F_F2.in index 06f504f..93f0a9c 100644 --- a/test/080_allowednext/02_F_F2.in +++ b/test/080_allowednext/01_F_F2.in | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | 1 | 1 | 2 |
| 2 | F | 2 | F |
| 3 | F2 | 3 | F2 |
diff --git a/test/080_allowednext/02_F_F2.out b/test/080_allowednext/01_F_F2.out index c508d53..c508d53 100644 --- a/test/080_allowednext/02_F_F2.out +++ b/test/080_allowednext/01_F_F2.out | |||
diff --git a/test/080_allowednext/02_U_F.in b/test/080_allowednext/02_U_F.in index 3a41149..ad3607e 100644 --- a/test/080_allowednext/02_U_F.in +++ b/test/080_allowednext/02_U_F.in | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | 1 | 1 | 2 |
| 2 | U | 2 | U |
| 3 | F | 3 | F |
diff --git a/test/080_allowednext/03_R_L_R.in b/test/080_allowednext/03_R_L_R.in index e215381..ffd9542 100644 --- a/test/080_allowednext/03_R_L_R.in +++ b/test/080_allowednext/03_R_L_R.in | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 2 | 1 | 3 |
| 2 | R | 2 | R |
| 3 | L' | 3 | L' |
| 4 | R2 | 4 | R2 |
diff --git a/test/080_allowednext/04_longer_true.in b/test/080_allowednext/04_longer_true.in index e1f1d62..0360619 100644 --- a/test/080_allowednext/04_longer_true.in +++ b/test/080_allowednext/04_longer_true.in | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 10 | 1 | 11 |
| 2 | F2 | 2 | F2 |
| 3 | B | 3 | B |
| 4 | D2 | 4 | D2 |
diff --git a/test/080_allowednext/05_longer_false.in b/test/080_allowednext/05_longer_false.in index 6befeff..6cf8ecd 100644 --- a/test/080_allowednext/05_longer_false.in +++ b/test/080_allowednext/05_longer_false.in | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 7 | 1 | 8 |
| 2 | D | 2 | D |
| 3 | B2 | 3 | B2 |
| 4 | F' | 4 | F' |
diff --git a/test/080_allowednext/06_D_U_false_order.in b/test/080_allowednext/06_D_U_false_order.in index 7bfd8c2..680d1a1 100644 --- a/test/080_allowednext/06_D_U_false_order.in +++ b/test/080_allowednext/06_D_U_false_order.in | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | 1 | 1 | 2 |
| 2 | D | 2 | D |
| 3 | U | 3 | U |
diff --git a/test/080_allowednext/allowednext_tests.c b/test/080_allowednext/allowednext_tests.c index 7ae7f66..e531911 100644 --- a/test/080_allowednext/allowednext_tests.c +++ b/test/080_allowednext/allowednext_tests.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | bool allowednextmove(uint8_t *, int, uint8_t); | 3 | bool allowednextmove(uint8_t *, uint8_t); |
| 4 | 4 | ||
| 5 | static char *moves[] = { | 5 | static char *moves[] = { |
| 6 | "U", "U2", "U'", | 6 | "U", "U2", "U'", |
| @@ -13,7 +13,7 @@ static char *moves[] = { | |||
| 13 | 13 | ||
| 14 | int main(void) { | 14 | int main(void) { |
| 15 | char movestr[STRLENMAX]; | 15 | char movestr[STRLENMAX]; |
| 16 | uint8_t m[100], next; | 16 | uint8_t m[100]; |
| 17 | int n, i, j; | 17 | int n, i, j; |
| 18 | 18 | ||
| 19 | fgets(movestr, STRLENMAX, stdin); | 19 | fgets(movestr, STRLENMAX, stdin); |
| @@ -26,17 +26,12 @@ int main(void) { | |||
| 26 | if (!strcmp(movestr, moves[j])) | 26 | if (!strcmp(movestr, moves[j])) |
| 27 | m[i] = j; | 27 | m[i] = j; |
| 28 | } | 28 | } |
| 29 | fgets(movestr, STRLENMAX, stdin); | ||
| 30 | movestr[strcspn(movestr, "\n")] = 0; | ||
| 31 | for (j = 0; j < 18; j++) | ||
| 32 | if (!strcmp(movestr, moves[j])) | ||
| 33 | next = j; | ||
| 34 | 29 | ||
| 35 | fprintf(stderr, "Last two: %s, %s\nNext: %s\n", | 30 | fprintf(stderr, "Last two: %s, %s\nNext: %s\n", |
| 31 | n > 2 ? moves[m[n-3]] : "-", | ||
| 36 | n > 1 ? moves[m[n-2]] : "-", | 32 | n > 1 ? moves[m[n-2]] : "-", |
| 37 | n > 0 ? moves[m[n-1]] : "-", | 33 | n > 0 ? moves[m[n-1]] : "-"); |
| 38 | moves[next]); | 34 | printf("%s\n", allowednextmove(m, n) ? "true" : "false"); |
| 39 | printf("%s\n", allowednextmove(m, n, next) ? "true" : "false"); | ||
| 40 | 35 | ||
| 41 | return 0; | 36 | return 0; |
| 42 | } | 37 | } |
diff --git a/test/101_gendata_eoesep/00_all.in b/test/101_gendata_eoesep/00_all.in new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/101_gendata_eoesep/00_all.in | |||
diff --git a/test/101_gendata_eoesep/00_all.out b/test/101_gendata_eoesep/00_all.out new file mode 100644 index 0000000..deba01f --- /dev/null +++ b/test/101_gendata_eoesep/00_all.out | |||
| @@ -0,0 +1 @@ | |||
| something | |||
diff --git a/test/101_gendata_eoesep/gendata_eoesep_tests.c b/test/101_gendata_eoesep/gendata_eoesep_tests.c new file mode 100644 index 0000000..e03e95d --- /dev/null +++ b/test/101_gendata_eoesep/gendata_eoesep_tests.c | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | #define CSIZE 1200000 | ||
| 4 | #define ESIZE 250000000 | ||
| 5 | |||
| 6 | uint32_t buf_c[CSIZE/4]; | ||
| 7 | uint32_t buf_e[ESIZE/4]; | ||
| 8 | |||
| 9 | size_t gendata_cocsep(void *); | ||
| 10 | size_t gendata_eoesep(uint8_t, uint8_t, const void *, void *); | ||
| 11 | |||
| 12 | int main(void) { | ||
| 13 | uint32_t i; | ||
| 14 | size_t result; | ||
| 15 | |||
| 16 | gendata_cocsep(buf_c); | ||
| 17 | result = gendata_eoesep(0U, 4U, buf_c, buf_e); | ||
| 18 | |||
| 19 | printf("nothing\n"); | ||
| 20 | |||
| 21 | return 0; | ||
| 22 | } | ||
