2.9
[glibc/nacl-glibc.git] / localedata / tests-mbwc / dat_mbstowcs.c
blobcabe4cdf2408d475bb3f1f767012a2f847c52efc
1 /*
2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
4 * FILE: dat_mbstowcs.c
6 * MBSTOWCS: size_t mbstowcs (wchar_t *ws, char *s, size_t n);
7 */
9 #include <limits.h>
11 TST_MBSTOWCS tst_mbstowcs_loc [] = {
13 { Tmbstowcs, TST_LOC_de },
15 { /*----------------- #01 -----------------*/
18 { 1, 1, "ABC", 4 },
19 { 1, 1, "ABC", 3 },
20 { 1, 1, "ABC", 2 },
25 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } },
26 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } },
27 { 0,1,2, { 0x0041,0x0042,0x0043,0x0000 } },
31 { /*----------------- #02 -----------------*/
34 { 1, 1, "ABC", 4 },
35 { 1, 1, "", 1 },
36 { 0, 1, "ABC", 4 },
41 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } },
42 { 0,1,0, { 0x0000 } },
43 { 0,1,3, { 0x0000 } },
47 { .is_last = 1 }
51 { Tmbstowcs, TST_LOC_enUS },
53 { /*----------------- #01 -----------------*/
56 { 1, 1, "ABC", 4 },
57 { 1, 1, "ABC", 3 },
58 { 1, 1, "ABC", 2 },
63 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } },
64 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } },
65 { 0,1,2, { 0x0041,0x0042,0x0043,0x0000 } },
69 { /*----------------- #02 -----------------*/
72 { 1, 1, "ABC", 4 },
73 { 1, 1, "", 1 },
74 { 0, 1, "ABC", 4 },
79 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } },
80 { 0,1,0, { 0x0000 } },
81 { 0,1,3, { 0x0000 } },
85 { .is_last = 1 }
89 { Tmbstowcs, TST_LOC_eucJP },
91 { /*----------------- #01 -----------------*/
94 { 1, 1, "\244\242\244\244\244\246ABC", 7 },
95 { 1, 1, "\244\242\244\244\244\246ABC", 6 },
96 { 1, 1, "\244\242\244\244\244\246ABC", 4 },
101 { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }},
102 { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }},
103 { 0,1,4, { 0x3042,0x3044,0x3046,0x0041,0x0000 } },
107 { /*----------------- #02 -----------------*/
110 #ifdef SHOJI_IS_RIGHT
111 /* XXX I really don't understand the first and third line.
112 the result of the first line is the same as the first
113 in the last test (i.e., returns 6). Also, the third
114 test will simply convert everything. */
115 { 1, 1, "\244\242\244\244\244\246ABC", 7 },
116 { 1, 1, "", 1 },
117 { 0, 1, "\244\242\244\244\244\246ABC", 7 },
118 #else
119 { 1, 1, "\244\242\244\244\244\246ABC", 4 },
120 { 1, 1, "", 1 },
121 { 0, 1, "\244\242\244\244\244\246ABC", 0 },
122 #endif
127 { 0,1,4, { 0x3042,0x3044,0x3046,0x0041,0x0000 } },
128 { 0,1,0, { 0x0000 } },
129 { 0,1,6, { 0x0000 } },
133 { .is_last = 1 }
137 { Tmbstowcs, TST_LOC_end }