10 if (setlocale (LC_ALL
, "de_DE.UTF-8") == NULL
)
12 puts ("setlocale failed");
16 FILE *fp
= tmpfile ();
19 puts ("tmpfile failed");
23 if (fputws (L
"hello", fp
) == EOF
)
25 puts ("fputws failed");
33 for (cp
= L
"hello", cnt
= 1; *cp
!= L
'\0'; ++cp
, ++cnt
)
35 wint_t wc
= fgetwc (fp
);
36 if (wc
!= (wint_t) *cp
)
38 printf ("fgetwc failed: got L'%lc', expected L'%lc'\n", wc
, *cp
);
41 off_t o
= ftello (fp
);
44 printf ("ftello failed: got %lu, expected %u\n",
45 (unsigned long int) o
, cnt
);
48 printf ("round %u OK\n", cnt
);
56 #define TEST_FUNCTION do_test ()
57 #include "../test-skeleton.c"