X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-fputc.c;h=fd92ae8abcb629c0f97584a97e02f6c5930800e2;hb=573dad2ce496fa87dac2e79f37bae62e0be1d2c6;hp=a8b09709014434cad5edaa395313accc12c9c908;hpb=806fe1c26c7b11439bd7645e4e014c72c33c5b10;p=gnulib.git diff --git a/tests/test-fputc.c b/tests/test-fputc.c index a8b097090..fd92ae8ab 100644 --- a/tests/test-fputc.c +++ b/tests/test-fputc.c @@ -1,5 +1,5 @@ /* Test of fputc() function. - Copyright (C) 2011 Free Software Foundation, Inc. + Copyright (C) 2011-2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ #include @@ -26,6 +25,8 @@ SIGNATURE_CHECK (fputc, int, (int, FILE *)); #include #include +#include "msvc-inval.h" + #include "macros.h" int @@ -33,6 +34,13 @@ 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 HAVE_MSVC_INVALID_PARAMETER_HANDLER \ + && 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. */ { @@ -43,6 +51,7 @@ main (int argc, char **argv) errno = 0; ASSERT (fputc ('x', fp) == EOF); ASSERT (errno == EBADF); + ASSERT (ferror (fp)); fclose (fp); } @@ -56,6 +65,7 @@ main (int argc, char **argv) errno = 0; ASSERT (fputc ('x', fp) == EOF); ASSERT (errno == EBADF); + ASSERT (ferror (fp)); fclose (fp); } } @@ -67,6 +77,7 @@ main (int argc, char **argv) errno = 0; ASSERT (fputc ('x', fp) == EOF); ASSERT (errno == EBADF); + ASSERT (ferror (fp)); fclose (fp); } }