]> Savannah Git Hosting - gnulib.git/commitdiff
tests: Adjust to recent SET_BINARY change
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 15 Feb 2017 23:33:17 +0000 (15:33 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 15 Feb 2017 23:33:36 +0000 (15:33 -0800)
* tests/test-binary-io.c (main):
* tests/test-binary-io.sh: Remove test for SET_BINARY.
* tests/test-closein.c, tests/test-fflush2.c, tests/test-ftell.c:
* tests/test-ftello.c, tests/test-nonblocking-pipe-child.c:
* tests/test-yesno.c: Use set_binary_mode, not SET_BINARY.

ChangeLog
tests/test-binary-io.c
tests/test-binary-io.sh
tests/test-closein.c
tests/test-fflush2.c
tests/test-ftell.c
tests/test-ftello.c
tests/test-nonblocking-pipe-child.c
tests/test-yesno.c

index 756858d85d8450c49da86b5fb0371f1f0e4d6aec..f7bccee8ca0fe2855fd295f8d16644bdaf2f16c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2017-02-15  Paul Eggert  <eggert@cs.ucla.edu>
 
+       tests: Adjust to recent SET_BINARY change
+       * tests/test-binary-io.c (main):
+       * tests/test-binary-io.sh: Remove test for SET_BINARY.
+       * tests/test-closein.c, tests/test-fflush2.c, tests/test-ftell.c:
+       * tests/test-ftello.c, tests/test-nonblocking-pipe-child.c:
+       * tests/test-yesno.c: Use set_binary_mode, not SET_BINARY.
+
        xsetmode: new module
        This is to fix a problem noted by Eric Blake.
        Code was using xfreopen to change files to binary mode, but this
index f53a1aee661bcbb1a8b23cb4fd7ab0ab3d990909..46ccce588e6cb8ca7d7c4904403ca516a966bc60 100644 (file)
@@ -55,12 +55,6 @@ main (int argc, char *argv[])
       fputs ("Hello\n", stdout);
       break;
 
-    case '2':
-      /* Test the SET_BINARY macro.  */
-      SET_BINARY (1);
-      fputs ("Hello\n", stdout);
-      break;
-
     default:
       break;
     }
index c4dd6e9295c2f40c7f41b91e95e531048a1455b6..3af53c6b8be333f087ea3c61fa77378ece42c823 100755 (executable)
@@ -6,8 +6,6 @@ trap 'rm -fr $tmpfiles' 1 2 3 15
 tmpfiles="$tmpfiles t-bin-out0.tmp t-bin-out1.tmp t-bin-out2.tmp"
 ./test-binary-io${EXEEXT} 1 > t-bin-out1.tmp || exit 1
 cmp t-bin-out0.tmp t-bin-out1.tmp > /dev/null || exit 1
-./test-binary-io${EXEEXT} 2 > t-bin-out2.tmp || exit 1
-cmp t-bin-out0.tmp t-bin-out2.tmp > /dev/null || exit 1
 
 rm -fr $tmpfiles
 
index 7e3ffa0fde81197e217368f06c6409ef4dba6ebf..bd2b33ee04e2e20898ebf275441262948bb8ac49 100644 (file)
@@ -38,7 +38,7 @@ main (int argc, char **argv)
 
   /* close_stdin currently relies on ftell, but mingw ftell is
      unreliable on text mode input.  */
-  SET_BINARY (0);
+  set_binary_mode (0, O_BINARY);
 
   if (argc > 2)
     close (0);
index 2d8d33a080eaa95622a91f095ac0d216b66201bf..4d1237bee2625e39a9195dc22be1d76cc3a61c9f 100644 (file)
@@ -28,7 +28,7 @@ main (int argc, char **argv)
 
   /* Avoid the well-known bugs of fflush() on streams in O_TEXT mode
      on native Windows platforms.  */
-  SET_BINARY (0);
+  set_binary_mode (0, O_BINARY);
 
   if (argc > 1)
     switch (argv[1][0])
index 7df08fd4a56e0a4fa1033aa801bbc10341aaf54e..33077023c7b9a475d19bdd56b311103dc1cd80d0 100644 (file)
@@ -45,7 +45,7 @@ main (int argc, char **argv)
     }
 
   /* mingw ftell is unreliable on text mode input.  */
-  SET_BINARY (0);
+  set_binary_mode (0, O_BINARY);
 
   /* Simple tests.  */
   ASSERT (ftell (stdin) == 0);
index 9ea92400b8d003be944bbc89a51575d1a973847b..1e9f40020460766fbe927a190c79fdb80a6f02c3 100644 (file)
@@ -46,7 +46,7 @@ main (int argc, char **argv _GL_UNUSED)
     }
 
   /* mingw ftell is unreliable on text mode input.  */
-  SET_BINARY (0);
+  set_binary_mode (0, O_BINARY);
 
   /* Simple tests.  For each test, make sure ftell and ftello agree.  */
   ASSERT (ftell (stdin) == 0);
index c96523129137bede660aa86e795c2e36d7ddd5ac..421bfc97fd472a22ab8f46f1a77293bfb3132d1d 100644 (file)
@@ -42,7 +42,7 @@ main (int argc, char *argv[])
   /* STDIN_FILENO was created as binary in the parent process.  But since an
      fd's mode is stored in the process, not in the kernel, on native Windows
      we need to set it as binary in the child process again.  */
-  SET_BINARY (STDIN_FILENO);
+  set_binary_mode (STDIN_FILENO, O_BINARY);
 
   main_reader_loop (test, PIPE_DATA_BLOCK_SIZE, STDIN_FILENO);
 
index 417d007e05408f302c5f72bdfe450b1dc8989dbd..fdfd3b5bdbee64ae318a5d9e1085222c55b14663 100644 (file)
@@ -47,7 +47,7 @@ main (int argc, char **argv)
      position and the last filled buffer end position.  (I.e. the repositioning
      from the end-of-buffer to the expected position does not work if the input
      file contains end-of-line markers in Unix convention.)  */
-  SET_BINARY (0);
+  set_binary_mode (0, O_BINARY);
 
   if (1 < argc)
     i = atoi (argv[1]);