diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-10-29 10:29:27 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-10-29 10:31:38 +0100 |
| commit | 80ec600701aae54350679bbf5e0ce874c915506e (patch) | |
| tree | 137007693afb0d12b0886990b4bfb6d7278bfa22 /test/050_transform/transform_tests.c | |
| parent | f2dd7feb819fe4a8a4181dd1d04488e31f4b63a1 (diff) | |
| download | nissy-core-80ec600701aae54350679bbf5e0ce874c915506e.tar.gz nissy-core-80ec600701aae54350679bbf5e0ce874c915506e.zip | |
AVX2 compiles, fails all tests; + some renaming
Diffstat (limited to 'test/050_transform/transform_tests.c')
| -rw-r--r-- | test/050_transform/transform_tests.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/050_transform/transform_tests.c b/test/050_transform/transform_tests.c new file mode 100644 index 0000000..1e49037 --- /dev/null +++ b/test/050_transform/transform_tests.c | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #include <stdbool.h> | ||
| 2 | #include <stdint.h> | ||
| 3 | #include <stdio.h> | ||
| 4 | |||
| 5 | #include "../../src/cube.h" | ||
| 6 | |||
| 7 | #define STRLENMAX 10000 | ||
| 8 | |||
| 9 | int main() { | ||
| 10 | char str[STRLENMAX]; | ||
| 11 | trans_t t; | ||
| 12 | cube_t cube; | ||
| 13 | |||
| 14 | fgets(str, STRLENMAX, stdin); | ||
| 15 | t = readtrans(str); | ||
| 16 | |||
| 17 | if (t == errortrans) { | ||
| 18 | printf("Error reading trans\n"); | ||
| 19 | return 1; | ||
| 20 | } | ||
| 21 | |||
| 22 | fgets(str, STRLENMAX, stdin); | ||
| 23 | cube = readcube(H48, str); | ||
| 24 | |||
| 25 | cube = transform(cube, t); | ||
| 26 | |||
| 27 | if (iserror(cube)) { | ||
| 28 | printf("Error transforming cube\n"); | ||
| 29 | } else if (!issolvable(cube)) { | ||
| 30 | printf("Transformed cube is not solvable\n"); | ||
| 31 | } else { | ||
| 32 | writecube(H48, cube, str); | ||
| 33 | printf("%s\n", str); | ||
| 34 | } | ||
| 35 | |||
| 36 | return 0; | ||
| 37 | } | ||
