diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-05-29 14:15:57 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-05-29 14:15:57 -0700 |
commit | b94433a6eade7332634cfc246ea8fc21fbbac1ac (patch) | |
tree | e7e4e7b76571c4ef767759102f221c9d627cefd6 | |
parent | b2e680a109d2a8fbc84e58a2c31b619671a78e8c (diff) |
show an error in tests/hello_world_file.cpp if we can't open the file; closes #2389
-rw-r--r-- | tests/hello_world_file.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/hello_world_file.cpp b/tests/hello_world_file.cpp index 71fb953b..97ea395e 100644 --- a/tests/hello_world_file.cpp +++ b/tests/hello_world_file.cpp @@ -1,6 +1,10 @@ #include <stdio.h> int main() { FILE *file = fopen("tests/hello_world_file.txt", "rb"); + if (!file) { + printf("cannot open file\n"); + return 1; + } while (!feof(file)) { char c = fgetc(file); if (c != EOF) { |