tests: More work on error handling

This commit is contained in:
Tibor Nagy
2019-02-24 00:46:26 +01:00
parent 0c539d6e4e
commit 2d027f0771
14 changed files with 126 additions and 52 deletions
+6 -4
View File
@@ -3,8 +3,10 @@
#include "test_helpers.h"
int main(void) {
freopen("stdio/stdio.in", "r", stdin);
char in[6];
fgets(in, 6, stdin);
printf("%s\n", in); // should print Hello
FILE *f = freopen("stdio/stdio.in", "r", stdin);
ERROR_IF(freopen, f, == NULL);
char in[6];
fgets(in, 6, stdin);
printf("%s\n", in); // should print Hello
}