aboutsummaryrefslogtreecommitdiff
path: root/test/081_getcube/getcube_tests.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-07-05 22:16:44 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-07-05 22:28:10 +0200
commit66c1c11ec13d362ddfb1b5f6abe8127969c0ad29 (patch)
tree569e7d4e70d63202c05475b0996038b90da168c5 /test/081_getcube/getcube_tests.c
parent5fb58d73581256c64d47250c5544d1cbf22f79c3 (diff)
downloadnissy-core-66c1c11ec13d362ddfb1b5f6abe8127969c0ad29.tar.gz
nissy-core-66c1c11ec13d362ddfb1b5f6abe8127969c0ad29.zip
Finished getcube
Diffstat (limited to 'test/081_getcube/getcube_tests.c')
-rw-r--r--test/081_getcube/getcube_tests.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/081_getcube/getcube_tests.c b/test/081_getcube/getcube_tests.c
new file mode 100644
index 0000000..7eb59dc
--- /dev/null
+++ b/test/081_getcube/getcube_tests.c
@@ -0,0 +1,29 @@
1#include "../test.h"
2
3cube_t getcube(int64_t, int64_t, int64_t, int64_t);
4
5void run(void) {
6 char str[STRLENMAX];
7 cube_t cube;
8 int64_t ep, eo, cp, co;
9
10 fgets(str, STRLENMAX, stdin);
11 ep = atoll(str);
12 fgets(str, STRLENMAX, stdin);
13 eo = atoll(str);
14 fgets(str, STRLENMAX, stdin);
15 cp = atoll(str);
16 fgets(str, STRLENMAX, stdin);
17 co = atoll(str);
18
19 cube = getcube(ep, eo, cp, co);
20
21 if (iserror(cube)) {
22 printf("Error cube\n");
23 } else if (!isconsistent(cube)) {
24 printf("Inconsistent cube\n");
25 } else {
26 writecube("H48", cube, str);
27 printf("%s\n", str);
28 }
29}

Generated with cgit - Back to sebastiano.tronto.net