/* 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
#include <fcntl.h>
#include <unistd.h>
+#include "msvc-inval.h"
+
#include "macros.h"
int
{
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. */
{
errno = 0;
ASSERT (fputc ('x', fp) == EOF);
ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
fclose (fp);
}
errno = 0;
ASSERT (fputc ('x', fp) == EOF);
ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
fclose (fp);
}
}
errno = 0;
ASSERT (fputc ('x', fp) == EOF);
ASSERT (errno == EBADF);
+ ASSERT (ferror (fp));
fclose (fp);
}
}