diff tests/test-freading.c @ 8751:e66db74e11a7

Oops, fix details and comments of last patch.
author Bruno Haible <bruno@clisp.org>
date Sun, 29 Apr 2007 07:44:02 +0000 (2007-04-29)
parents 67a7b3fd6cf2
children 10d7922803f5
line wrap: on
line diff
--- a/tests/test-freading.c
+++ b/tests/test-freading.c
@@ -73,6 +73,7 @@
      freading is only deterministic after input or output, but this
      test case should be portable even on open, after reposition, and
      at EOF.  */
+  /* First a scenario with only fgetc, fseek, fputc.  */
   fp = fopen (TESTFILE, "r+");
   if (fp == NULL)
     goto skip;
@@ -91,7 +92,7 @@
   if (fseek (fp, 0, SEEK_CUR) != 0)
     goto skip;
   /* freading (fp) is undefined here, but fwriting (fp) is false.  */
-  if (fputc ('z', fp) != 'z')
+  if (fputc ('x', fp) != 'x')
     goto skip;
   ASSERT (!freading (fp));
   if (fseek (fp, 0, SEEK_END))
@@ -105,6 +106,7 @@
      freading is only deterministic after input or output, but this
      test case should be portable even on open, after reposition, and
      at EOF.  */
+  /* Here a scenario that includes fflush.  */
   fp = fopen (TESTFILE, "r+");
   if (fp == NULL)
     goto skip;
@@ -120,7 +122,7 @@
   ASSERT (freading (fp));
   fflush (fp);
   /* freading (fp) is undefined here, but fwriting (fp) is false.  */
-  if (fgetc (fp) != 'a')
+  if (fgetc (fp) != 'x')
     goto skip;
   ASSERT (freading (fp));
   /* This fseek call is necessary when switching from reading to writing.