2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
6 * STRCOLL: int strcoll (const char *s1, const char *s2);
12 If a return value is expected to be 0, set ret_flg=1 and the
13 expected value = 0. If a return value is expected to be a
14 positive/negative value, set ret_flg=0, and set the expected value
16 There is inconsistensy between tst_strcoll() and tst_wcscoll()(it
17 has cmp_flg) for input data. I'll fix it.
19 Assuming en_US to be en_US.ascii. (maybe, should be iso8859-1).
23 ASCII CODE : A,B,C, ... , a, b, c, ... B,a:-1 a,B:+1
24 DICTIONARY : A,a,B,b,C,c,.... a,B:-1 B,a:+1 */
26 TST_STRCOLL tst_strcoll_loc
[] = {
28 { Tstrcoll
, TST_LOC_de
},
30 { /*input.*/ { "ÄBCDEFG", "ÄBCDEFG" }, /* #1 */
31 /*expect*/ { 0,1,0, },
33 { /*input.*/ { "XX Ä XX", "XX B XX" }, /* #2 */
34 /*expect*/ { 0,0,-1, },
36 { /*input.*/ { "XX B XX", "XX Ä XX" }, /* #3 */
37 /*expect*/ { 0,0,+1, },
39 { /*input.*/ { "B", "a" }, /* #4 */
40 /*expect*/ { 0,0,+1, },
42 { /*input.*/ { "a", "B" }, /* #5 */
43 /*expect*/ { 0,0,-1, },
45 { /*input.*/ { "b", "A" }, /* #6 */
46 /*expect*/ { 0,0,+1, },
48 { /*input.*/ { "A", "b" }, /* #7 */
49 /*expect*/ { 0,0,-1, },
51 { /*input.*/ { "ä", "B" }, /* #8 */
52 /*expect*/ { 0,0,-1, },
54 { /*input.*/ { "B", "ä" }, /* #9 */
55 /*expect*/ { 0,0,+1, },
57 { .is_last
= 1 } /* Last element. */
61 { Tstrcoll
, TST_LOC_enUS
},
63 { /*input.*/ { "ABCDEFG", "ABCDEFG" }, /* #1 */
64 /*expect*/ { 0,1,0, },
66 { /*input.*/ { "XX a XX", "XX B XX" }, /* #2 */
67 /*expect*/ { 0,0,-1, },
69 { /*input.*/ { "XX B XX", "XX a XX" }, /* #3 */
70 /*expect*/ { 0,0,+1, },
74 /*input.*/ { "B", "a" }, /* #4 */
76 /*expect*/ { 0,0,-1, },
78 /* XXX We are not testing the C locale. */
79 /*expect*/ { 0,0,+1, },
84 /*input.*/ { "a", "B" }, /* #5 */
86 /*expect*/ { 0,0,+1, },
88 /* XXX We are not testing the C locale. */
89 /*expect*/ { 0,0,-1, },
92 { /*input.*/ { "b", "A" }, /* #6 */
93 /*expect*/ { 0,0,+1, },
95 { /*input.*/ { "A", "b" }, /* #7 */
96 /*expect*/ { 0,0,-1, },
99 /* XXX I do not yet know whether strcoll really should reject
100 characters outside the multibyte character range. */
102 /* #8 */ /* <WAIVER> */
103 /*input.*/ { "\244\242\244\244\244\246\244\250\244\252", "ABCDEFG" },
104 /*expect*/ { EINVAL
,0,0, },
107 /* #9 */ /* <WAIVER> */
108 /*input.*/ { "ABCZEFG", "\244\242\244\244\244\246\244\250\244\252" },
109 /*expect*/ { EINVAL
,0,0, },
112 { .is_last
= 1 } /* Last element. */
116 { Tstrcoll
, TST_LOC_eucJP
},
118 { /*input.*/ { "\244\242\244\244\244\246\244\250\244\252",
119 "\244\242\244\244\244\246\244\250\244\252" }, /* #1 */
120 /*expect*/ { 0,1,0, },
122 { /*input.*/ { "\244\242\244\244\244\246\244\250\244\252",
123 "\244\242\244\244\244\363\244\250\244\252" }, /* #2 */
124 /*expect*/ { 0,0,-1, },
126 { /*input.*/ { "\244\242\244\244\244\363\244\250\244\252",
127 "\244\242\244\244\244\246\244\250\244\252" }, /* #3 */
128 /*expect*/ { 0,0,+1, },
130 { /*input.*/ { "B", "a" }, /* #4 */
131 /*expect*/ { 0,0,-1, },
133 { /*input.*/ { "a", "B" }, /* #5 */
134 /*expect*/ { 0,0,+1, },
136 { /*input.*/ { "b", "A" }, /* #6 */
137 /*expect*/ { 0,0,+1, },
139 { /*input.*/ { "A", "b" }, /* #7 */
140 /*expect*/ { 0,0,-1, },
143 /* XXX I do not yet know whether strcoll really should reject
144 characters outside the multibyte character range. */
147 /*input.*/ { "\200\216\217", "ABCDEFG" }, /* #8 */
148 /*expect*/ { EINVAL
,0,0, },
152 /*input.*/ { "ABCZEFG", "\200\216\217" }, /* #9 */
153 /*expect*/ { EINVAL
,0,0, },
156 { .is_last
= 1 } /* Last element. */
160 { Tstrcoll
, TST_LOC_end
}