Skip to content

Commit 15834cf

Browse files
committed
move bfun tests in main to separate function
1 parent 29215af commit 15834cf

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

main.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
#include "bfun.h"
22

3+
void test_bfun(char* filename);
4+
35
int main(int argc, char* argv[]) {
6+
#ifdef TEST_BFUN
47
char* filename;
58
if (argc > 1) filename = argv[1];
6-
else filename = "foo";
9+
else {
10+
printf("Please specify a .pcn file to complement!\n");
11+
exit(2);
12+
}
13+
test_bfun(filename);
14+
#endif
15+
}
16+
17+
void test_bfun(char* filename) {
718
char* out_file = "out.txt";
819

920
int vs = 4;
1021

11-
/*
12-
cube* plain = new_cube(vs);
13-
cube* one_false = new_cube(vs);
14-
set_false(one_false, 1);
15-
*/
1622
cube* one_true = new_cube(vs);
1723
set_true(one_true, 1);
1824
cube* one_each = new_cube(vs);
@@ -34,12 +40,6 @@ int main(int argc, char* argv[]) {
3440

3541
del_bfun(test1);
3642
del_bfun(result);
37-
/*
38-
del_cube(plain, vs);
39-
del_cube(one_true, vs);
40-
del_cube(one_false, vs);
41-
del_cube(one_each, vs);
42-
*/
4343

4444
bfun* b = read_file(filename);
4545
bfun* cb = complement(b);
@@ -54,4 +54,3 @@ int main(int argc, char* argv[]) {
5454
del_bfun(b);
5555
del_bfun(cb);
5656
}
57-

0 commit comments

Comments
 (0)