1 | /* |
2 | * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY |
3 | * |
4 | * FILE: dat_wcrtomb.c |
5 | * |
6 | * WCRTOMB: intwcrtomb (char *s, wchar_t wc, mbstate_t *ps); |
7 | * |
8 | */ |
9 | |
10 | TST_WCRTOMB tst_wcrtomb_loc [] = { |
11 | { |
12 | { Twcrtomb, TST_LOC_de }, |
13 | { |
14 | /* #01 : normal case */ |
15 | { /*input.*/ { 1, 0x00FC, 0,0 }, |
16 | /*expect*/ { 0, 1,1, "ü" }, |
17 | }, |
18 | /* #02 : normal case */ |
19 | { /*input.*/ { 1, 0x00D6, 0,0 }, |
20 | /*expect*/ { 0, 1,1, "Ö" }, |
21 | }, |
22 | /* #03 : error case */ |
23 | { /*input.*/ { 1, 0xFFA1, 0,0 }, |
24 | /*expect*/ { EILSEQ,1,-1, "" }, |
25 | }, |
26 | /* #04 : */ |
27 | { /*input.*/ { 0, 0x0041, 0,0 }, |
28 | /*expect*/ { 0, 1,1, "" }, |
29 | }, |
30 | /* #05 : */ |
31 | { /*input.*/ { 0, 0x0092, 0,0 }, |
32 | /*expect*/ { 0, 1,1, "" }, |
33 | }, |
34 | { .is_last = 1 } |
35 | } |
36 | }, |
37 | { |
38 | { Twcrtomb, TST_LOC_enUS }, |
39 | { |
40 | /* #01 : normal case */ |
41 | { /*input.*/ { 1, 0x0041, 0,0 }, |
42 | /*expect*/ { 0, 1,1, "A" }, |
43 | }, |
44 | /* #02 : normal case */ |
45 | { /*input.*/ { 1, 0x0042, 0,0 }, |
46 | /*expect*/ { 0, 1,1, "B" }, |
47 | }, |
48 | /* #03 : error case */ |
49 | /* <WAIVER> x 2 */ |
50 | { /*input.*/ { 1, 0x0092, 0,0 }, /* assume ascii */ |
51 | /*expect*/ { EILSEQ,1,-1, "" }, |
52 | }, |
53 | /* #04 : */ |
54 | { /*input.*/ { 0, 0x0041, 0,0 }, |
55 | /*expect*/ { 0, 1,1, "" }, |
56 | }, |
57 | /* #05 : */ |
58 | { /*input.*/ { 0, 0x0092, 0,0 }, |
59 | /*expect*/ { 0, 1,1, "" }, |
60 | }, |
61 | { .is_last = 1 } |
62 | } |
63 | }, |
64 | { |
65 | { Twcrtomb, TST_LOC_eucJP }, |
66 | { |
67 | /* #01 : normal case */ |
68 | { /*input.*/ { 1, 0x3042, 0,0 }, |
69 | /*expect*/ { 0, 1,2, "\244\242" }, |
70 | }, |
71 | /* #02 : normal case */ |
72 | { /*input.*/ { 1, 0x3044, 0,0 }, |
73 | /*expect*/ { 0, 1,2, "\244\244" }, |
74 | }, |
75 | /* #03 : normal case */ |
76 | { /*input.*/ { 1, 0x008E, 0,0 }, |
77 | /*expect*/ { EILSEQ, 1,-1, "" }, |
78 | }, |
79 | /* #04 : */ |
80 | { /*input.*/ { 0, 0x3042, 0,0 }, |
81 | /*expect*/ { 0, 0,0, "" }, |
82 | }, |
83 | /* #05 : */ |
84 | { /*input.*/ { 0, 0x008E, 0,0 }, |
85 | /*expect*/ { 0, 0,0, "" }, |
86 | }, |
87 | { .is_last = 1 } |
88 | } |
89 | }, |
90 | { |
91 | { Twcrtomb, TST_LOC_end } |
92 | } |
93 | }; |
94 | |