aboutsummaryrefslogtreecommitdiff
path: root/tests/files.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/files.cpp')
-rw-r--r--tests/files.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/files.cpp b/tests/files.cpp
index d692ce67..e1a38421 100644
--- a/tests/files.cpp
+++ b/tests/files.cpp
@@ -28,6 +28,18 @@ int main()
fclose (file);
free (buffer);
+ // Do it again, with a loop on feof
+
+ printf("loop: ");
+ file = fopen("somefile.binary", "rb");
+ assert(file);
+ while (!feof(file)) {
+ char c = fgetc(file);
+ if (c != EOF) printf("%d ", c);
+ }
+ fclose (file);
+ printf("\n");
+
// Standard streams
printf("input:%s\n", gets((char*)malloc(1024)));