]> Savannah Git Hosting - gnulib.git/commitdiff
fputc, fwrite tests: Avoid test failure on MSVC.
authorBruno Haible <bruno@clisp.org>
Wed, 28 Sep 2011 00:01:19 +0000 (02:01 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 28 Sep 2011 00:04:11 +0000 (02:04 +0200)
* tests/test-fgetc.c: Include msvc-inval.h.
(main): Invoke gl_msvc_inval_ensure_handler.
* tests/test-fputc.c: Include msvc-inval.h.
(main): Invoke gl_msvc_inval_ensure_handler.
* tests/test-fread.c: Include msvc-inval.h.
(main): Invoke gl_msvc_inval_ensure_handler.
* tests/test-fwrite.c: Include msvc-inval.h.
(main): Invoke gl_msvc_inval_ensure_handler.
* modules/fgetc-tests (Depends-on): Add msvc-inval.
* modules/fputc-tests (Depends-on): Likewise.
* modules/fread-tests (Depends-on): Likewise.
* modules/fwrite-tests (Depends-on): Likewise.

ChangeLog
modules/fgetc-tests
modules/fputc-tests
modules/fread-tests
modules/fwrite-tests
tests/test-fgetc.c
tests/test-fputc.c
tests/test-fread.c
tests/test-fwrite.c

index c0ab9281f434b980cf7c1dc090f66a78a9faa506..db2e2b0283af6b9064710e3df21f1026cc6fdaec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,20 @@
-2011-09-26  Bruno Haible  <bruno@clisp.org>
+2011-09-27  Bruno Haible  <bruno@clisp.org>
+
+       fputc, fwrite tests: Avoid test failure on MSVC.
+       * tests/test-fgetc.c: Include msvc-inval.h.
+       (main): Invoke gl_msvc_inval_ensure_handler.
+       * tests/test-fputc.c: Include msvc-inval.h.
+       (main): Invoke gl_msvc_inval_ensure_handler.
+       * tests/test-fread.c: Include msvc-inval.h.
+       (main): Invoke gl_msvc_inval_ensure_handler.
+       * tests/test-fwrite.c: Include msvc-inval.h.
+       (main): Invoke gl_msvc_inval_ensure_handler.
+       * modules/fgetc-tests (Depends-on): Add msvc-inval.
+       * modules/fputc-tests (Depends-on): Likewise.
+       * modules/fread-tests (Depends-on): Likewise.
+       * modules/fwrite-tests (Depends-on): Likewise.
+
+2011-09-27  Bruno Haible  <bruno@clisp.org>
 
        raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
        * lib/signal.in.h (GNULIB_defined_signal_blocking): New macro.
index d812a6f73d701d78b3781511bca1e9a83ba49c8b..9e2934d97b13154e3cf8c3eff41330dfba6873a9 100644 (file)
@@ -6,6 +6,7 @@ tests/macros.h
 Depends-on:
 unistd
 fdopen
+msvc-inval
 
 configure.ac:
 
index 8f6c2da8926eecefff66c137e8c367ffbfe0005a..6d99adfcf6d161a4b1d6be4889c48e5c43958500 100644 (file)
@@ -6,6 +6,7 @@ tests/macros.h
 Depends-on:
 unistd
 fdopen
+msvc-inval
 
 configure.ac:
 
index bb521a46d205b416228f8be7a8adfdfeabb3538c..0423ffc297e95be589ff832b6f88b3a470b22556 100644 (file)
@@ -6,6 +6,7 @@ tests/macros.h
 Depends-on:
 unistd
 fdopen
+msvc-inval
 
 configure.ac:
 
index 56d507498c2ec330f79b6dedbaa72961d7311f88..1b7bf2f8be89e512fd497f17f6960c0c76984ad0 100644 (file)
@@ -6,6 +6,7 @@ tests/macros.h
 Depends-on:
 unistd
 fdopen
+msvc-inval
 
 configure.ac:
 
index 8e97e1df8b25d4a3b801d55ef8872ae6ebd529ba..4cc7c97320ab200136c32572999b802ec1fab18b 100644 (file)
@@ -26,6 +26,8 @@ SIGNATURE_CHECK (fgetc, int, (FILE *));
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "msvc-inval.h"
+
 #include "macros.h"
 
 int
@@ -33,6 +35,12 @@ main (int argc, char **argv)
 {
   const char *filename = "test-fgetc.txt";
 
+  /* We don't have an fread() function that installs an invalid parameter
+     handler so far.  So install that handler here, explicitly.  */
+#if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+  gl_msvc_inval_ensure_handler ();
+#endif
+
   /* Prepare a file.  */
   {
     const char text[] = "hello world";
index a8f5439bca23d81f159d443b277b8719c4848d96..6e009d85d238d800f3164e6b742ca0c6cd168034 100644 (file)
@@ -26,6 +26,8 @@ SIGNATURE_CHECK (fputc, int, (int, FILE *));
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "msvc-inval.h"
+
 #include "macros.h"
 
 int
@@ -33,6 +35,12 @@ main (int argc, char **argv)
 {
   const char *filename = "test-fputc.txt";
 
+  /* We don't have an fputc() function that installs an invalid parameter
+     handler so far.  So install that handler here, explicitly.  */
+#if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+  gl_msvc_inval_ensure_handler ();
+#endif
+
   /* Test that fputc() on an unbuffered stream sets errno if someone else
      closes the stream fd behind the back of stdio.  */
   {
index 0f77dbfce13f201e4b13ab5b333efe8101692543..a1d1ff7b366b4e85a8725fb392efe400bd29d9fd 100644 (file)
@@ -26,6 +26,8 @@ SIGNATURE_CHECK (fread, size_t, (void *, size_t, size_t, FILE *));
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "msvc-inval.h"
+
 #include "macros.h"
 
 int
@@ -33,6 +35,12 @@ main (int argc, char **argv)
 {
   const char *filename = "test-fread.txt";
 
+  /* We don't have an fread() function that installs an invalid parameter
+     handler so far.  So install that handler here, explicitly.  */
+#if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+  gl_msvc_inval_ensure_handler ();
+#endif
+
   /* Prepare a file.  */
   {
     const char text[] = "hello world";
index d5d47a12666da6d857c6d751363bfefefb64bc6d..f6699ebad54f9d40a24579b4f2134406c6365dff 100644 (file)
@@ -26,6 +26,8 @@ SIGNATURE_CHECK (fwrite, size_t, (const void *, size_t, size_t, FILE *));
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "msvc-inval.h"
+
 #include "macros.h"
 
 int
@@ -33,6 +35,12 @@ main (int argc, char **argv)
 {
   const char *filename = "test-fwrite.txt";
 
+  /* We don't have an fwrite() function that installs an invalid parameter
+     handler so far.  So install that handler here, explicitly.  */
+#if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+  gl_msvc_inval_ensure_handler ();
+#endif
+
   /* Test that fwrite() on an unbuffered stream sets errno if someone else
      closes the stream fd behind the back of stdio.  */
   {