aboutsummaryrefslogtreecommitdiff
path: root/test/01_io/io_tests.c
blob: 42ef9b84574dee004eb6d3da25af302d61eac38a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

#include "../../src/cube.h"

#define STRLENMAX 10000

int main() {
	char *c, str[STRLENMAX];
	cube_t cube;

	for (c = str; (*c = getchar()) != EOF; c++) ;
	*c = '\0';

	cube = readcube(str);

	if (iserror(cube)) {
		printf("Error reading cube\n");
	} else if (!isconsistent(cube)) {
		printf("Cube is inconsistent\n");
	} else {
		writecube(cube, str);
		printf("%s\n", str);
	}

	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net