summaryrefslogtreecommitdiff
path: root/libio/tst-fopenloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/tst-fopenloc.c')
-rw-r--r--libio/tst-fopenloc.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/libio/tst-fopenloc.c b/libio/tst-fopenloc.c
index 59f63d27fc..797540da04 100644
--- a/libio/tst-fopenloc.c
+++ b/libio/tst-fopenloc.c
@@ -1,5 +1,5 @@
/* Test for ,ccs= handling in fopen.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 2001.
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <locale.h>
@@ -25,14 +25,11 @@
#include <string.h>
#include <wchar.h>
#include <sys/resource.h>
+#include <support/support.h>
+#include <support/xstdio.h>
static const char inputfile[] = "../iconvdata/testdata/ISO-8859-1";
-static int do_test(void);
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
-
static int
do_bz17916 (void)
{
@@ -66,14 +63,9 @@ do_test (void)
mtrace ();
- setlocale (LC_ALL, "de_DE.UTF-8");
+ xsetlocale (LC_ALL, "de_DE.UTF-8");
- fp = fopen (inputfile, "r,ccs=ISO-8859-1");
- if (fp == NULL)
- {
- printf ("cannot open \"%s\": %s\n", inputfile, strerror (errno));
- exit (1);
- }
+ fp = xfopen (inputfile, "r,ccs=ISO-8859-1");
while (! feof_unlocked (fp))
{
@@ -85,7 +77,9 @@ do_test (void)
fputws (buf, stdout);
}
- fclose (fp);
+ xfclose (fp);
return do_bz17916 ();
}
+
+#include <support/test-driver.c>