Lines Matching +full:- +full:wc

16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 int wc; in test_any() local
39 assert(charset_mbtowc(charset, 0, (char *)(-1), 0) == 0); in test_any()
47 wc = 'x'; in test_any()
48 assert(charset_mbtowc(charset, &wc, "a", 0) == 0 && wc == 'x'); in test_any()
49 assert(charset_mbtowc(charset, &wc, "", 1) == 0 && wc == 0); in test_any()
50 assert(charset_mbtowc(charset, &wc, "b", 1) == 1 && wc == 'b'); in test_any()
51 assert(charset_mbtowc(charset, &wc, "", 2) == 0 && wc == 0); in test_any()
52 assert(charset_mbtowc(charset, &wc, "c", 2) == 1 && wc == 'c'); in test_any()
68 int wc; in test_utf8() local
71 charset = charset_find("UTF-8"); in test_utf8()
75 wc = 0; in test_utf8()
76 assert(charset_mbtowc(charset, &wc, "\177", 1) == 1 && wc == 127); in test_utf8()
77 assert(charset_mbtowc(charset, &wc, "\200", 2) == -1); in test_utf8()
78 assert(charset_mbtowc(charset, &wc, "\301\277", 9) == -1); in test_utf8()
79 assert(charset_mbtowc(charset, &wc, "\302\200", 1) == -1); in test_utf8()
80 assert(charset_mbtowc(charset, &wc, "\302\200", 2) == 2 && wc == 128); in test_utf8()
81 assert(charset_mbtowc(charset, &wc, "\302\200", 3) == 2 && wc == 128); in test_utf8()
82 assert(charset_mbtowc(charset, &wc, "\340\237\200", 9) == -1); in test_utf8()
83 assert(charset_mbtowc(charset, &wc, "\340\240\200", 9) == 3 && in test_utf8()
84 wc == 1 << 11); in test_utf8()
85 assert(charset_mbtowc(charset, &wc, "\360\217\277\277", 9) == -1); in test_utf8()
86 assert(charset_mbtowc(charset, &wc, "\360\220\200\200", 9) == 4 && in test_utf8()
87 wc == 1 << 16); in test_utf8()
88 assert(charset_mbtowc(charset, &wc, "\370\207\277\277\277", 9) == -1); in test_utf8()
89 assert(charset_mbtowc(charset, &wc, "\370\210\200\200\200", 9) == 5 && in test_utf8()
90 wc == 1 << 21); in test_utf8()
91 assert(charset_mbtowc(charset, &wc, "\374\203\277\277\277\277", 9) == -1); in test_utf8()
92 assert(charset_mbtowc(charset, &wc, "\374\204\200\200\200\200", 9) == 6 && in test_utf8()
93 wc == 1 << 26); in test_utf8()
94 assert(charset_mbtowc(charset, &wc, "\375\277\277\277\277\277", 9) == 6 && in test_utf8()
95 wc == 0x7fffffff); in test_utf8()
97 assert(charset_mbtowc(charset, &wc, "\302\000", 2) == -1); in test_utf8()
98 assert(charset_mbtowc(charset, &wc, "\302\300", 2) == -1); in test_utf8()
99 assert(charset_mbtowc(charset, &wc, "\340\040\200", 9) == -1); in test_utf8()
100 assert(charset_mbtowc(charset, &wc, "\340\340\200", 9) == -1); in test_utf8()
101 assert(charset_mbtowc(charset, &wc, "\340\240\000", 9) == -1); in test_utf8()
102 assert(charset_mbtowc(charset, &wc, "\340\240\300", 9) == -1); in test_utf8()
103 assert(charset_mbtowc(charset, &wc, "\360\020\200\200", 9) == -1); in test_utf8()
104 assert(charset_mbtowc(charset, &wc, "\360\320\200\200", 9) == -1); in test_utf8()
105 assert(charset_mbtowc(charset, &wc, "\360\220\000\200", 9) == -1); in test_utf8()
106 assert(charset_mbtowc(charset, &wc, "\360\220\300\200", 9) == -1); in test_utf8()
107 assert(charset_mbtowc(charset, &wc, "\360\220\200\000", 9) == -1); in test_utf8()
108 assert(charset_mbtowc(charset, &wc, "\360\220\200\300", 9) == -1); in test_utf8()
109 assert(charset_mbtowc(charset, &wc, "\375\077\277\277\277\277", 9) == -1); in test_utf8()
110 assert(charset_mbtowc(charset, &wc, "\375\377\277\277\277\277", 9) == -1); in test_utf8()
111 assert(charset_mbtowc(charset, &wc, "\375\277\077\277\277\277", 9) == -1); in test_utf8()
112 assert(charset_mbtowc(charset, &wc, "\375\277\377\277\277\277", 9) == -1); in test_utf8()
113 assert(charset_mbtowc(charset, &wc, "\375\277\277\277\077\277", 9) == -1); in test_utf8()
114 assert(charset_mbtowc(charset, &wc, "\375\277\277\277\377\277", 9) == -1); in test_utf8()
115 assert(charset_mbtowc(charset, &wc, "\375\277\277\277\277\077", 9) == -1); in test_utf8()
116 assert(charset_mbtowc(charset, &wc, "\375\277\277\277\277\377", 9) == -1); in test_utf8()
118 assert(charset_mbtowc(charset, &wc, "\376\277\277\277\277\277", 9) == -1); in test_utf8()
119 assert(charset_mbtowc(charset, &wc, "\377\277\277\277\277\277", 9) == -1); in test_utf8()
123 assert(charset_wctomb(charset, s, 1u << 31) == -1 && in test_utf8()
152 int wc; in test_ascii() local
155 charset = charset_find("us-ascii"); in test_ascii()
159 wc = 0; in test_ascii()
160 assert(charset_mbtowc(charset, &wc, "\177", 2) == 1 && wc == 127); in test_ascii()
161 assert(charset_mbtowc(charset, &wc, "\200", 2) == -1); in test_ascii()
165 assert(charset_wctomb(charset, s, 256) == -1 && !strcmp(s, "..")); in test_ascii()
166 assert(charset_wctomb(charset, s, 255) == -1); in test_ascii()
167 assert(charset_wctomb(charset, s, 128) == -1); in test_ascii()
174 int wc; in test_iso1() local
177 charset = charset_find("iso-8859-1"); in test_iso1()
181 wc = 0; in test_iso1()
182 assert(charset_mbtowc(charset, &wc, "\302\200", 9) == 1 && wc == 0xc2); in test_iso1()
186 assert(charset_wctomb(charset, s, 256) == -1 && !strcmp(s, "..")); in test_iso1()
194 int wc; in test_iso2() local
197 charset = charset_find("iso-8859-2"); in test_iso2()
201 wc = 0; in test_iso2()
202 assert(charset_mbtowc(charset, &wc, "\302\200", 9) == 1 && wc == 0xc2); in test_iso2()
203 assert(charset_mbtowc(charset, &wc, "\377", 2) == 1 && wc == 0x2d9); in test_iso2()
207 assert(charset_wctomb(charset, s, 256) == -1 && !strcmp(s, "..")); in test_iso2()
208 assert(charset_wctomb(charset, s, 255) == -1 && !strcmp(s, "..")); in test_iso2()
222 assert(charset_convert("UTF-8", "UTF-8", p, 10, &q, &n) == 0 && in test_convert()
224 assert(charset_convert("UTF-8", "UTF-8", "x\301\277y", 4, &q, &n) == 2 && in test_convert()
226 assert(charset_convert("UTF-8", "UTF-8", "x\301\277y", 4, 0, &n) == 2 && in test_convert()
228 assert(charset_convert("UTF-8", "UTF-8", "x\301\277y", 4, &q, 0) == 2 && in test_convert()
230 assert(charset_convert("UTF-8", "iso-8859-1", in test_convert()
233 assert(charset_convert("iso-8859-1", "UTF-8", in test_convert()
236 assert(charset_convert("iso-8859-1", "iso-8859-1", in test_convert()
240 assert(charset_convert("iso-8859-2", "utf-8", "\300", 1, &q, &n) == 0 && in test_convert()
242 assert(charset_convert("utf-8", "iso-8859-2", "\305\224", 2, &q, &n) == 0 && in test_convert()
248 assert(charset_convert("iso-8859-2", "utf-8", s, 256, &q, &n) == 0); in test_convert()
249 assert(charset_convert("utf-8", "iso-8859-2", q, n, &r, &n2) == 0); in test_convert()