1/*
2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
3 *
4 * FILE: dat_wcsstr.c
5 *
6 * WCSSTR: wchar_t *wcsstr (const wchar_t *ws1, const wchar_t *ws2);
7 */
8
9/*
10 * NOTE:
11 * This is not a locale sensitive function.
12 * So those data in each locale doesn't make sense ...
13 * (redundant test cases)
14 */
15
16
17TST_WCSSTR tst_wcsstr_loc [] = {
18 {
19 { Twcsstr, TST_LOC_de },
20 {
21 { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
22 { 0x00D1,0x0000 }, }, /* #01 */
23 /*expect*/ { 0,0,0, },
24 },
25 { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
26 { 0x00D2,0x0000 }, }, /* #02 */
27 /*expect*/ { 0,0,0, },
28 },
29 { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
30 { 0x00D3,0x0000 }, }, /* #03 */
31 /*expect*/ { 0,0,0, },
32 },
33 { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
34 { 0x00D1,0x00D2,0x0000 }, }, /* #04 */
35 /*expect*/ { 0,0,0, },
36 },
37 { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
38 { 0x00D2,0x00D3,0x0000 }, }, /* #05 */
39 /*expect*/ { 0,0,0, },
40 },
41 { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
42 { 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #06 */
43 /*expect*/ { 0,0,0, },
44 },
45 { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
46 { 0x00D2,0x00D3,0x00D4,0x0000 }, }, /* #07 */
47 /*expect*/ { 0,1,(wchar_t *)NULL, },
48 },
49 { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
50 { 0x00D0,0x00D1,0x00D2,0x0000 }, }, /* #08 */
51 /*expect*/ { 0,1,(wchar_t *)NULL, },
52 },
53 { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
54 { 0x0000 }, }, /* #09 */
55 /*expect*/ { 0,0,0, },
56 },
57 { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 },
58 { 0x00D1,0x0000 }, }, /* #10 */
59 /*expect*/ { 0,1,(wchar_t *)NULL, },
60 },
61 { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 },
62 { 0x0000 }, }, /* #11 */
63 /*expect*/ { 0,0,0, },
64 },
65 { .is_last = 1 }
66 }
67 },
68 {
69 { Twcsstr, TST_LOC_enUS },
70 {
71 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
72 { 0x0041,0x0000 }, }, /* #01 */
73 /*expect*/ { 0,0,0, },
74 },
75 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
76 { 0x0042,0x0000 }, }, /* #02 */
77 /*expect*/ { 0,0,0, },
78 },
79 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
80 { 0x0043,0x0000 }, }, /* #03 */
81 /*expect*/ { 0,0,0, },
82 },
83 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
84 { 0x0041,0x0042,0x0000 }, }, /* #04 */
85 /*expect*/ { 0,0,0, },
86 },
87 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
88 { 0x0042,0x0043,0x0000 }, }, /* #05 */
89 /*expect*/ { 0,0,0, },
90 },
91 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
92 { 0x0041,0x0042,0x0043,0x0000 }, }, /* #06 */
93 /*expect*/ { 0,0,0, },
94 },
95 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
96 { 0x0042,0x0043,0x0044,0x0000 }, }, /* #07 */
97 /*expect*/ { 0,1,(wchar_t *)NULL, },
98 },
99 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
100 { 0x0040,0x0041,0x0042,0x0000 }, }, /* #08 */
101 /*expect*/ { 0,1,(wchar_t *)NULL, },
102 },
103 { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
104 { 0x0000 }, }, /* #09 */
105 /*expect*/ { 0,0,0, },
106 },
107 { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
108 { 0x0041,0x0000 }, }, /* #10 */
109 /*expect*/ { 0,1,(wchar_t *)NULL, },
110 },
111 { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
112 { 0x0000 }, }, /* #11 */
113 /*expect*/ { 0,0,0, },
114 },
115 { .is_last = 1 }
116 }
117 },
118 {
119 { Twcsstr, TST_LOC_eucJP },
120 {
121 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
122 { 0x3041,0x0000 }, }, /* #01 */
123 /*expect*/ { 0,0,0, },
124 },
125 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
126 { 0x3042,0x0000 }, }, /* #02 */
127 /*expect*/ { 0,0,0, },
128 },
129 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
130 { 0x3043,0x0000 }, }, /* #03 */
131 /*expect*/ { 0,0,0, },
132 },
133 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
134 { 0x3041,0x3042,0x0000 }, }, /* #04 */
135 /*expect*/ { 0,0,0, },
136 },
137 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
138 { 0x3042,0x3043,0x0000 }, }, /* #05 */
139 /*expect*/ { 0,0,0, },
140 },
141 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
142 { 0x3041,0x3042,0x3043,0x0000 }, }, /* #06 */
143 /*expect*/ { 0,0,0, },
144 },
145 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
146 { 0x3042,0x3043,0x3044,0x0000 }, }, /* #07 */
147 /*expect*/ { 0,1,(wchar_t *)NULL, },
148 },
149 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
150 { 0x3040,0x3041,0x3042,0x0000 }, }, /* #08 */
151 /*expect*/ { 0,1,(wchar_t *)NULL, },
152 },
153 { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
154 { 0x0000 }, }, /* #09 */
155 /*expect*/ { 0,0,0, },
156 },
157 { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
158 { 0x3041,0x0000 }, }, /* #10 */
159 /*expect*/ { 0,1,(wchar_t *)NULL, },
160 },
161 { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
162 { 0x0000 }, }, /* #11 */
163 /*expect*/ { 0,0,0, },
164 },
165 { .is_last = 1 }
166 }
167 },
168 {
169 { Twcsstr, TST_LOC_end }
170 }
171};
172

source code of glibc/localedata/tests-mbwc/dat_wcsstr.c