Branch Coverage

UTF8.xs
Criterion Covered Total %
branch 108 172 62.7


line true false branch
23 1024 2048 if (cp > 0x10FFFF) {
27 2048 0 else if ((cp & 0xF800) == 0xD800) {
50 3728 2622 while (len-- > 0) {
54 1106 2622 if (len) {
56 0 1106 if (d == dstop) {
64 287 2335 if (fatal)
84 0 21 PUSHMARK(SP);
85 0 21 EXTEND(SP, 2);
95 0 21 if (count != 1)
100 9 12 if (SvUTF8(str))
106 21 0 FREETMPS;
117 2339 1604 (void)SvUPGRADE(dsv, SVt_PV);
118 3941 2 (void)SvGROW(dsv, off + 1);
2339 1602 (void)SvGROW(dsv, off + 1);
129 2335 2578 if (do_warn) {
135 16 2562 if (fallback) {
147 1608 970 if (off == len) {
151 970 0 } while (len);
165 3361 2 (void)SvUPGRADE(dsv, SVt_PV);
166 3363 0 (void)SvGROW(dsv, off + 1);
3361 2 (void)SvGROW(dsv, off + 1);
176 287 3080 if (skip == (STRLEN) -1) {
178 286 1 if (UTF8_IS_START(*src)) {
180 272 14 if (n > len)
182 579 286 while (skip < n && UTF8_IS_CONTINUATION(src[skip]))
579 0 while (skip < n && UTF8_IS_CONTINUATION(src[skip]))
187 3072 8 if (do_warn)
192 5 3 if (fallback) {
194 0 5 UV usv = (v <= 0x10FFFF && (v & 0xF800) != 0xD800) ? v : 0;
0 0 UV usv = (v <= 0x10FFFF && (v & 0xF800) != 0xD800) ? v : 0;
205 4 4 if (off == len) {
209 4 0 } while (len);
218 12 1 if (append)
221 1 12 (void)SvUPGRADE(dsv, SVt_PV);
222 13 0 (void)SvGROW(dsv, off + len * 2 + 1);
1 12 (void)SvGROW(dsv, off + len * 2 + 1);
225 31 13 for (; src < end; src++) {
227 23 8 if (c < 0x80)
244 0 0 while (p < e && *p < 0x80)
0 0 while (p < e && *p < 0x80)
247 0 0 if (p != e) {
253 0 0 while (p < e)
256 0 0 if (SvLEN(sv) < size + 1) {
263 0 0 for (s += off, e--; e >= s; e--) {
265 0 0 if (c < 0x80)
282 3 0 (void)SvUPGRADE(dsv, SVt_PV);
283 3 0 (void)SvGROW(dsv, len + 1);
3 0 (void)SvGROW(dsv, len + 1);
286 26 2 while (s < e) {
288 14 12 if (c < 0x80)
291 1 11 if ((c & 0xFE) != 0xC2)
295 0 11 if ((c & 0xC0) != 0x80)
300 1 1 if (s < e + 1) {
301 1 0 if (*s < 0x80)
332 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);
333 3 4286 if (SvUTF8(octets)) {
334 3 0 if (!reuse_sv) {
339 0 2 if (SvCUR(octets) == len) {
346 345 3943 if (utf8_check_ascii((const char *)src, len, &off)) {
347 2 343 if (reuse_sv) {
353 343 0 dXSTARG;
356 0 343 PUSHTARG;
360 3943 0 dXSTARG;
363 0 1608 PUSHTARG;
376 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);
377 1 3705 if (!SvUTF8(string)) {
378 0 1 if (reuse_sv) {
384 1 0 dXSTARG;
386 0 1 SvTAINT(TARG);
0 0 SvTAINT(TARG);
387 0 1 PUSHTARG;
392 342 3363 if (utf8_check_ascii((const char *)src, len, &off)) {
393 0 342 if (reuse_sv) {
399 342 0 dXSTARG;
402 0 342 PUSHTARG;
406 3363 0 dXSTARG;
408 0 4 PUSHTARG;
420 2 2674 if (SvUTF8(octets)) {
422 1 1 if (!sv_utf8_downgrade(octets, TRUE))
426 340 2335 ST(0) = boolSV(utf8_valid_ascii(src, len));