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