projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename search_.h to search.in.h.
[gnulib.git]
/
tests
/
test-ftello.c
diff --git
a/tests/test-ftello.c
b/tests/test-ftello.c
index
f87783f
..
d66ea0c
100644
(file)
--- a/
tests/test-ftello.c
+++ b/
tests/test-ftello.c
@@
-25,9
+25,12
@@
#include <sys/types.h>
int
#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);
}
}