5 main (int argc
, char *argv
[])
12 i
= mbstowcs (w
, "bar", 4);
13 if (!(i
== 3 && w
[1] == 'a'))
15 puts ("mbstowcs FAILED!");
19 mbstowcs (w
, "blah", 5);
20 i
= wcstombs (c
, w
, 10);
23 puts ("wcstombs FAILED!");
27 if (mblen ("foobar", 7) != 1)
29 puts ("mblen 1 FAILED!");
33 if (mblen ("", 1) != 0)
35 puts ("mblen 2 FAILED!");
45 if ((r
= mbtowc (&wc
, &c
, MB_CUR_MAX
)) <= 0)
47 printf ("conversion to wide failed, result: %d\n", r
);
52 printf ("wide value: 0x%04lx\n", (unsigned long) wc
);
54 if ((r
= wctomb (mbc
, wc
)) <= 0)
56 printf ("conversion to multibyte failed, result: %d\n", r
);
63 puts (lose
? "Test FAILED!" : "Test succeeded.");