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",
42 off_t o = ftello (fp);
45 printf ("ftello failed: got %lu, expected %u\n",
46 (unsigned long int) o, cnt);
49 printf ("round %u OK\n", cnt);
57 #define TEST_FUNCTION do_test ()
58 #include "../test-skeleton.c"