On BSD implementations, when we call lseek(), we must also update or disable
[pspp] / tests / test-fflush.c
index 79fa051263d7d8853451a26afd4268b4925b3309..88789f30ac1acbe110a67626c4e45ff79ac64d01 100755 (executable)
@@ -74,6 +74,13 @@ main (int argc, char *argv[])
       unlink ("test-fflush.txt");
       return 1;
     }
+  if (ftell (f) != 5)
+    {
+      fputs ("ftell result is wrong after fseek.\n", stderr);
+      fclose (f);
+      unlink ("test-fflush.txt");
+      return 1;
+    }
   /* Check that file reading resumes at correct location.  */
   if (fgetc (f) != '6')
     {
@@ -106,6 +113,13 @@ main (int argc, char *argv[])
       unlink ("test-fflush.txt");
       return 1;
     }
+  if (ftell (f) != 6)
+    {
+      fputs ("ftell result is wrong after fseek.\n", stderr);
+      fclose (f);
+      unlink ("test-fflush.txt");
+      return 1;
+    }
   /* Check that file reading resumes at correct location.  */
   if (fgetc (f) != '7')
     {