Skip to content

Commit d884471

Browse files
committed
test:bool: improve printout
1 parent 8a57593 commit d884471

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

test/bool/main.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@
66

77
int main(void){
88

9-
if(logical_not(true)) {
10-
fprintf(stderr, "logical_not(true) should be false");
11-
return EXIT_FAILURE;
9+
bool b = logical_not(true);
10+
int c = 0;
11+
12+
if(b) {
13+
fprintf(stderr, "logical_not(true) should be false\n");
14+
c++;
15+
}
16+
17+
b = logical_not(false);
18+
19+
if (!b) {
20+
fprintf(stderr, "logical_not(false) should be true\n");
21+
c++;
1222
}
1323

14-
if (!logical_not(false)) {
15-
fprintf(stderr, "logical_not(false) should be true)");
24+
if(c) {
25+
fprintf(stderr, "ERROR: boolean-logical not\n");
1626
return EXIT_FAILURE;
1727
}
1828

0 commit comments

Comments
 (0)