Branch Coverage

lib/Devel/MAT/Dumper.xs
Criterion Covered Total %
branch 209 340 61.4


line true false branch
70 0 0 if(!tmpsv)
250 21680 12752 if(s)
294 53469 62004 if(o->op_flags & OPf_KIDS) {
295 59981 53426 for (kid = ((UNOP*)o)->op_first; kid; kid = OpSIBLING(kid)) {
113407 53469 for (kid = ((UNOP*)o)->op_first; kid; kid = OpSIBLING(kid)) {
300 0 115473 if(OP_CLASS(o) == OA_PMOP &&
617 114856 if(OP_CLASS(o) == OA_PMOP &&
583 34 if(OP_CLASS(o) == OA_PMOP &&
303 45 538 o->op_type != OP_SPLIT &&
319 262 58778 write_svptr(fh, SvOBJECT(sv) ? (SV*)SvSTASH(sv) : NULL);
324 5771 0 write_common_sv(fh, (const SV *)gv,
325 0 5771 sizeof(XPVGV) + (isGV_with_GP(gv) ? sizeof(struct gp) : 0));
327 5771 0 if(isGV_with_GP(gv)) {
5771 0 if(isGV_with_GP(gv)) {
338 5771 0 write_svptr(fh, (SV*)GvIO(gv));
5771 0 write_svptr(fh, (SV*)GvIO(gv));
5771 0 write_svptr(fh, (SV*)GvIO(gv));
343 5771 0 write_str(fh, GvFILE(gv));
368 4501 18088 switch(SvTYPE(sv)) {
377 17831 4758 if(SvPOK(sv))
379 0 22589 if(SvOOK(sv)) {
381 0 0 SvOOK_offset(sv, offset);
0 0 SvOOK_offset(sv, offset);
388 22583 6 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
22338 251 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
4758 17831 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
22561 28 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
393 4754 17835 write_uint(fh, SvIOK(sv) ? SvUVX(sv) : 0);
394 251 22338 write_nv(fh, SvNOK(sv) ? SvNVX(sv) : 0.0);
395 17831 4758 write_uint(fh, SvPOK(sv) ? SvCUR(sv) : 0);
405 17831 4758 if(SvPOK(sv)) {
407 17831 0 if(max_string > -1 && len > max_string)
10 17821 if(max_string > -1 && len > max_string)
437 1 5180 int len = (av == PL_curstack) ? (PL_stack_sp - PL_stack_base + 1) :
449 35361 5181 for(i = 0; i < len; i++)
458 927 173 if(HvARRAY(hv)) {
460 29724 927 for(bucket = 0; bucket <= HvMAX(hv); bucket++) {
464 17213 29724 for(he = HvARRAY(hv)[bucket]; he; he = he->hent_next) {
468 5756 11457 if(!HvSHAREKEYS(hv))
487 27628 906 for(bucket = 0; bucket <= HvMAX(hv); bucket++) {
489 17213 27628 for(he = HvARRAY(hv)[bucket]; he; he = he->hent_next) {
491 0 17213 char *key = HePV(he, len);
0 0 char *key = HePV(he, len);
493 11457 5756 write_svptr(fh, is_strtab ? NULL : HeVAL(he));
506 66 794 if(SvOOK(hv) && HvAUX(hv))
66 0 if(SvOOK(hv) && HvAUX(hv))
512 687 173 if(HvARRAY(hv) && nkeys)
666 21 if(HvARRAY(hv) && nkeys)
520 240 0 if(SvOOK(stash) && HvAUX(stash))
240 0 if(SvOOK(stash) && HvAUX(stash))
524 175 65 if(mro_meta) {
551 65 175 int nkeys = write_hv_header(fh, stash,
562 240 0 write_str(fh, HvNAME(stash));
240 0 write_str(fh, HvNAME(stash));
0 240 write_str(fh, HvNAME(stash));
0 0 write_str(fh, HvNAME(stash));
240 0 write_str(fh, HvNAME(stash));
0 240 write_str(fh, HvNAME(stash));
565 240 0 if(HvARRAY(stash))
572 2348 2242 PADLIST *pl = (is_xsub ? NULL : CvPADLIST(cv));
586 2348 2242 if(!CvISXSUB(cv) && !CvCONST(cv) && (start = CvSTART(cv))) {
2345 3 if(!CvISXSUB(cv) && !CvCONST(cv) && (start = CvSTART(cv))) {
2125 220 if(!CvISXSUB(cv) && !CvCONST(cv) && (start = CvSTART(cv))) {
587 2018 107 if(start->op_type == OP_NEXTSTATE)
591 4401 189 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
2348 2242 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
4491 99 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
4191 399 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
4590 0 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
605 2348 2242 if(!is_xsub && !CvCONST(cv))
2345 3 if(!is_xsub && !CvCONST(cv))
615 0 4590 if(CvNAMED(cv))
627 1590 3000 if(CvCONST(cv))
633 4484 106 if(CvFILE(cv))
639 0 4590 if(CvNAMED(cv))
646 1 4589 if(cv == PL_main_cv && PL_main_root)
1 0 if(cv == PL_main_cv && PL_main_root)
651 2347 2242 else if(!is_xsub && !CvCONST(cv) && CvROOT(cv))
2344 3 else if(!is_xsub && !CvCONST(cv) && CvROOT(cv))
2020 324 else if(!is_xsub && !CvCONST(cv) && CvROOT(cv))
655 2128 2462 if(pl) {
668 18556 2128 for(padix = 1; padix <= padix_max; padix++) {
670 559 17997 if(!pn)
678 3429 14568 if(PadnameFLAGS(pn)) {
681 767 2662 if(PadnameOUTER(pn)) flags |= 0x01;
682 61 3368 if(PadnameIsSTATE(pn)) flags |= 0x02;
683 2573 856 if(PadnameLVALUE(pn)) flags |= 0x04;
684 0 3429 if(PadnameFLAGS(pn) & PADNAMEt_TYPED) flags |= 0x08;
685 419 3010 if(PadnameFLAGS(pn) & PADNAMEt_OUR) flags |= 0x10;
687 3429 0 if(flags) {
708 2138 2128 for(depth = 1; depth <= PadlistMAX(pl); depth++) {
720 0 4590 FREETMPS;
809 0 0 while(p <= SP) {
810 0 0 unsigned char type = SvIV(p[0]);
811 0 0 switch(type) {
816 0 0 write_strn(fh, SvPV_nolen(p[3]), SvCUR(p[3])); /* annotation */
832 0 1983 if((he = hv_fetch_ent(helper_per_package, classname, 0, 0)))
833 0 0 helper = (DMD_Helper *)SvUV(HeVAL(he));
835 0 1983 if(helper) {
841 0 0 if(ret > 0)
844 0 0 FREETMPS;
862 23143 2296 type = SvROK(sv) ? PMAT_SVtREF : PMAT_SVtSCALAR; break;
882 306 794 if(HvNAME(sv))
240 66 if(HvNAME(sv))
0 240 if(HvNAME(sv))
0 0 if(HvNAME(sv))
240 0 if(HvNAME(sv))
0 240 if(HvNAME(sv))
0 240 if(HvNAME(sv))
898 23143 35897 if(type == PMAT_SVtSCALAR && !SvOK(sv))
554 22589 if(type == PMAT_SVtSCALAR && !SvOK(sv))
554 0 if(type == PMAT_SVtSCALAR && !SvOK(sv))
554 0 if(type == PMAT_SVtSCALAR && !SvOK(sv))
933 4831 54209 if(SvMAGICAL(sv)) {
935 4831 4831 for(mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
941 2 4829 if(mg->mg_len == HEf_SVKEY)
947 0 4831 if(mg->mg_type == PERL_MAGIC_ext &&
0 0 if(mg->mg_type == PERL_MAGIC_ext &&
948 0 0 mg->mg_ptr && mg->mg_len != HEf_SVKEY) {
954 0 0 if(he)
955 0 0 helper = (DMD_MagicHelper *)SvUV(HeVAL(he));
957 0 0 if(helper) {
963 0 0 if(ret > 0)
966 0 0 FREETMPS;
973 262 58778 if(SvOBJECT(sv)) {
975 0 2245 for(SSize_t i = 0; i <= AvFILL(linearized_mro); i++)
1983 262 for(SSize_t i = 0; i <= AvFILL(linearized_mro); i++)
1022 0 0 if(!ctx->structdefs)
1026 0 0 if(!SvOK(idsv)) {
0 0 if(!SvOK(idsv)) {
0 0 if(!SvOK(idsv)) {
1036 0 0 for(size_t i = 0; i < nfields; i++) {
1049 0 0 write_svptr(fh, NUM2PTR(SV *, SvIV(idsv))); /* abuse the stash pointer to store the descriptor ID */
1052 0 0 for(size_t i = 0; i < nfields; i++)
1139 1 0 max_string = SvIV(get_sv("Devel::MAT::Dumper::MAX_STRING", GV_ADD));
1308 0 1 if(moreroots)
1309 0 0 nroots += (AvFILL(moreroots)+1) / 2;
1314 63 1 for(i = 0; i < sizeof(roots) / sizeof(roots[0]); i++) {
1318 0 1 if(moreroots) {
1320 0 0 int max = AvFILL(moreroots);
1322 0 0 for(i = 0; i < max; i += 2) {
1323 0 0 write_str(fh, SvPV_nolen(svp[i]));
1331 2 1 for(sp = PL_stack_base; sp <= PL_stack_sp; sp++)
1338 350 1 for(arena = PL_sv_arenaroot; arena; arena = (SV *)SvANY(arena)) {
1342 59150 350 for(sv = arena + 1; sv < arenaend; sv++) {
1343 0 59150 if(sv == tmpsv)
1346 110 59040 switch(SvTYPE(sv)) {
1353 1 59039 if(sv == (const SV *)PL_defstash)
1359 0 1 if(!seen_defstash)
1370 4592 1 while(saveix) {
1378 4591 1 if(type <= SAVEt_ARG0_MAX)
1380 0 4591 else if(type <= SAVEt_ARG1_MAX)
1382 0 0 else if(type <= SAVEt_ARG2_MAX)
1384 0 0 else if(type <= SAVEt_MAX)
1391 4591 1 ANY *a0 = count > 0 ? &PL_savestack[saveix ] : NULL,
1392 0 4592 *a1 = count > 1 ? &PL_savestack[saveix+1] : NULL,
1393 0 4592 *a2 = count > 2 ? &PL_savestack[saveix+2] : NULL;
1486 0 0 if(a1->any_ptr != (SV **) &(GvGP((GV *)a0->any_ptr)->gp_cv)) {
1500 0 0 if(a0->any_ptr == &GvSV(PL_defgv)) {
1524 0 1 if(!cx)
1534 0 0 write_str(fh, CopFILE(oldcop));
1550 0 0 if(CxOLD_OP_TYPE(cx) == OP_ENTEREVAL) {
1555 0 0 write_str(fh, CopFILE(oldcop));
1558 0 0 else if(cx->blk_eval.old_namesv)
1566 0 0 write_str(fh, CopFILE(oldcop));
1580 4 1 for(SSize_t i = 0; i <= PL_tmps_ix; i++) {
1586 0 1 if(ctx.structdefs)
1597 0 1 if(!fh)
1610 0 2 if((svp = hv_fetchs(PL_modglobal, "Devel::MAT::Dumper/%helper_per_package", 0)))
1617 0 2 if((svp = hv_fetchs(PL_modglobal, "Devel::MAT::Dumper/%helper_per_magic", 0)))