Branch Coverage

UTF8.xs
Criterion Covered Total %
branch 108 172 62.7


line true false branch
44 1024 2048 if (cp > 0x10FFFF) {
48 2048 0 else if ((cp & 0xF800) == 0xD800) {
71 3728 2622 while (len-- > 0) {
75 1106 2622 if (len) {
77 0 1106 if (d == dstop) {
85 287 2335 if (fatal)
105 0 21 PUSHMARK(SP);
106 0 21 EXTEND(SP, 2);
116 0 21 if (count != 1)
121 9 12 if (SvUTF8(str))
127 21 0 FREETMPS;
138 2339 1604 (void)SvUPGRADE(dsv, SVt_PV);
139 3941 2 (void)SvGROW(dsv, off + 1);
2339 1602 (void)SvGROW(dsv, off + 1);
150 2335 2578 if (do_warn) {
156 16 2562 if (fallback) {
168 1608 970 if (off == len) {
172 970 0 } while (len);
186 3361 2 (void)SvUPGRADE(dsv, SVt_PV);
187 3363 0 (void)SvGROW(dsv, off + 1);
3361 2 (void)SvGROW(dsv, off + 1);
197 287 3080 if (skip == (STRLEN) -1) {
199 286 1 if (UTF8_IS_START(*src)) {
201 272 14 if (n > len)
203 579 286 while (skip < n && UTF8_IS_CONTINUATION(src[skip]))
579 0 while (skip < n && UTF8_IS_CONTINUATION(src[skip]))
208 3072 8 if (do_warn)
213 5 3 if (fallback) {
215 0 5 UV usv = (v <= 0x10FFFF && (v & 0xF800) != 0xD800) ? v : 0;
0 0 UV usv = (v <= 0x10FFFF && (v & 0xF800) != 0xD800) ? v : 0;
226 4 4 if (off == len) {
230 4 0 } while (len);
239 12 1 if (append)
242 1 12 (void)SvUPGRADE(dsv, SVt_PV);
243 13 0 (void)SvGROW(dsv, off + len * 2 + 1);
1 12 (void)SvGROW(dsv, off + len * 2 + 1);
246 31 13 for (; src < end; src++) {
248 23 8 if (c < 0x80)
265 0 0 while (p < e && *p < 0x80)
0 0 while (p < e && *p < 0x80)
268 0 0 if (p != e) {
274 0 0 while (p < e)
277 0 0 if (SvLEN(sv) < size + 1) {
284 0 0 for (s += off, e--; e >= s; e--) {
286 0 0 if (c < 0x80)
303 3 0 (void)SvUPGRADE(dsv, SVt_PV);
304 3 0 (void)SvGROW(dsv, len + 1);
3 0 (void)SvGROW(dsv, len + 1);
307 26 2 while (s < e) {
309 14 12 if (c < 0x80)
312 1 11 if ((c & 0xFE) != 0xC2)
316 0 11 if ((c & 0xC0) != 0x80)
321 1 1 if (s < e + 1) {
322 1 0 if (*s < 0x80)
353 0 4289 reuse_sv = SvPV_stealable(octets);
0 0 reuse_sv = SvPV_stealable(octets);
0 0 reuse_sv = SvPV_stealable(octets);
0 0 reuse_sv = SvPV_stealable(octets);
354 3 4286 if (SvUTF8(octets)) {
355 3 0 if (!reuse_sv) {
360 0 2 if (SvCUR(octets) == len) {
367 345 3943 if (utf8_check((const char *)src, len, &off)) {
368 2 343 if (reuse_sv) {
374 343 0 dXSTARG;
377 0 343 PUSHTARG;
381 3943 0 dXSTARG;
384 0 1608 PUSHTARG;
397 0 3706 reuse_sv = SvPV_stealable(string);
0 0 reuse_sv = SvPV_stealable(string);
0 0 reuse_sv = SvPV_stealable(string);
0 0 reuse_sv = SvPV_stealable(string);
398 1 3705 if (!SvUTF8(string)) {
399 0 1 if (reuse_sv) {
405 1 0 dXSTARG;
407 0 1 SvTAINT(TARG);
0 0 SvTAINT(TARG);
408 0 1 PUSHTARG;
413 342 3363 if (utf8_check((const char *)src, len, &off)) {
414 0 342 if (reuse_sv) {
420 342 0 dXSTARG;
423 0 342 PUSHTARG;
427 3363 0 dXSTARG;
429 0 4 PUSHTARG;
441 2 2674 if (SvUTF8(octets)) {
443 1 1 if (!sv_utf8_downgrade(octets, TRUE))
447 340 2335 ST(0) = boolSV(utf8_valid(src, len));