1 /* Test program for bug in wide streams. */
6 static void do_prepare (void);
7 #define PREPARE(argc, argv) do_prepare ()
8 static int do_test (void);
9 #define TEST_FUNCTION do_test ()
10 #include <test-skeleton.c>
12 static char *temp_file;
17 int fd = create_temp_file ("bug-ungetc.", &temp_file);
20 printf ("cannot create temporary file: %m\n");
30 FILE *f = fopen (temp_file, "r+");
34 printf ("fopen: %m\n");
39 //#define fwscanf fscanf
40 //#define fwprintf fprintf
43 if (fwscanf (f, L_("%d!"), &i) != 1)
45 printf ("fwscanf failed\n");
52 printf ("rewind: %m\n");
56 if (fputws (L_("1!"), f) == EOF)
58 printf ("fputws: %m\n");
64 printf ("fflush: %m\n");
70 printf ("fclose: %m\n");
74 puts ("Test succeeded.");