~ubuntu-branches/ubuntu/jaunty/belocs-locales-data/jaunty

« back to all changes in this revision

Viewing changes to localedata/tests-mbwc/dat_wcswidth.c

  • Committer: Bazaar Package Importer
  • Author(s): Denis Barbier
  • Date: 2005-05-17 22:09:38 UTC
  • Revision ID: james.westby@ubuntu.com-20050517220938-814x2iu6tkj3ml2o
Tags: upstream-2.3.4
ImportĀ upstreamĀ versionĀ 2.3.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
 
3
 *
 
4
 *       FILE:  dat_wcswidth.c
 
5
 *
 
6
 *       WCSWIDTH:  int  wcswidth (const wchar_t *ws, size_t n);
 
7
 */
 
8
 
 
9
TST_WCSWIDTH tst_wcswidth_loc [] = {
 
10
  {
 
11
    { Twcswidth, TST_LOC_de },
 
12
    {
 
13
      { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 },    0 },  /* 01 */
 
14
        /*expect*/ { 0,1,0                                 },
 
15
      },
 
16
      { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 },    1 },  /* 02 */
 
17
        /*expect*/ { 0,1,1                                 },
 
18
      },
 
19
      { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 },    2 },  /* 03 */
 
20
        /*expect*/ { 0,1,2                                 },
 
21
      },
 
22
      { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 },    3 },  /* 04 */
 
23
        /*expect*/ { 0,1,3                                 },
 
24
      },
 
25
      { /*input.*/ { { 0x00C1,0x00C2,0x00C3,0x0000 },    4 },  /* 05 */
 
26
        /*expect*/ { 0,1,3                                 },
 
27
      },
 
28
      { /*input.*/ { { 0x0000 },                         1 },  /* 06 */
 
29
        /*expect*/ { 0,1,0                                 },
 
30
      },
 
31
      { /*input.*/ { { 0x00C1,0x0001,0x0000 },           2 },  /* 07 */
 
32
        /*expect*/ { 0,1,-1                                },
 
33
      },
 
34
      { /*input.*/ { { 0x00C1,0x0001,0x0000 },           1 },  /* 08 */
 
35
        /*expect*/ { 0,1,1                                 },
 
36
      },
 
37
      { /*input.*/ { { 0x00C1,0x0001,0x0000 },           2 },  /* 09 */
 
38
        /*expect*/ { 0,1,-1                                },
 
39
      },
 
40
      { /*input.*/ { { 0x00C1,0x0092,0x0000 },           2 },  /* 10 */
 
41
        /*expect*/ { 0,1,-1                                },
 
42
      },
 
43
      { /*input.*/ { { 0x00C1,0x0020,0x0000 },           2 },  /* 11 */
 
44
        /*expect*/ { 0,1,2                                 },
 
45
      },
 
46
      { /*input.*/ { { 0x00C1,0x0021,0x0000 },           2 },  /* 12 */
 
47
        /*expect*/ { 0,1,2                                 },
 
48
      },
 
49
      { /*input.*/ { { 0x00C1,0x007E,0x0000 },           2 },  /* 13 */
 
50
        /*expect*/ { 0,1,2                                 },
 
51
      },
 
52
      { /*input.*/ { { 0x00C1,0x007F,0x0000 },           2 },  /* 14 */
 
53
        /*expect*/ { 0,1,-1                                },
 
54
      },
 
55
      { /*input.*/ { { 0x00C1,0x0080,0x0000 },           2 },  /* 15 */
 
56
        /*expect*/ { 0,1,-1                                },
 
57
      },
 
58
      { /*input.*/ { { 0x00C1,0x00A0,0x0000 },           2 },  /* 16 */
 
59
#ifdef SHOJI_IS_RIGHT
 
60
        /*expect*/ { 0,1,-1                                },
 
61
#else
 
62
        /*expect*/ { 0,1,2                                 },
 
63
#endif
 
64
      },
 
65
      { /*input.*/ { { 0x00C1,0x00A1,0x0000 },           2 },  /* 17 */
 
66
        /*expect*/ { 0,1,2                                 },
 
67
      },
 
68
      { /*input.*/ { { 0x00C1,0x00FF,0x0000 },           2 },  /* 18 */
 
69
        /*expect*/ { 0,1,2                                 },
 
70
      },
 
71
      { /*input.*/ { { 0x00C1,0x3042,0x0000 },           2 },  /* 19 */
 
72
        /*expect*/ { 0,1,-1                                },
 
73
      },
 
74
      { /*input.*/ { { 0x00C1,0x3044,0x0000 },           2 },  /* 20 */
 
75
        /*expect*/ { 0,1,-1                                },
 
76
      },
 
77
      { .is_last = 1 }
 
78
    }
 
79
  },
 
80
  {
 
81
    { Twcswidth, TST_LOC_enUS },
 
82
    {
 
83
      { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 },    0 },  /* 01 */
 
84
        /*expect*/ { 0,1,0                                 },
 
85
      },
 
86
      { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 },    1 },  /* 02 */
 
87
        /*expect*/ { 0,1,1                                 },
 
88
      },
 
89
      { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 },    2 },  /* 03 */
 
90
        /*expect*/ { 0,1,2                                 },
 
91
      },
 
92
#ifdef SHOJI_IS_RIGHT
 
93
      { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 },    3 },  /* 04 */
 
94
        /*expect*/ { 0,1,3                                 },
 
95
      },
 
96
      { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 },    4 },  /* 05 */
 
97
        /*expect*/ { 0,1,3                                 },
 
98
      },
 
99
#else
 
100
      { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 },    3 },  /* 04 */
 
101
        /*expect*/ { 0,1,-1                                },
 
102
      },
 
103
      { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },    4 },  /* 05 */
 
104
        /*expect*/ { 0,1,3                                 },
 
105
      },
 
106
#endif
 
107
      { /*input.*/ { { 0x0000 },                         1 },  /* 06 */
 
108
        /*expect*/ { 0,1,0                                 },
 
109
      },
 
110
      { /*input.*/ { { 0x0041,0x0001,0x0000 },           2 },  /* 07 */
 
111
        /*expect*/ { 0,1,-1                                },
 
112
      },
 
113
      { /*input.*/ { { 0x0041,0x0001,0x0000 },           1 },  /* 08 */
 
114
        /*expect*/ { 0,1,1                                 },
 
115
      },
 
116
      { /*input.*/ { { 0x0041,0x0001,0x0000 },           2 },  /* 09 */
 
117
        /*expect*/ { 0,1,-1                                },
 
118
      },
 
119
      { /*input.*/ { { 0x0041,0x0092,0x0000 },           2 },  /* 10 */
 
120
        /*expect*/ { 0,1,-1                                },
 
121
      },
 
122
      { /*input.*/ { { 0x0041,0x0020,0x0000 },           2 },  /* 11 */
 
123
        /*expect*/ { 0,1,2                                 },
 
124
      },
 
125
      { /*input.*/ { { 0x0041,0x0021,0x0000 },           2 },  /* 12 */
 
126
        /*expect*/ { 0,1,2                                 },
 
127
      },
 
128
      { /*input.*/ { { 0x0041,0x007E,0x0000 },           2 },  /* 13 */
 
129
        /*expect*/ { 0,1,2                                 },
 
130
      },
 
131
      { /*input.*/ { { 0x0041,0x007F,0x0000 },           2 },  /* 14 */
 
132
        /*expect*/ { 0,1,-1                                },
 
133
      },
 
134
      { /*input.*/ { { 0x0041,0x0080,0x0000 },           2 },  /* 15 */
 
135
        /*expect*/ { 0,1,-1                                },
 
136
      },
 
137
      { /*input.*/ { { 0x0041,0x00A0,0x0000 },           2 },  /* 16 */
 
138
        /*expect*/ { 0,1,-1                                },
 
139
      },
 
140
#ifdef SHOJI_IS_RIGHT
 
141
      { /*input.*/ { { 0x0041,0x00A1,0x0000 },           2 },  /* 17 */
 
142
        /*expect*/ { 0,1,2                                 },
 
143
      },
 
144
      { /*input.*/ { { 0x0041,0x00FF,0x0000 },           2 },  /* 18 */
 
145
        /*expect*/ { 0,1,2                                 },
 
146
      },
 
147
#else
 
148
      { /*input.*/ { { 0x0041,0x007E,0x0000 },           2 },  /* 17 */
 
149
        /*expect*/ { 0,1,2                                 },
 
150
      },
 
151
      { /*input.*/ { { 0x0041,0x0020,0x0000 },           2 },  /* 18 */
 
152
        /*expect*/ { 0,1,2                                 },
 
153
      },
 
154
#endif
 
155
      { /*input.*/ { { 0x0041,0x3042,0x0000 },           2 },  /* 19 */
 
156
        /*expect*/ { 0,1,-1                                },
 
157
      },
 
158
      { /*input.*/ { { 0x0041,0x3044,0x0000 },           2 },  /* 20 */
 
159
        /*expect*/ { 0,1,-1                                },
 
160
      },
 
161
      { .is_last = 1 }
 
162
    }
 
163
  },
 
164
  {
 
165
    { Twcswidth, TST_LOC_eucJP },
 
166
    {
 
167
      { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },    0 },  /* 01 */
 
168
        /*expect*/ { 0,1,0                                 },
 
169
      },
 
170
      { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },    1 },  /* 02 */
 
171
        /*expect*/ { 0,1,2                                 },
 
172
      },
 
173
      { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },    2 },  /* 03 */
 
174
        /*expect*/ { 0,1,4                                 },
 
175
      },
 
176
      { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },    3 },  /* 04 */
 
177
        /*expect*/ { 0,1,6                                 },
 
178
      },
 
179
      { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },    4 },  /* 05 */
 
180
        /*expect*/ { 0,1,6                                 },
 
181
      },
 
182
      { /*input.*/ { { 0x0000 },                         1 },  /* 06 */
 
183
        /*expect*/ { 0,1,0                                 },
 
184
      },
 
185
      { /*input.*/ { { 0x008E,0x0001,0x0000 },           2 },  /* 07 */
 
186
        /*expect*/ { 0,1,-1                                },
 
187
      },
 
188
      { /*input.*/ { { 0x3041,0x008E,0x0000 },           1 },  /* 08 */
 
189
        /*expect*/ { 0,1,2                                 },
 
190
      },
 
191
      { /*input.*/ { { 0x3041,0x008E,0x0000 },           2 },  /* 09 */
 
192
        /*expect*/ { 0,1,-1                                },
 
193
      },
 
194
      { /*input.*/ { { 0x3041,0x0001,0x0000 },           2 },  /* 10 */
 
195
        /*expect*/ { 0,1,-1                                },
 
196
      },
 
197
      { /*input.*/ { { 0x3041,0x3000,0x0000 },           2 },  /* 11 */
 
198
        /*expect*/ { 0,1,4                                 },
 
199
      },
 
200
      { /*input.*/ { { 0x0041,0x0021,0x0000 },           2 },  /* 12 */
 
201
        /*expect*/ { 0,1,2                                 },
 
202
      },
 
203
      { /*input.*/ { { 0x0041,0x007E,0x0000 },           2 },  /* 13 */
 
204
        /*expect*/ { 0,1,2                                 },
 
205
      },
 
206
      { /*input.*/ { { 0x0041,0x007F,0x0000 },           2 },  /* 14 */
 
207
        /*expect*/ { 0,1,-1                                },
 
208
      },
 
209
      { /*input.*/ { { 0x0041,0x0080,0x0000 },           2 },  /* 15 */
 
210
        /*expect*/ { 0,1,-1                                },
 
211
      },
 
212
      { /*input.*/ { { 0x0041,0x00A0,0x0000 },           2 },  /* 16 */
 
213
        /*expect*/ { 0,1,-1                                },
 
214
      },
 
215
#ifdef NO_WAIVER
 
216
      /* <NO_WAIVER> */  /* returns 3 */
 
217
      { /*input.*/ { { 0x0041,0x00A1,0x0000 },           2 },  /* 17 */
 
218
        /*expect*/ { 0,1,-1                                },
 
219
      },
 
220
#else
 
221
      /* XXX U00A1 is valid -> /x8f/xa2/xc4 in JIS X 0212 */
 
222
      { /*input.*/ { { 0x0041,0x00A1,0x0000 },           2 },  /* 17 */
 
223
        /*expect*/ { 0,1,3                                 },
 
224
      },
 
225
#endif
 
226
      { /*input.*/ { { 0x0041,0xFF71,0x0000 },           2 },  /* 18 */
 
227
        /*expect*/ { 0,1,2                                 },
 
228
      },
 
229
      { /*input.*/ { { 0x0041,0x3042,0x0000 },           2 },  /* 19 */
 
230
        /*expect*/ { 0,1,3                                 },
 
231
      },
 
232
      { /*input.*/ { { 0x0041,0x3044,0x0000 },           2 },  /* 20 */
 
233
        /*expect*/ { 0,1,3                                 },
 
234
      },
 
235
      { .is_last = 1 }
 
236
    }
 
237
  },
 
238
  {
 
239
    { Twcswidth, TST_LOC_end }
 
240
  }
 
241
};