aboutsummaryrefslogtreecommitdiff
path: root/test/01_io/io_tests.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-06-19 15:06:11 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-06-19 15:06:11 +0200
commitc5dfc897160bc9bbc6a91c77b5d58d421fd1cfe1 (patch)
treead73b01c37697c8b7392c85ffc7a02fb6a08e5f6 /test/01_io/io_tests.c
parent7e9afaa14ca293a7e9d5a76af36d9a0aecbb031d (diff)
downloadnissy-core-c5dfc897160bc9bbc6a91c77b5d58d421fd1cfe1.tar.gz
nissy-core-c5dfc897160bc9bbc6a91c77b5d58d421fd1cfe1.zip
Renamed test folders to keep order
Diffstat (limited to 'test/01_io/io_tests.c')
-rw-r--r--test/01_io/io_tests.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/01_io/io_tests.c b/test/01_io/io_tests.c
new file mode 100644
index 0000000..1ef99d0
--- /dev/null
+++ b/test/01_io/io_tests.c
@@ -0,0 +1,28 @@
1#include <stdbool.h>
2#include <stdint.h>
3#include <stdio.h>
4
5#include "../../src/cube.h"
6
7#define STRLENMAX 10000
8
9int main() {
10 char *c, str[STRLENMAX];
11 cube_t cube;
12
13 for (c = str; (*c = getchar()) != EOF; c++) ;
14 *c = '\0';
15
16 cube = readcube(str);
17
18 if (cube.e == errorcube.e && cube.c == errorcube.c) {
19 printf("Error reading cube\n");
20 } else if (!isconsistent(cube)) {
21 printf("Cube is inconsistent\n");
22 } else {
23 writecube(cube, str);
24 printf("%s\n", str);
25 }
26
27 return 0;
28}

Generated with cgit - Back to sebastiano.tronto.net