2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
6 * WCSWIDTH: int wcswidth (const wchar_t *ws, size_t n);
9 TST_WCSWIDTH tst_wcswidth_loc
[] = {
11 { Twcswidth
, TST_LOC_de
},
13 { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 }, 0 }, /* 01 */
16 { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 }, 1 }, /* 02 */
19 { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 }, 2 }, /* 03 */
22 { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 }, 3 }, /* 04 */
25 { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 }, 4 }, /* 05 */
28 { /*input.*/ { { 0x0000 }, 1 }, /* 06 */
31 { /*input.*/ { { 0x00C1,0x0001,0x0000 }, 2 }, /* 07 */
32 /*expect*/ { 0,1,-1 },
34 { /*input.*/ { { 0x00C1,0x0001,0x0000 }, 1 }, /* 08 */
37 { /*input.*/ { { 0x00C1,0x0001,0x0000 }, 2 }, /* 09 */
38 /*expect*/ { 0,1,-1 },
40 { /*input.*/ { { 0x00C1,0x0092,0x0000 }, 2 }, /* 10 */
41 /*expect*/ { 0,1,-1 },
43 { /*input.*/ { { 0x00C1,0x0020,0x0000 }, 2 }, /* 11 */
46 { /*input.*/ { { 0x00C1,0x0021,0x0000 }, 2 }, /* 12 */
49 { /*input.*/ { { 0x00C1,0x007E,0x0000 }, 2 }, /* 13 */
52 { /*input.*/ { { 0x00C1,0x007F,0x0000 }, 2 }, /* 14 */
53 /*expect*/ { 0,1,-1 },
55 { /*input.*/ { { 0x00C1,0x0080,0x0000 }, 2 }, /* 15 */
56 /*expect*/ { 0,1,-1 },
58 { /*input.*/ { { 0x00C1,0x00A0,0x0000 }, 2 }, /* 16 */
61 { /*input.*/ { { 0x00C1,0x00A1,0x0000 }, 2 }, /* 17 */
64 { /*input.*/ { { 0x00C1,0x00FF,0x0000 }, 2 }, /* 18 */
67 { /*input.*/ { { 0x00C1,0x3042,0x0000 }, 2 }, /* 19 */
68 /*expect*/ { 0,1,-1 },
70 { /*input.*/ { { 0x00C1,0x3044,0x0000 }, 2 }, /* 20 */
71 /*expect*/ { 0,1,-1 },
77 { Twcswidth
, TST_LOC_enUS
},
79 { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 }, 0 }, /* 01 */
82 { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 }, 1 }, /* 02 */
85 { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 }, 2 }, /* 03 */
88 { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 }, 3 }, /* 04 */
89 /*expect*/ { 0,1,-1 },
91 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, 4 }, /* 05 */
94 { /*input.*/ { { 0x0000 }, 1 }, /* 06 */
97 { /*input.*/ { { 0x0041,0x0001,0x0000 }, 2 }, /* 07 */
98 /*expect*/ { 0,1,-1 },
100 { /*input.*/ { { 0x0041,0x0001,0x0000 }, 1 }, /* 08 */
101 /*expect*/ { 0,1,1 },
103 { /*input.*/ { { 0x0041,0x0001,0x0000 }, 2 }, /* 09 */
104 /*expect*/ { 0,1,-1 },
106 { /*input.*/ { { 0x0041,0x0092,0x0000 }, 2 }, /* 10 */
107 /*expect*/ { 0,1,-1 },
109 { /*input.*/ { { 0x0041,0x0020,0x0000 }, 2 }, /* 11 */
110 /*expect*/ { 0,1,2 },
112 { /*input.*/ { { 0x0041,0x0021,0x0000 }, 2 }, /* 12 */
113 /*expect*/ { 0,1,2 },
115 { /*input.*/ { { 0x0041,0x007E,0x0000 }, 2 }, /* 13 */
116 /*expect*/ { 0,1,2 },
118 { /*input.*/ { { 0x0041,0x007F,0x0000 }, 2 }, /* 14 */
119 /*expect*/ { 0,1,-1 },
121 { /*input.*/ { { 0x0041,0x0080,0x0000 }, 2 }, /* 15 */
122 /*expect*/ { 0,1,-1 },
124 { /*input.*/ { { 0x0041,0x00A0,0x0000 }, 2 }, /* 16 */
125 /*expect*/ { 0,1,-1 },
127 { /*input.*/ { { 0x0041,0x007E,0x0000 }, 2 }, /* 17 */
128 /*expect*/ { 0,1,2 },
130 { /*input.*/ { { 0x0041,0x0020,0x0000 }, 2 }, /* 18 */
131 /*expect*/ { 0,1,2 },
133 { /*input.*/ { { 0x0041,0x3042,0x0000 }, 2 }, /* 19 */
134 /*expect*/ { 0,1,-1 },
136 { /*input.*/ { { 0x0041,0x3044,0x0000 }, 2 }, /* 20 */
137 /*expect*/ { 0,1,-1 },
143 { Twcswidth
, TST_LOC_eucJP
},
145 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, 0 }, /* 01 */
146 /*expect*/ { 0,1,0 },
148 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, 1 }, /* 02 */
149 /*expect*/ { 0,1,2 },
151 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, 2 }, /* 03 */
152 /*expect*/ { 0,1,4 },
154 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, 3 }, /* 04 */
155 /*expect*/ { 0,1,6 },
157 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, 4 }, /* 05 */
158 /*expect*/ { 0,1,6 },
160 { /*input.*/ { { 0x0000 }, 1 }, /* 06 */
161 /*expect*/ { 0,1,0 },
163 { /*input.*/ { { 0x008E,0x0001,0x0000 }, 2 }, /* 07 */
164 /*expect*/ { 0,1,-1 },
166 { /*input.*/ { { 0x3041,0x008E,0x0000 }, 1 }, /* 08 */
167 /*expect*/ { 0,1,2 },
169 { /*input.*/ { { 0x3041,0x008E,0x0000 }, 2 }, /* 09 */
170 /*expect*/ { 0,1,-1 },
172 { /*input.*/ { { 0x3041,0x0001,0x0000 }, 2 }, /* 10 */
173 /*expect*/ { 0,1,-1 },
175 { /*input.*/ { { 0x3041,0x3000,0x0000 }, 2 }, /* 11 */
176 /*expect*/ { 0,1,4 },
178 { /*input.*/ { { 0x0041,0x0021,0x0000 }, 2 }, /* 12 */
179 /*expect*/ { 0,1,2 },
181 { /*input.*/ { { 0x0041,0x007E,0x0000 }, 2 }, /* 13 */
182 /*expect*/ { 0,1,2 },
184 { /*input.*/ { { 0x0041,0x007F,0x0000 }, 2 }, /* 14 */
185 /*expect*/ { 0,1,-1 },
187 { /*input.*/ { { 0x0041,0x0080,0x0000 }, 2 }, /* 15 */
188 /*expect*/ { 0,1,-1 },
190 { /*input.*/ { { 0x0041,0x00A0,0x0000 }, 2 }, /* 16 */
191 /*expect*/ { 0,1,-1 },
194 /* <NO_WAIVER> */ /* returns 3 */
195 { /*input.*/ { { 0x0041,0x00A1,0x0000 }, 2 }, /* 17 */
196 /*expect*/ { 0,1,-1 },
199 /* XXX U00A1 is valid -> /x8f/xa2/xc4 in JIS X 0212 */
200 { /*input.*/ { { 0x0041,0x00A1,0x0000 }, 2 }, /* 17 */
201 /*expect*/ { 0,1,3 },
204 { /*input.*/ { { 0x0041,0xFF71,0x0000 }, 2 }, /* 18 */
205 /*expect*/ { 0,1,2 },
207 { /*input.*/ { { 0x0041,0x3042,0x0000 }, 2 }, /* 19 */
208 /*expect*/ { 0,1,3 },
210 { /*input.*/ { { 0x0041,0x3044,0x0000 }, 2 }, /* 20 */
211 /*expect*/ { 0,1,3 },
217 { Twcswidth
, TST_LOC_end
}