changeset 15795:dd52b68a488b

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.
author Bruno Haible <bruno@clisp.org>
date Wed, 28 Sep 2011 02:01:19 +0200
parents 13eba3ca057f
children 22a143e3638f
files 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
diffstat 9 files changed, 53 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/modules/fgetc-tests
+++ b/modules/fgetc-tests
@@ -6,6 +6,7 @@
 Depends-on:
 unistd
 fdopen
+msvc-inval
 
 configure.ac:
 
--- a/modules/fputc-tests
+++ b/modules/fputc-tests
@@ -6,6 +6,7 @@
 Depends-on:
 unistd
 fdopen
+msvc-inval
 
 configure.ac:
 
--- a/modules/fread-tests
+++ b/modules/fread-tests
@@ -6,6 +6,7 @@
 Depends-on:
 unistd
 fdopen
+msvc-inval
 
 configure.ac:
 
--- a/modules/fwrite-tests
+++ b/modules/fwrite-tests
@@ -6,6 +6,7 @@
 Depends-on:
 unistd
 fdopen
+msvc-inval
 
 configure.ac:
 
--- a/tests/test-fgetc.c
+++ b/tests/test-fgetc.c
@@ -26,6 +26,8 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "msvc-inval.h"
+
 #include "macros.h"
 
 int
@@ -33,6 +35,12 @@
 {
   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";
--- a/tests/test-fputc.c
+++ b/tests/test-fputc.c
@@ -26,6 +26,8 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "msvc-inval.h"
+
 #include "macros.h"
 
 int
@@ -33,6 +35,12 @@
 {
   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.  */
   {
--- a/tests/test-fread.c
+++ b/tests/test-fread.c
@@ -26,6 +26,8 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "msvc-inval.h"
+
 #include "macros.h"
 
 int
@@ -33,6 +35,12 @@
 {
   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";
--- a/tests/test-fwrite.c
+++ b/tests/test-fwrite.c
@@ -26,6 +26,8 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "msvc-inval.h"
+
 #include "macros.h"
 
 int
@@ -33,6 +35,12 @@
 {
   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.  */
   {