Lines Matching +full:jd +full:- +full:src
3 /*-
31 #include <atf-c.h>
136 { "\\xx", "", -1 }, in ATF_TC_BODY()
156 char s[256], cd[sizeof(s) * 4 + 1], jd[sizeof(cd)], *ol; in ATF_TC_BODY() local
159 for (size_t i = 0; i < sizeof(s) - 1; i++) in ATF_TC_BODY()
161 s[sizeof(s) - 1] = '\0'; in ATF_TC_BODY()
163 ol = setlocale(LC_CTYPE, "ja_JP.UTF-8"); in ATF_TC_BODY()
165 jr = strvisx(jd, s, sizeof(s), VIS_WHITE | VIS_NOLOCALE); in ATF_TC_BODY()
166 ATF_REQUIRE(jr != -1); in ATF_TC_BODY()
172 ATF_REQUIRE(memcmp(jd, cd, jr) == 0); in ATF_TC_BODY()
184 atf_tc_set_md_var(tc, "descr", "Test strvis(3) multi-byte overflow"); in ATF_TC_HEAD()
189 const char src[] = "\xf0\x9f\xa5\x91"; in ATF_TC_BODY() local
191 char dst[sizeof(src) + 1]; in ATF_TC_BODY()
194 setlocale(LC_CTYPE, "en_US.UTF-8"); in ATF_TC_BODY()
201 * a full 4-byte sequence. in ATF_TC_BODY()
203 n = strnvis(dst, 4, src, VIS_SAFE); in ATF_TC_BODY()
205 ATF_REQUIRE(n == -1); in ATF_TC_BODY()
207 n = strnvis(dst, sizeof(src), src, VIS_SAFE); in ATF_TC_BODY()
208 ATF_REQUIRE(n == sizeof(src) - 1); in ATF_TC_BODY()
219 const char src[] = "AAAA"; in ATF_TC_BODY() local
221 char dst[sizeof(src) + 1]; in ATF_TC_BODY()
231 n = strnvis(dst, 4, src, VIS_SAFE | VIS_NOLOCALE); in ATF_TC_BODY()
233 ATF_REQUIRE(n == -1); in ATF_TC_BODY()
235 n = strnvis(dst, sizeof(src), src, VIS_SAFE | VIS_NOLOCALE); in ATF_TC_BODY()
236 ATF_REQUIRE(n == sizeof(src) - 1); in ATF_TC_BODY()