Branch Coverage

Collate.xs
Criterion Covered Total %
branch 444 578 76.8


line true false branch
102 119507 127 for (rest = (char **)UCA_rest; *rest; ++rest) {
103 0 119507 XPUSHs(sv_2mortal(newSVpv((char *) *rest, 0)));
114 16798 0 if (!OVER_UTF_MAX(uv)){
116 16798 0 if (plane) {
118 16798 0 result = row ? row[uv & 0xff] : NULL;
121 16798 0 if (result) {
125 16798 0 EXTEND(SP, num);
0 16798 EXTEND(SP, num);
126 21884 16798 for (i = 0; i < num; ++i) {
144 58109 0 if (!OVER_UTF_MAX(uv)){
146 58105 4 if (plane) {
148 33900 24205 result = row ? row[uv & 0xff] : NULL;
150 33570 24539 if (result)
154 29006 29103 if (ix)
155 16798 12208 RETVAL = boolSV(num >0);
157 54 29049 RETVAL = boolSV(num==0);
172 571226 0 s = SvPV(src,byte);
173 1972083 571226 for (e = s + byte; s < e;) {
175 511662 1460421 if (! hexdigit)
178 5510887 354057 while (*s) {
180 1106364 4404523 if (! hexdigit)
182 0 4404523 if (overflowed)
184 0 4404523 if (value > MAX_DIV_16) {
190 0 1460421 XPUSHs(sv_2mortal(newSVuv(overflowed ? UV_MAX : value)));
0 1460421 XPUSHs(sv_2mortal(newSVuv(overflowed ? UV_MAX : value)));
200 4454 0 if (!sv || !SvIOK(sv))
0 4454 if (!sv || !SvIOK(sv))
203 4413 41 RETVAL = boolSV(
4394 19 RETVAL = boolSV(
1288 3106 RETVAL = boolSV(
1277 11 RETVAL = boolSV(
815 3568 RETVAL = boolSV(
4 811 RETVAL = boolSV(
226 60 45 EXTEND(SP, tindex ? 3 : 2);
0 105 EXTEND(SP, tindex ? 3 : 2);
0 0 EXTEND(SP, tindex ? 3 : 2);
229 60 45 if (tindex)
241 412 736 if (codeRange(Hangul_SIni, Hangul_SFin)) {
106 306 if (codeRange(Hangul_SIni, Hangul_SFin)) {
242 63 43 if ((code - Hangul_SBase) % Hangul_TCount) {
247 270 772 } else if (uca_vers < 20) {
248 246 24 if (codeRange(Hangul_LIni, Hangul_LFin) || code == Hangul_LFill) {
228 18 if (codeRange(Hangul_LIni, Hangul_LFin) || code == Hangul_LFill) {
6 246 if (codeRange(Hangul_LIni, Hangul_LFin) || code == Hangul_LFill) {
250 210 36 } else if (codeRange(Hangul_VIni, Hangul_VFin)) {
24 186 } else if (codeRange(Hangul_VIni, Hangul_VFin)) {
252 174 48 } else if (codeRange(Hangul_TIni, Hangul_TFin)) {
24 150 } else if (codeRange(Hangul_TIni, Hangul_TFin)) {
258 714 58 if (codeRange(Hangul_LIni, Hangul_LEnd) ||
567 147 if (codeRange(Hangul_LIni, Hangul_LEnd) ||
264 361 if (codeRange(Hangul_LIni, Hangul_LEnd) ||
259 36 228 codeRange(HangulL2Ini, HangulL2Fin)) {
261 531 58 } else if (codeRange(Hangul_VIni, Hangul_VEnd) ||
379 152 } else if (codeRange(Hangul_VIni, Hangul_VEnd) ||
180 257 } else if (codeRange(Hangul_VIni, Hangul_VEnd) ||
262 36 144 codeRange(HangulV2Ini, HangulV2Fin)) {
264 343 58 } else if (codeRange(Hangul_TIni, Hangul_TEnd) ||
237 106 } else if (codeRange(Hangul_TIni, Hangul_TEnd) ||
120 175 } else if (codeRange(Hangul_TIni, Hangul_TEnd) ||
265 36 84 codeRange(HangulT2Ini, HangulT2Fin)) {
297 8649 2774 if (codeRange(CJK_UidIni, CJK_CompFin)) {
5559 3090 if (codeRange(CJK_UidIni, CJK_CompFin)) {
298 748 4811 if (codeRange(CJK_CompIni, CJK_CompFin))
748 0 if (codeRange(CJK_CompIni, CJK_CompFin))
301 3017 1794 basic_unified = (ix >= 9 ? (code <= CJK_UidF110) :
101 1693 basic_unified = (ix >= 9 ? (code <= CJK_UidF110) :
222 1471 basic_unified = (ix >= 9 ? (code <= CJK_UidF110) :
486 985 basic_unified = (ix >= 9 ? (code <= CJK_UidF110) :
248 737 basic_unified = (ix >= 9 ? (code <= CJK_UidF110) :
132 605 basic_unified = (ix >= 9 ? (code <= CJK_UidF110) :
286 319 basic_unified = (ix >= 9 ? (code <= CJK_UidF110) :
310 2906 2958 if (ix >= 7) {
311 1219 1022 tangut = (ix >= 10) ? (codeRange(TangIdeoIni, TangIdeo120) ||
1163 56 tangut = (ix >= 10) ? (codeRange(TangIdeoIni, TangIdeo120) ||
1157 1028 tangut = (ix >= 10) ? (codeRange(TangIdeoIni, TangIdeo120) ||
312 2241 665 codeRange(TangCompIni, TangCompFin)) :
20 1137 codeRange(TangCompIni, TangCompFin)) :
218 447 codeRange(TangCompIni, TangCompFin)) :
313 102 116 (ix >= 9) ? (codeRange(TangIdeoIni, TangIdeo110) ||
77 25 (ix >= 9) ? (codeRange(TangIdeoIni, TangIdeo110) ||
71 122 (ix >= 9) ? (codeRange(TangIdeoIni, TangIdeo110) ||
314 10 61 codeRange(TangCompIni, TangCompFin)) :
315 215 232 (codeRange(TangIdeoIni, TangIdeoFin) ||
177 38 (codeRange(TangIdeoIni, TangIdeoFin) ||
151 258 (codeRange(TangIdeoIni, TangIdeoFin) ||
316 22 129 codeRange(TangCompIni, TangCompFin));
318 2682 3182 if (ix >= 8)
319 1252 1430 nushu = (codeRange(NushuIni, NushuFin));
56 1196 nushu = (codeRange(NushuIni, NushuFin));
321 171 11252 base = tangut
56 11196 base = tangut
3988 7208 base = tangut
5411 1797 base = tangut
327 4503 908 ((codeRange(CJK_ExtAIni, CJK_ExtAFin))
328 1837 4463 ||
329 746 1091 (codeRange(CJK_ExtBIni, CJK_ExtBFin))
330 3453 1756 ||
331 470 2983 (ix >= 3 && codeRange(CJK_ExtCIni, CJK_ExtCFin))
422 48 (ix >= 3 && codeRange(CJK_ExtCIni, CJK_ExtCFin))
332 3104 2057 ||
333 343 2761 (ix >= 4 && codeRange(CJK_ExtDIni, CJK_ExtDFin))
299 44 (ix >= 4 && codeRange(CJK_ExtDIni, CJK_ExtDFin))
334 1506 3611 ||
335 121 1385 (ix >= 6 && codeRange(CJK_ExtEIni, CJK_ExtEFin))
97 24 (ix >= 6 && codeRange(CJK_ExtEIni, CJK_ExtEFin))
336 998 4095 ||
337 49 949 (ix >= 8 && codeRange(CJK_ExtFIni, CJK_ExtFFin)))
16 33 (ix >= 8 && codeRange(CJK_ExtFIni, CJK_ExtFFin)))
340 11252 171 aaaa = tangut || nushu ? base : base + (code >> 15);
11196 56 aaaa = tangut || nushu ? base : base + (code >> 15);
342 171 11252 nushu ? (code - NushuIni) : (code & 0x7FFF)) | 0x8000;
56 11196 nushu ? (code - NushuIni) : (code & 0x7FFF)) | 0x8000;
351 0 11423 EXTEND(SP, 2);
374 0 451 EXTEND(SP, 2);
399 12643 1152 if (CJK_UidIni <= code) {
400 1977 10666 if (codeRange(CJK_CompIni, CJK_CompFin))
548 1429 if (codeRange(CJK_CompIni, CJK_CompFin))
403 10340 1755 basic_unified = (uca_vers >= 38 ? (code <= CJK_UidF110) :
98 1657 basic_unified = (uca_vers >= 38 ? (code <= CJK_UidF110) :
196 1461 basic_unified = (uca_vers >= 38 ? (code <= CJK_UidF110) :
392 1069 basic_unified = (uca_vers >= 38 ? (code <= CJK_UidF110) :
196 873 basic_unified = (uca_vers >= 38 ? (code <= CJK_UidF110) :
98 775 basic_unified = (uca_vers >= 38 ? (code <= CJK_UidF110) :
196 579 basic_unified = (uca_vers >= 38 ? (code <= CJK_UidF110) :
412 3663 10132 RETVAL = boolSV(
3159 504 RETVAL = boolSV(
2553 606 RETVAL = boolSV(
2686 371 RETVAL = boolSV(
1254 1432 RETVAL = boolSV(
324 930 RETVAL = boolSV(
1040 1087 RETVAL = boolSV(
192 848 RETVAL = boolSV(
168 24 RETVAL = boolSV(
921 1182 RETVAL = boolSV(
132 789 RETVAL = boolSV(
110 22 RETVAL = boolSV(
446 1635 RETVAL = boolSV(
48 398 RETVAL = boolSV(
36 12 RETVAL = boolSV(
278 1791 RETVAL = boolSV(
16 262 RETVAL = boolSV(
8 8 RETVAL = boolSV(
446 57449 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
57449 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
451 57449 0 if (SvROK(buf) && SvTYPE(SvRV(buf)) == SVt_PVAV)
57449 0 if (SvROK(buf) && SvTYPE(SvRV(buf)) == SVt_PVAV)
458 1969 55480 if (buf_len < 0) { /* empty: -1 */
463 11814 1969 while (dlen--)
467 55480 0 level = svp ? SvIV(*svp) : MaxLevel;
55480 0 level = svp ? SvIV(*svp) : MaxLevel;
469 155707 55480 for (lv = 0; lv < level; lv++) {
475 2422 53058 upper_lower = svp ? SvTRUE(*svp) : FALSE;
2422 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 2422 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 2422 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 2422 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
2422 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
2422 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
567 1855 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 567 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
1855 567 upper_lower = svp ? SvTRUE(*svp) : FALSE;
0 0 upper_lower = svp ? SvTRUE(*svp) : FALSE;
477 445 55035 kata_hira = svp ? SvTRUE(*svp) : FALSE;
445 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 445 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 445 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 445 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
445 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
445 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
209 236 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 209 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
236 209 kata_hira = svp ? SvTRUE(*svp) : FALSE;
0 0 kata_hira = svp ? SvTRUE(*svp) : FALSE;
479 55480 0 uca_vers = SvIV(*svp);
481 54927 0 v2i = uca_vers >= 9 && svp /* (vers >= 9) and not (non-ignorable) */
482 57 2491 ? !(SvCUR(*svp) == 13 && memEQ(SvPVX(*svp), "non-ignorable", 13))
483 54927 553 : FALSE;
2548 52379 : FALSE;
486 97591 55480 for (i = 0; i <= buf_len; i++) {
489 97591 0 if (svp && SvPOK(*svp))
97591 0 if (svp && SvPOK(*svp))
490 97591 0 v = (U8*)SvPV(*svp, vlen);
494 0 97591 if (vlen < VCE_Length) /* ignore short VCE (unexpected) */
498 90711 6880 if (v2i) {
499 1774 88937 if (*v)
501 7511 81426 else if (v[1] || v[2]) /* non zero primary weight */
212 7299 else if (v[1] || v[2]) /* non zero primary weight */
503 43 7256 else if (last_is_var) /* zero primary weight; skipped */
507 97548 0 if (v[5] == 0) { /* tert wt < 256 */
508 4279 93269 if (upper_lower) {
509 832 3447 if (0x8 <= v[6] && v[6] <= 0xC) /* lower */
571 261 if (0x8 <= v[6] && v[6] <= 0xC) /* lower */
511 2635 1073 else if (0x2 <= v[6] && v[6] <= 0x6) /* upper */
2102 533 else if (0x2 <= v[6] && v[6] <= 0x6) /* upper */
513 57 1549 else if (v[6] == 0x1C) /* square upper */
515 61 1488 else if (v[6] == 0x1D) /* square lower */
518 378 97170 if (kata_hira) {
519 202 176 if (0x0F <= v[6] && v[6] <= 0x13) /* katakana */
202 0 if (0x0F <= v[6] && v[6] <= 0x13) /* katakana */
521 30 146 else if (0xD <= v[6] && v[6] <= 0xE) /* hiragana */
30 0 else if (0xD <= v[6] && v[6] <= 0xE) /* hiragana */
526 281640 97548 for (lv = 0; lv < level; lv++) {
527 176260 105380 if (v[2 * lv + 1] || v[2 * lv + 2]) {
127897 48363 if (v[2 * lv + 1] || v[2 * lv + 2]) {
535 155707 55480 for (lv = 0; lv < level; lv++)
543 55480 0 back_flag = svp ? SvUV(*svp) : (UV)0;
0 55480 back_flag = svp ? SvUV(*svp) : (UV)0;
545 155707 55480 for (lv = 0; lv < level; lv++) {
546 381 155326 if (back_flag & (1 << (lv + 1))) {
549 2139 381 for ( ; e < p; p -= 2) {
557 462276 155326 while (p < e)
560 144990 10717 if (lv + 1 < MaxLevel) { /* lv + 1 == real level */
566 66213 55480 for (lv = level; lv < MaxLevel; lv++) {
567 21450 44763 if (lv + 1 < MaxLevel) { /* lv + 1 == real level */
573 155707 55480 for (lv = 0; lv < level; lv++) {
597 99816 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
99816 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
603 897 98919 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
897 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 897 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 897 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 897 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
897 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
897 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
402 495 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 402 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
495 402 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
0 0 ig_l2 = svp ? SvTRUE(*svp) : FALSE;
606 99816 0 vbl = svp ? *svp : &PL_sv_no;
607 99816 0 a = (U8*)SvPV(vbl, alen);
608 99816 0 v = (U8*)SvPV(vce, vlen);
618 495 99321 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
21 474 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
21 0 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
19 2 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
19 0 if (ig_l2 && !d[1] && !d[2] && (d[3] || d[4])) {
625 99816 0 if (vlen >= VCE_Length && *a != 'n') {
94077 5739 if (vlen >= VCE_Length && *a != 'n') {
626 2121 91956 if (*v) {
627 2062 59 if (*a == 's') { /* shifted or shift-trimmed */
632 91740 216 } else if (*a == 's') { /* shifted or shift-trimmed */
634 91546 194 if (alen == 7 && totwt != 0) { /* shifted */
91525 21 if (alen == 7 && totwt != 0) { /* shifted */
635 7654 83871 if (d[1] == 0 && d[2] == 1) { /* XXX: CollationAuxiliary-6.2.0 */
66 7588 if (d[1] == 0 && d[2] == 1) { /* XXX: CollationAuxiliary-6.2.0 */
640 0 91459 if (!svp)
642 91459 0 uca_vers = SvIV(*svp);
645 76786 14673 if (uca_vers >= 36 && d[3] + d[4] + d[5] + d[6] == 0) {
11014 65772 if (uca_vers >= 36 && d[3] + d[4] + d[5] + d[6] == 0) {
676 246 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
246 0 if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
682 0 246 if (!svp)
684 246 0 uca_vers = SvIV(*svp);
686 246 0 s = (U8*)SvPV(key, klen);
701 2338 246
703 830 1508 for (e = s + klen; s < e; s += 2) {
25 805 for (e = s + klen; s < e; s += 2) {
704 1306 227 uv = (U16)(*s << 8 | s[1]);
115 1191 uv = (U16)(*s << 8 | s[1]);
51 64 uv = (U16)(*s << 8 | s[1]);
711 721 84 *d++ = upperhex[ s[1] & 0xF ];
705 16 *d++ = upperhex[ s[1] & 0xF ];