2.9
[glibc/nacl-glibc.git] / localedata / tests-mbwc / dat_wcrtomb.c
blob8500f684430178ae09c58fd7dfe39aaa6cafb19c
1 /*
2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
4 * FILE: dat_wcrtomb.c
6 * WCRTOMB: intwcrtomb (char *s, wchar_t wc, mbstate_t *ps);
8 */
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, "" },
26 /* #04 : */
27 { /*input.*/ { 0, 0x0041, 0,0 },
28 /*expect*/ { 0, 1,1, "" },
30 /* #05 : */
31 { /*input.*/ { 0, 0x0092, 0,0 },
32 /*expect*/ { 0, 1,1, "" },
34 { .is_last = 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 */
49 /* <WAIVER> x 2 */
50 { /*input.*/ { 1, 0x0092, 0,0 }, /* assume ascii */
51 /*expect*/ { EILSEQ,1,-1, "" },
53 /* #04 : */
54 { /*input.*/ { 0, 0x0041, 0,0 },
55 /*expect*/ { 0, 1,1, "" },
57 /* #05 : */
58 { /*input.*/ { 0, 0x0092, 0,0 },
59 /*expect*/ { 0, 1,1, "" },
61 { .is_last = 1 }
65 { Twcrtomb, TST_LOC_eucJP },
67 /* #01 : normal case */
68 { /*input.*/ { 1, 0x3042, 0,0 },
69 /*expect*/ { 0, 1,2, "\244\242" },
71 /* #02 : normal case */
72 { /*input.*/ { 1, 0x3044, 0,0 },
73 /*expect*/ { 0, 1,2, "\244\244" },
75 /* #03 : normal case */
76 { /*input.*/ { 1, 0x008E, 0,0 },
77 /*expect*/ { EILSEQ, 1,-1, "" },
79 /* #04 : */
80 { /*input.*/ { 0, 0x3042, 0,0 },
81 /*expect*/ { 0, 0,0, "" },
83 /* #05 : */
84 { /*input.*/ { 0, 0x008E, 0,0 },
85 /*expect*/ { 0, 0,0, "" },
87 { .is_last = 1 }
91 { Twcrtomb, TST_LOC_end }