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