Branch Coverage

lib/Encoding/BER.pm
Criterion Covered Total %
branch 157 244 64.3


line true false branch
214 0 0 if (my $f = $$me{'error'}) { }
226 1 0 if (my $f = $$me{'warn'}) { }
238 642 0 unless $$me{'debug'}
253 0 139 unless $CLASS{$class}
254 0 139 unless $TYPE{$type}
291 0 138 unless $me->tag_data_byname($base)
354 66 49 if $$me{'acanonical'} or not $me->behaves_like_a_hash($data)
357 0 115 if ($$data{'type'} eq 'BER_preencoded')
365 5 110 if ($typeval & 32) { }
368 5 0 ref $$data{'value'} ? :
377 1 109 unless ($encfnc)
379 1 0 ref $$data{'type'} ? :
390 114 1 if ($defp and defined $leng) { }
444 1 1 $$data{'value'} ? :
455 44 4 if (defined &Math::BigInt::new)
457 22 22 if ref $val and $val->can('as_hex') or length $val > 8
460 22 26 if ($big) { }
463 9 13 $x->is_neg ? :
464 9 13 if ($sign) { }
468 4 5 if length $x & 1
470 4 5 unless $i[0] & 128
474 6 7 if length $x & 1
476 5 8 if $i[0] & 128
480 5 21 $val < 0 ? :
483 26 10 if $val >= -128 and $val < 128
500 12 0 if (defined &Math::BigInt::new)
502 6 6 if ref $val and $val->can('bcmp') or length $val > 8
505 6 6 if ($big) { }
508 3 3 if length $x & 1
537 0 29 unless $val
538 0 29 if $val eq 'inf'
539 0 29 if $val eq '-inf'
545 0 29 unless defined &POSIX::frexp
550 7 22 if ($mant < 0)
568 29 0 if ($$data{'flavor'} or $$me{'flavor'})
576 147 277 $c ? :
586 17 12 $exp < 0 ? :
589 29 4 if $exp >= -128 and $exp < 128
596 7 22 $sign ? :
598 4 25 if (@exp == 2)
601 0 29 if (@exp == 3)
604 0 29 if (@exp > 3)
620 0 1 ref $val ? :
621 0 1 if $o[0] eq ''
623 1 0 if (@o > 1)
640 0 1 ref $val ? :
641 0 1 if $o[0] eq ''
656 114 1 if ($tnum < 31)
667 115 0 if $len < 128
668 0 0 if $len < 256
669 0 0 if $len < 4096
670 0 0 if $len < 65536
671 0 0 if $len <= 4294967295
692 2 64 unless (defined $data)
699 3 61 if ($me->behaves_like_an_array($data))
706 1 60 if ($me->behaves_like_a_hash($data))
713 51 9 if ($me->smells_like_a_number($data))
715 48 3 int $data == $data ? :
748 157 95 unless $ALLTAG{$name}
760 252 14 unless $th
763 252 14 unless $th
772 16 20 if ($CLASS{$t})
773 20 0 if ($TYPE{$t})
785 3 112 ref $typd ? :
791 2 113 if ($me->smells_like_a_number($tname))
803 0 113 unless ($th)
806 0 113 unless (ref $th)
816 17 96 if (my $ts = $$th{'type'})
827 0 113 if $rclass and $rclass ne $class
832 15 98 if (my $impl = $$th{'implicit'})
836 15 0 if (ref $th) { }
853 110 5 unless $type & 32
856 4 1 unless $fl
857 0 1 if $fl eq 'DER'
858 1 0 if $fl eq 'CER'
868 39 25 unless ref $d
876 71 94 unless ref $d
879 42 52 if UNIVERSAL::isa($d, 'Math::BigInt')
887 21 154 if ref $d and UNIVERSAL::isa($d, 'Math::BigInt')
928 0 10 unless ($val and defined $$val{'type'})
931 0 0 if $eocp
958 0 34 if $havlen < $tlen
961 2 32 if ($typval & 32) { }
965 2 0 if (defined $datlen) { }
970 0 2 unless $t == $datlen
982 0 2 if ($decfnc) { }
993 32 0 if (defined $datlen) { }
1003 0 0 if ($i == -1)
1016 0 32 unless ($typval or $typmore)
1026 0 32 if ($pretty)
1036 0 34 if (my $c = $$me{'decoded_callback'})
1048 33 1 unless $name
1080 33 1 unless $th
1083 33 1 unless $th
1103 34 0 if (ref $th) { }
0 0 elsif ($th) { }
1107 0 34 if (my $impl = $$th{'implicit'})
1110 0 0 if (ref $h) { }
1118 2 32 $ty ? :
1125 0 34 unless defined $tn
1138 34 0 unless ($l1 & 128)
1142 0 0 if ($l1 == 128)
1165 34 0 unless ($tag & 31) == 31
1175 0 0 unless $c & 128
1278 0 27 if defined &Math::BigInt::new and length $data > 4
1280 0 27 if ($big) { }
1282 0 0 if ($sgnd and $sign) { }
1291 27 0 $sgnd ? :
1309 0 23 unless $data
1315 0 23 unless defined &POSIX::frexp
1319 0 23 if $first == 64
1320 0 23 if $first == 65
1322 23 0 if ($first & 128) { }
1324 7 16 $first & 64 ? :
1331 0 23 if ($expl == 4)
1342 0 23 if $base == 1
1343 0 23 if $base == 2
1344 0 23 if $base == 3
1380 0 0 if ($o[0] < 40) { }
0 0 elsif ($o[0] < 80) { }
1431 0 0 if $tag
1449 0 0 unless $fnc