X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-fputc.c;h=924c2225f2c6fc7edb2bd8853919eb1a963439e0;hb=b8c5e24996c9626f03890cd986fc1fb7b17fa610;hp=a8b09709014434cad5edaa395313accc12c9c908;hpb=806fe1c26c7b11439bd7645e4e014c72c33c5b10;p=gnulib.git diff --git a/tests/test-fputc.c b/tests/test-fputc.c index a8b097090..924c2225f 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 @@ -26,6 +26,8 @@ SIGNATURE_CHECK (fputc, int, (int, FILE *)); #include #include +#include "msvc-inval.h" + #include "macros.h" int @@ -33,6 +35,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 +52,7 @@ main (int argc, char **argv) errno = 0; ASSERT (fputc ('x', fp) == EOF); ASSERT (errno == EBADF); + ASSERT (ferror (fp)); fclose (fp); } @@ -56,6 +66,7 @@ main (int argc, char **argv) errno = 0; ASSERT (fputc ('x', fp) == EOF); ASSERT (errno == EBADF); + ASSERT (ferror (fp)); fclose (fp); } } @@ -67,6 +78,7 @@ main (int argc, char **argv) errno = 0; ASSERT (fputc ('x', fp) == EOF); ASSERT (errno == EBADF); + ASSERT (ferror (fp)); fclose (fp); } }