2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
6 * WCRTOMB: intwcrtomb (char *s, wchar_t wc, mbstate_t *ps);
10 TST_WCRTOMB tst_wcrtomb_loc [] = {
12 { Twcrtomb, TST_LOC_de },
14 /* #01 : normal case */
15 { /*input.*/ { 1, 0x00FC, 0,0 },
16 /*expect*/ { 0, 1,1, "ü" },
18 /* #02 : normal case */
19 { /*input.*/ { 1, 0x00D6, 0,0 },
20 /*expect*/ { 0, 1,1, "Ö" },
22 /* #03 : error case */
23 { /*input.*/ { 1, 0xFFA1, 0,0 },
24 /*expect*/ { EILSEQ,1,-1, "" },
27 { /*input.*/ { 0, 0x0041, 0,0 },
28 /*expect*/ { 0, 1,1, "" },
31 { /*input.*/ { 0, 0x0092, 0,0 },
32 /*expect*/ { 0, 1,1, "" },
38 { Twcrtomb, TST_LOC_enUS },
40 /* #01 : normal case */
41 { /*input.*/ { 1, 0x0041, 0,0 },
42 /*expect*/ { 0, 1,1, "A" },
44 /* #02 : normal case */
45 { /*input.*/ { 1, 0x0042, 0,0 },
46 /*expect*/ { 0, 1,1, "B" },
48 /* #03 : error case */
50 { /*input.*/ { 1, 0x0092, 0,0 }, /* assume ascii */
51 /*expect*/ { EILSEQ,1,-1, "" },
54 { /*input.*/ { 0, 0x0041, 0,0 },
55 /*expect*/ { 0, 1,1, "" },
58 { /*input.*/ { 0, 0x0092, 0,0 },
59 /*expect*/ { 0, 1,1, "" },
66 { Twcrtomb, TST_LOC_eucJP },
68 /* #01 : normal case */
69 { /*input.*/ { 1, 0x3042, 0,0 },
70 /*expect*/ { 0, 1,2, "\244\242" },
72 /* #02 : normal case */
73 { /*input.*/ { 1, 0x3044, 0,0 },
74 /*expect*/ { 0, 1,2, "\244\244" },
76 /* #03 : normal case */
77 { /*input.*/ { 1, 0x008E, 0,0 },
78 /*expect*/ { EILSEQ, 1,-1, "" },
81 { /*input.*/ { 0, 0x3042, 0,0 },
82 /*expect*/ { 0, 0,0, "" },
85 { /*input.*/ { 0, 0x008E, 0,0 },
86 /*expect*/ { 0, 0,0, "" },
93 { Twcrtomb, TST_LOC_ja_UTF8 },
95 /* #01 : normal case */
96 { /*input.*/ { 1, 0x3042, 0,0 },
97 /*expect*/ { 0, 1,3, "\343\201\202" },
99 /* #02 : normal case */
100 { /*input.*/ { 1, 0x3044, 0,0 },
101 /*expect*/ { 0, 1,3, "\343\201\204" },
103 /* #03 : normal case */
104 { /*input.*/ { 1, 0x008E, 0,0 },
105 /*expect*/ { EILSEQ, 1,-1, "" },
108 { /*input.*/ { 0, 0x3042, 0,0 },
109 /*expect*/ { 0, 0,0, "" },
112 { /*input.*/ { 0, 0x008E, 0,0 },
113 /*expect*/ { 0, 0,0, "" },
120 { Twcrtomb, TST_LOC_end }