elf: Add all malloc tunable to unsecvars
[glibc.git] / localedata / tests-mbwc / dat_wcscoll.c
blob5e2fbbe65ca0c7899c30b30081a6d262de1bce40
1 /*
2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
4 * FILE: dat_wcscoll.c
6 * WCSCOLL: int wcscoll (const wchar_t *ws1, const wchar_t *ws2);
7 */
9 /*
10 * CAUTION:
11 * When LC_COLLATE (or LC_ALL) is set for ja_JP.EUC,
12 * wcscoll() core-dumps for big values such as 0x3041
13 * (0x0041 is okay) in glibc 2.1.2.
15 * NOTE:
16 * a) When 0 is expected as a return value, set ret_flg=1.
17 * - the return value is compared with an expected value: ret_val.
18 * b) When a positive value is expected as a return value,
19 * set ret_flg=0 and set cmp_flg=+1.
20 * - the return value is not compared with the expected value
21 * (can not be compared); instead, the test program checks
22 * if the return value is positive when cmp_flg=+1.
23 * c) When a negative value is expected as a return value,
24 * ......
25 * d) When data contains invalid values, set err_val to the expected errno.
26 * Set ret_flg=0 and cmp_flg=0 so that it doesn't compare
27 * the return value with an expected value or doesn't check
28 * the sign of the return value.
31 * -------------------------------------------
32 * CASE err_val ret_flg ret_val cmp_flg
33 * -------------------------------------------
34 * a) 0 1 0 0
35 * b) 0 0 0 +1
36 * c) 0 0 0 -1
37 * d) EINVAL 0 0 0
38 * -------------------------------------------
42 TST_WCSCOLL tst_wcscoll_loc [] = {
44 { { Twcscoll, TST_LOC_de },
46 { /*input.*/ { { 0x00E1,0x00E2,0x00E3,0x0000 },
47 { 0x00E1,0x00E2,0x00E3,0x0000 }, }, /* #1 */
48 /*expect*/ { 0,1,0, 0, },
50 { /*input.*/ { { 0x0000,0x00E1,0x00E3,0x0000 },
51 { 0x0000,0x00E2,0x00E3,0x0000 }, }, /* #2 */
52 /*expect*/ { 0,1,0, 0, },
54 { /*input.*/ { { 0x00E1,0x00E1,0x00E3,0x0000 },
55 { 0x0000,0x00E2,0x00E3,0x0000 }, }, /* #3 */
56 /*expect*/ { 0,0,0, +1, },
58 { /*input.*/ { { 0x0000,0x00E2,0x00E3,0x0000 },
59 { 0x00E1,0x00E1,0x00E3,0x0000 }, }, /* #4 */
60 /*expect*/ { 0,0,0, -1, },
62 { /*input.*/ { { 0x00E1,0x0042,0x00E3,0x0000 },
63 { 0x00E1,0x0061,0x00E3,0x0000 }, }, /* #5 */
64 /*expect*/ { 0,0,0, +1, },
66 { /*input.*/ { { 0x00E1,0x0061,0x00E3,0x0000 },
67 { 0x00E1,0x0042,0x00E3,0x0000 }, }, /* #6 */
68 /*expect*/ { 0,0,0, -1, },
70 { /*input.*/ { { 0x00E1,0x00E2,0x0000 },
71 { 0x00E1,0x00E2,0x00E9,0x0000 }, }, /* #7 */
72 /*expect*/ { 0,0,0, -1, },
74 { /*input.*/ { { 0x00E1,0x00E2,0x00E9,0x0000 },
75 { 0x00E1,0x00E2,0x0000 }, }, /* #8 */
76 /*expect*/ { 0,0,0, +1, },
78 { /*input.*/ { { 0x00E1,0x0092,0x00E9,0x0000 },
79 { 0x00E1,0x008E,0x00E9,0x0000 }, }, /* #9 */
80 /*expect*/ { 0,0,0, +1, },
82 { /*input.*/ { { 0x00E1,0x008E,0x00E9,0x0000 },
83 { 0x00E1,0x0092,0x00E9,0x0000 }, }, /* #10 */
84 /*expect*/ { 0,0,0, -1, },
86 { .is_last = 1 }
89 { { Twcscoll, TST_LOC_enUS },
91 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
92 { 0x0041,0x0042,0x0043,0x0000 }, }, /* #1 */
93 /*expect*/ { 0,1,0, 0, },
95 { /*input.*/ { { 0x0000,0x0041,0x0043,0x0000 },
96 { 0x0000,0x0042,0x0043,0x0000 }, }, /* #2 */
97 /*expect*/ { 0,1,0, 0, },
99 { /*input.*/ { { 0x0041,0x0041,0x0043,0x0000 },
100 { 0x0000,0x0042,0x0043,0x0000 }, }, /* #3 */
101 /*expect*/ { 0,0,0, +1, },
103 { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
104 { 0x0041,0x0041,0x0043,0x0000 }, }, /* #4 */
105 /*expect*/ { 0,0,0, -1, },
107 /* XXX Correct order is lowercase before uppercase. */
108 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
109 { 0x0041,0x0061,0x0043,0x0000 }, }, /* #5 */
110 /*expect*/ { 0,0,0, +1, },
112 { /*input.*/ { { 0x0041,0x0061,0x0043,0x0000 },
113 { 0x0041,0x0042,0x0043,0x0000 }, }, /* #6 */
114 /*expect*/ { 0,0,0, -1, },
116 { /*input.*/ { { 0x0041,0x0042,0x0000 },
117 { 0x0041,0x0042,0x0049,0x0000 }, }, /* #7 */
118 /*expect*/ { 0,0,0, -1, },
120 { /*input.*/ { { 0x0041,0x0042,0x0049,0x0000 },
121 { 0x0041,0x0042,0x0000 }, }, /* #8 */
122 /*expect*/ { 0,0,0, +1, },
124 /* Do not assume position of character out of range. */
125 { /*input.*/ { { 0x0041,0x0092,0x0049,0x0000 },
126 { 0x0041,0x008E,0x0049,0x0000 }, }, /* #9 */
127 /*expect*/ { 0,0,0, 0, },
129 { /*input.*/ { { 0x0041,0x008E,0x0049,0x0000 },
130 { 0x0041,0x0092,0x0049,0x0000 }, }, /* #10 */
131 /*expect*/ { 0,0,0, 0, },
133 { .is_last = 1 }
136 { { Twcscoll, TST_LOC_eucJP },
138 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
139 { 0x3041,0x3042,0x3043,0x0000 }, }, /* #1 */
140 /*expect*/ { 0,1,0, 0, },
142 { /*input.*/ { { 0x0000,0x3041,0x3043,0x0000 },
143 { 0x0000,0x3042,0x3043,0x0000 }, }, /* #2 */
144 /*expect*/ { 0,1,0, 0, },
146 { /*input.*/ { { 0x3041,0x3041,0x3043,0x0000 },
147 { 0x0000,0x3042,0x3043,0x0000 }, }, /* #3 */
148 /*expect*/ { 0,0,0, +1, },
150 { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
151 { 0x3041,0x3041,0x3043,0x0000 }, }, /* #4 */
152 /*expect*/ { 0,0,0, -1, },
154 { /*input.*/ { { 0x3041,0x0042,0x3043,0x0000 },
155 { 0x3041,0x0061,0x3043,0x0000 }, }, /* #5 */
156 /*expect*/ { 0,0,0, -1, },
158 { /*input.*/ { { 0x3041,0x0061,0x3043,0x0000 },
159 { 0x3041,0x0042,0x3043,0x0000 }, }, /* #6 */
160 /*expect*/ { 0,0,0, +1, },
162 { /*input.*/ { { 0x3041,0x3042,0xFF71,0x0000 },
163 { 0x3041,0x3042,0x30A2,0x0000 }, }, /* #7 */
164 /*expect*/ { 0,0,0, -1, },
166 { /*input.*/ { { 0x3041,0x3042,0x30A2,0x0000 },
167 { 0x3041,0x3042,0xFF71,0x0000 }, }, /* #8 */
168 /*expect*/ { 0,0,0, +1, },
170 { /*input.*/ { { 0x30FF,0x3092,0x3049,0x0000 },
171 { 0x3041,0x308E,0x3049,0x0000 }, }, /* #9 */
172 /*expect*/ { 0,0,0, -1, },
174 { /*input.*/ { { 0x3041,0x308E,0x3049,0x0000 },
175 { 0x30FF,0x3092,0x3049,0x0000 }, }, /* #10 */
176 /*expect*/ { 0,0,0, +1, },
178 { .is_last = 1 }
181 { { Twcscoll, TST_LOC_end } }