2.9
[glibc/nacl-glibc.git] / localedata / tests-mbwc / dat_mbrlen.c
bloba21ab762a8bf5a353763da2fdecfca6fda07de65
1 /*
2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
4 * FILE: dat_mbrlen.c
6 * MBRLEN: size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
7 */
9 /*
10 * NOTE:
11 * (1) A mbstate object is initialized for
12 * every new data record by the test program.
14 * (2) USE_MBCURMAX is defined as a value of 99.
19 TST_MBRLEN tst_mbrlen_loc [] = {
21 { Tmbrlen, TST_LOC_de },
23 { /*----------------- #01 -----------------*/
26 { 1, "", 0, 0, 0 },
27 { 1, "", 1, 0, 0 },
28 { 1, "\300", USE_MBCURMAX, 0, 0 },
33 { 0, 1, 0, },
34 { 0, 1, 0, },
35 { 0, 1, 1, },
39 { /*----------------- #02 -----------------*/
42 { 1, "\300\001", 0, 0, 0 },
43 { 1, "\300\001", 1, 0, 0 },
44 { 1, "\317\001", USE_MBCURMAX, 0, 0 },
49 { 0, 1, 0, },
50 { 0, 1, 1, },
51 { 0, 1, 1, },
55 { .is_last = 1 }
59 { Tmbrlen, TST_LOC_enUS },
61 { /*----------------- #01 -----------------*/
64 { 1, "A", 0, 0, 0 },
65 { 1, "A", 1, 0, 0 },
66 { 1, "A", USE_MBCURMAX, 0, 0 },
71 { 0, 1, 0, },
72 { 0, 1, 1, },
73 { 0, 1, 1, },
77 { /*----------------- #02 -----------------*/
80 { 1, "\317\001", 0, 1, 0 },
81 { 1, "\317\001", 1, 1, 0 },
82 { 1, "\317\001", USE_MBCURMAX, 1, 0 },
87 { 0, 1, 0, },
88 { EILSEQ, 1, -1, },
89 { EILSEQ, 1, -1, },
93 { .is_last = 1 }
97 { Tmbrlen, TST_LOC_eucJP },
99 { /*----------------- #01 -----------------*/
102 { 1, "\317\302", 1, 1, 1 },
103 { 0, "", 0, 1, 0 },
104 { 1, "\317\302", USE_MBCURMAX, 1, 1 },
109 { 0, 1, -2, },
110 { 0, 1, -1, },
111 { 0, 1, 2, },
115 { /*----------------- #02 -----------------*/
118 { 1, "\317", 1, 1, 0 },
119 { 1, "\302", 1, 1, 0 },
120 { 1, "\317\302", USE_MBCURMAX, 0, 0 },
125 { 0, 1, -2, },
126 #ifdef SHOJI_IS_RIGHT
127 { 0, 1, +2, },
128 #else
129 /* XXX ISO C explicitly says that the return value does not
130 XXX reflect the bytes contained in the state. */
131 { 0, 1, +1, },
132 #endif
133 { 0, 1, 2, },
137 { /*----------------- #03 -----------------*/
140 { 1, "\216\217", 0, 0, 0 },
141 { 1, "\216\217", 1, 0, 0 },
142 { 1, "\216\217", USE_MBCURMAX, 0, 0 },
147 { 0, 1, 0, },
148 { 0, 1, -2, },
149 { EILSEQ, 1, -1, },
153 { .is_last = 1 }
157 { Tmbrlen, TST_LOC_end }