bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] test-fclose: avoid over-specification (leading to abort)


From: Jim Meyering
Subject: [PATCH] test-fclose: avoid over-specification (leading to abort)
Date: Thu, 12 May 2011 16:52:00 +0200

Hi Eric,

This test would fail for me when I made iwhd use the latest from gnulib:

    FAIL: test-fclose (exit: 134)
    =============================
    test-fclose.c:77: assertion failed

It looks pretty obvious, but I'll wait for your ACK, just in case.

>From 05c18b2e33ce1130287b87fb81d22c0ebebd6d78 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 12 May 2011 16:49:39 +0200
Subject: [PATCH] test-fclose: avoid over-specification (leading to abort)

* tests/test-fclose.c (main): Do not require that fgetc advance
the file descriptor's position by only one.  Due to buffering,
it may well advance it to the end of file, or 12 in this case.
---
 ChangeLog           |    7 +++++++
 tests/test-fclose.c |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 34ccc10..db88ec3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-12  Jim Meyering  <address@hidden>
+
+       test-fclose: avoid over-specification (leading to abort)
+       * tests/test-fclose.c (main): Do not require that fgetc advance
+       the file descriptor's position by only one.  Due to buffering,
+       it may well advance it to the end of file, or 12 in this case.
+
 2011-05-11  Eric Blake  <address@hidden>

        test-fflush: silence compiler warning
diff --git a/tests/test-fclose.c b/tests/test-fclose.c
index a11eca9..887b559 100644
--- a/tests/test-fclose.c
+++ b/tests/test-fclose.c
@@ -72,7 +72,7 @@ main (int argc, char **argv)
   errno = 0;
   ASSERT (lseek (fd2, 0, SEEK_CUR) == -1);
   ASSERT (errno == EBADF);
-  ASSERT (lseek (fd, 0, SEEK_CUR) == 3);
+  ASSERT (3 <= lseek (fd, 0, SEEK_CUR));

   /* Test that fclose() sets errno if someone else closes the stream
      fd behind the back of stdio.  */
--
1.7.5.1.398.g86d1d



reply via email to

[Prev in Thread] Current Thread [Next in Thread]