diff options
author | Bruno Haible <bruno@clisp.org> | 2007-04-29 08:38:22 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2007-04-29 08:38:22 +0000 |
commit | 17fecfc4d6363d6d4127a97b42f0acbbcbd60a44 (patch) | |
tree | 66bbafcd8e5dd2f609bc027715f0113ffa9e51df /tests | |
parent | 2efbc429c545367a904e03e6f62b271ce48b70fd (diff) | |
download | gnulib-17fecfc4d6363d6d4127a97b42f0acbbcbd60a44.tar.gz |
freading has an undefined value after repositioning a read-write stream.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-freading.c | 8 | ||||
-rw-r--r-- | tests/test-fwriting.c | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/tests/test-freading.c b/tests/test-freading.c index 3d69c404ea..b2f6fc7b07 100644 --- a/tests/test-freading.c +++ b/tests/test-freading.c @@ -97,7 +97,9 @@ main () ASSERT (!freading (fp)); if (fseek (fp, 0, SEEK_END)) goto skip; - ASSERT (!freading (fp)); + /* freading (fp) is undefined here, because on some implementations (e.g. + glibc) fseek causes a buffer to be read. + fwriting (fp) is undefined as well. */ if (fclose (fp)) goto skip; @@ -135,7 +137,9 @@ main () ASSERT (!freading (fp)); if (fseek (fp, 0, SEEK_END)) goto skip; - ASSERT (!freading (fp)); + /* freading (fp) is undefined here, because on some implementations (e.g. + glibc) fseek causes a buffer to be read. + fwriting (fp) is undefined as well. */ if (fclose (fp)) goto skip; diff --git a/tests/test-fwriting.c b/tests/test-fwriting.c index 690a35f306..0f97df5ccf 100644 --- a/tests/test-fwriting.c +++ b/tests/test-fwriting.c @@ -97,7 +97,9 @@ main () ASSERT (fwriting (fp)); if (fseek (fp, 0, SEEK_END)) goto skip; - /* fwriting (fp) is undefined here, but freading (fp) is false. */ + /* freading (fp) is undefined here, because on some implementations (e.g. + glibc) fseek causes a buffer to be read. + fwriting (fp) is undefined as well. */ if (fclose (fp)) goto skip; @@ -135,7 +137,9 @@ main () ASSERT (fwriting (fp)); if (fseek (fp, 0, SEEK_END)) goto skip; - /* fwriting (fp) is undefined here, but freading (fp) is false. */ + /* freading (fp) is undefined here, because on some implementations (e.g. + glibc) fseek causes a buffer to be read. + fwriting (fp) is undefined as well. */ if (fclose (fp)) goto skip; |