From: Bruno Haible Date: Wed, 28 Sep 2011 00:01:19 +0000 (+0200) Subject: fputc, fwrite tests: Avoid test failure on MSVC. X-Git-Tag: v0.1~1731 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=9e30dc1496f3b844fc6b309373cfc5d255b3dce5;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index c0ab9281f..db2e2b028 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,20 @@ -2011-09-26 Bruno Haible +2011-09-27 Bruno Haible + + 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 raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'. * lib/signal.in.h (GNULIB_defined_signal_blocking): New macro. diff --git a/modules/fgetc-tests b/modules/fgetc-tests index d812a6f73..9e2934d97 100644 --- a/modules/fgetc-tests +++ b/modules/fgetc-tests @@ -6,6 +6,7 @@ tests/macros.h Depends-on: unistd fdopen +msvc-inval configure.ac: diff --git a/modules/fputc-tests b/modules/fputc-tests index 8f6c2da89..6d99adfcf 100644 --- a/modules/fputc-tests +++ b/modules/fputc-tests @@ -6,6 +6,7 @@ tests/macros.h Depends-on: unistd fdopen +msvc-inval configure.ac: diff --git a/modules/fread-tests b/modules/fread-tests index bb521a46d..0423ffc29 100644 --- a/modules/fread-tests +++ b/modules/fread-tests @@ -6,6 +6,7 @@ tests/macros.h Depends-on: unistd fdopen +msvc-inval configure.ac: diff --git a/modules/fwrite-tests b/modules/fwrite-tests index 56d507498..1b7bf2f8b 100644 --- a/modules/fwrite-tests +++ b/modules/fwrite-tests @@ -6,6 +6,7 @@ tests/macros.h Depends-on: unistd fdopen +msvc-inval configure.ac: diff --git a/tests/test-fgetc.c b/tests/test-fgetc.c index 8e97e1df8..4cc7c9732 100644 --- a/tests/test-fgetc.c +++ b/tests/test-fgetc.c @@ -26,6 +26,8 @@ SIGNATURE_CHECK (fgetc, int, (FILE *)); #include #include +#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"; diff --git a/tests/test-fputc.c b/tests/test-fputc.c index a8f5439bc..6e009d85d 100644 --- a/tests/test-fputc.c +++ b/tests/test-fputc.c @@ -26,6 +26,8 @@ SIGNATURE_CHECK (fputc, int, (int, FILE *)); #include #include +#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. */ { diff --git a/tests/test-fread.c b/tests/test-fread.c index 0f77dbfce..a1d1ff7b3 100644 --- a/tests/test-fread.c +++ b/tests/test-fread.c @@ -26,6 +26,8 @@ SIGNATURE_CHECK (fread, size_t, (void *, size_t, size_t, FILE *)); #include #include +#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"; diff --git a/tests/test-fwrite.c b/tests/test-fwrite.c index d5d47a126..f6699ebad 100644 --- a/tests/test-fwrite.c +++ b/tests/test-fwrite.c @@ -26,6 +26,8 @@ SIGNATURE_CHECK (fwrite, size_t, (const void *, size_t, size_t, FILE *)); #include #include +#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. */ {