6 main(int argc
, char *argv
[])
13 i
= mbstowcs(w
, "bar", 4);
14 if (!(i
== 3 && w
[1] == 'a')) {
15 puts("mbstowcs FAILED!");
19 mbstowcs(w
, "blah", 5);
20 i
= wcstombs(c
, w
, 10);
22 puts("wcstombs FAILED!");
26 if (mblen("foobar", 7) != 1) {
27 puts("mblen 1 FAILED!");
31 if (mblen("", 1) != 0) {
32 puts("mblen 2 FAILED!");
42 if ((r
= mbtowc(&wc
, &c
, MB_CUR_MAX
)) <= 0) {
43 printf("conversion to wide failed, result: %d\n", r
);
46 printf("wide value: 0x%04lx\n", (unsigned long) wc
);
48 if ((r
= wctomb(mbc
, wc
)) <= 0) {
49 printf("conversion to multibyte failed, result: %d\n", r
);
56 puts(lose
? "Test FAILED!" : "Test succeeded.");