Rename search_.h to search.in.h.
[gnulib.git] / tests / test-ftello.c
index f87783f..d66ea0c 100644 (file)
 #include <sys/types.h>
 
 int
-main ()
+main (int argc, char **argv)
 {
-  /* This test assumes stdin is seekable.  */
-  off_t pos = ftello (stdin);
-  return pos < 0;
+  /* Assume stdin is seekable iff argc > 1.  */
+  int expected = argc > 1 ? 0 : -1;
+  /* Exit with success only if ftell/ftello agree.  */
+  off_t pos1 = ftello (stdin);
+  long pos2 = ftell (stdin);
+  return ! (pos1 == pos2 && pos1 == expected);
 }