Branch Coverage

blib/lib/Convert/BER.pm
Criterion Covered Total %
branch 131 382 34.2


line true false branch
15 10 0 if ($] >= 5.006)
50 0 10 unless (defined &UNIVERSAL::can)
58 0 0 if exists $done{$pkg}
64 0 0 if @{$pkg . '::ISA';}
66 0 0 if defined &{$pkg . '::' . $meth;}
215 0 376 if $name =~ /\A(?:DESTROY|VERSION)\Z/
218 226 150 if (defined $isa)
219 0 226 unless my $isapkg = $pkg->can('_' . $isa)
223 226 0 unless @{$subpkg . '::ISA';}
225 11 215 unless defined $tag
229 0 376 if (defined &{$subpkg . '::tag';}) { }
230 0 0 unless $subpkg->tag == $tag
249 376 0 unless defined &{$pkg . '::' . $name;}
263 9 35 if ($e < 30)
268 0 35 if ($e & 4292870144)
273 0 35 if $b = $e & 2080768
276 19 16 if $b = $e & 4294967168
286 42 113 @_ == 1 ? :
79 76 ref $package ? :
292 0 155 @_ ? :
301 46 5 if ($_[0] & 255) == $_[0]
302 1 4 if ($_[0] & 65535) == $_[0]
303 4 0 if ($_[0] & 16777215) == $_[0]
309 0 0 @_ ? :
324 0 165 if $npos > CORE::length $$ber[0]
336 142 36 unless (($tag & 31) == 31)
341 16 20 unless ($tag & 18446744073709518848)
346 20 0 unless ($tag & 18446744073701163008)
360 0 199 if $pos >= $len
366 65 134 if (($tag & 31) == 31)
371 0 100 if $pos >= $len
379 0 199 if defined $expect and $tag != $expect
390 0 178 if ($len & 18446744073709551488)
408 0 169 if $pos >= CORE::length $$ber[0]
413 0 169 if ($len & 128)
418 0 0 if $pos + $len > CORE::length $$ber[0]
425 0 0 $len ? :
446 0 30 unless my $tag = eval { do { local $SIG{'__DIE__'}; unpack_tag($ber) } }
462 0 75 if (@_)
489 0 0 if $fmt
493 0 0 if @y != $cnt
525 0 0 @_ ? :
533 0 0 $length > 65535 ? :
545 0 0 unless $$ber[1] < $length
552 0 0 if ($tag == 0 and $len == 0)
562 0 0 if (($tag & 31) == 31) { }
577 0 0 if ($tag & 32)
579 0 0 if ($len < 0) { }
593 0 0 if (/^INTEGER/)
599 0 0 if (/^ENUM/)
605 0 0 if (/^BOOLEAN/)
607 0 0 $tmp ? :
611 0 0 if (/^OBJECT ID/)
617 0 0 if (/^NULL/)
623 0 0 if (/^STRING/)
625 0 0 if ($tmp =~ /[\x00-\x1f\x7f-\xff]/s) { }
634 0 0 if (/^BIT STRING/)
651 0 0 @_ ? :
669 70 0 if eval { do { _encode($ber, \@_) } }
686 35 136 if ref $type eq 'ARRAY'
691 0 171 unless $can
697 136 35 unless defined $tag
700 14 157 if ref $arg eq 'CODE'
703 49 122 if (ref $arg eq 'ARRAY') { }
704 43 6 if ($can = $$data[3]) { }
705 41 2 if defined $tag
713 15 0 if defined $tag
721 122 0 if defined $tag
738 71 0 if eval { do { _decode($ber, \@_) } }
759 35 125 if ref $type eq 'ARRAY'
764 0 160 unless $can
770 125 35 unless defined $tag
773 6 154 if ref $arg eq 'CODE'
776 42 118 if (ref $arg eq 'ARRAY') { }
777 36 6 if ($$data[5]) { }
779 35 1 if defined $tag
787 14 0 if (defined $tag)
789 0 14 unless eval { do { unpack_tag($ber, $tag) } }
798 0 118 unless eval { do { unpack_tag($ber, $tag) if defined $tag; &{$$data[4];}($pkg, $ber, $arg); 1 } }
799 118 0 if defined $tag
825 0 1 unless ref $ber
826 1 0 unless $indef
832 0 1 unless sysread $io, $$ber[0], 1, $pos++
841 0 1 if (($ch & 31) == 31)
843 0 0 unless sysread $io, $$ber[0], 1, $pos++
854 0 1 unless sysread $io, $$ber[0], 1, $pos++
863 0 1 if ($ch & 128)
865 0 0 unless ($len)
871 0 0 if ($p - $pos == 2 and substr($$ber[0], -2) eq "\000\000")
879 0 0 unless my $n = sysread($io, $$ber[0], $len, $pos)
899 0 1 unless $got = sysread($io, $$ber[0], $len, CORE::length $$ber[0])
926 0 1 unless ($len = syswrite($io, $$ber[0], $togo, $pos))
944 0 1 unless eval { do { local($SIG{'PIPE'}) = 'IGNORE'; @_ ? CORE::send($sock, $$ber[0], 0, $_[0]) : CORE::send($sock, $$ber[0], 0) } }
948 1 0 @_ ? :
961 1 0 unless ref $ber
968 0 1 unless defined CORE::recv($sock, $$ber[0], $n, Socket::MSG_PEEK()) and not $!
986 1 0 if (defined($len = eval { do { $$ber[1] = 0; unpack_tag($ber); unpack_length($ber) + $$ber[1] } }) and $len >= $$ber[1])
1001 0 0 unless defined CORE::recv($sock, $$ber[0], $n, Socket::MSG_PEEK()) and not $!
1021 0 1 unless defined $$ber[4] and not $!
1039 0 0 if ref $arg
1088 2 19 $arg ? :
1098 2 19 CORE::unpack('c', Convert::BER::unpack($ber, $len)) ? :
1118 0 0 $arg < 0 ? :
1122 0 0 if $neg
1126 0 0 if $neg
1129 0 0 unless @octet
1131 0 0 $octet[0] & 128 ? :
1133 0 0 $neg ? :
0 0 if $neg != $msb
1150 0 0 $octet[0] & 128 ? :
1155 0 0 if $neg
1161 0 0 if $neg
1181 0 0 if ($v) { }
1182 0 0 if ($v < 0)
1195 0 0 if ($c == 0) { }
0 0 elsif ($c == 255) { }
1198 0 0 if ($ch & 255)
1199 0 0 if ($ch & 128)
1210 0 0 unless ($ch == 255)
1211 0 0 unless ($ch & 128)
1241 0 0 if (ord substr($data, 0, 1) & 128)
1259 0 51 if (ref $arg)
1260 0 0 if UNIVERSAL::isa($arg, 'Math::BigInt')
1263 0 0 if UNIVERSAL::isa($arg, 'Math::BigInteger')
1267 3 48 $arg < 0 ? :
1269 3 48 $neg ? :
1273 2 49 if $msb and not $neg or $neg and not $msb
1284 0 48 if (ref $arg and ref $$arg)
1285 0 0 if UNIVERSAL::isa($$arg, 'Math::BigInt')
1288 0 0 if UNIVERSAL::isa($$arg, 'Math::BigInteger')
1296 3 45 if $val & 1 << $len * 8 - 1
1376 0 33 unless defined $ber2->_encode($arg)
1393 0 30 if length $$ber2[0] != $$ber2[1]
1409 0 2 if (@data < 2) { }
1419 1 5 if ($_ >= 128)
1449 6 1 unless ($ch & 128)
1454 2 0 if (@data)
1489 0 0 unless $tag & 32
1495 0 0 unless ($buf->tag | 32) == $tag
1541 1 3 unless defined $a
1543 0 3 ref $a eq 'CODE' ? :
1545 0 3 unless defined $c
1549 0 1 if @newarg & 1
1559 0 1 if (@$arg & 1) { }
1567 1 0 if (eval { do { Convert::BER::_decode($ber, $ref) } }) { }
1568 0 1 if ref $yes
1571 0 0 if ref $yes
1589 2 6 if ref $n eq 'CODE'
1596 3 5 if (ref $n eq 'HASH') { }
2 3 elsif (ref $n eq 'ARRAY') { }
1655 2 1 if $less
1669 2 1 if $less
1692 0 0 $len > 1 ? :
1708 0 0 if ($arg)
1710 0 0 if ($arg < 0)
1720 0 0 if ($ae < 128) { }
0 0 elsif ($ae < 32768) { }
0 0 elsif ($ae < 8388608) { }
1752 0 0 if $len
1761 0 0 unless ($len)
1768 0 0 if ($byte & 128) { }
0 0 elsif ($byte & 64) { }
0 0 elsif (substr($data, 1) =~ /^\s*([-+]?)0*(\d+(?:\.\d+(?:[Ee][-+]?\d+)?)?)\s*$/) { }
1776 0 0 if $elen == 3
1778 0 0 unless $elen >= 0 and $elen <= 3
1781 0 0 if $exp > 127
1795 0 0 if $exp
1796 0 0 if $byte & 64
1802 0 0 $byte & 1 ? :
1826 0 0 $islocal ? :
1829 0 0 if ($islocal)
1833 0 0 if ($d == 1 or $d < -1) { }
0 0 elsif ($d > 1) { }
1843 0 0 $isgen ? :
1845 0 0 if ($isgen)
1847 0 0 if $split
1855 0 0 if (Convert::BER::STRING::unpack($self, $ber, \$str))
1858 0 0 $isgen ? :
1859 0 0 unless my($Y, $M, $D, $h, $m, $s, $z) = $str =~ /^ (\d{$n}) (\d\d) (\d\d) (\d\d) (\d\d) ((?:\d\d(?:\.\d+)?)?) (Z|[-+]\d{4}) $/x
1869 0 0 if ($z ne 'Z')
1873 0 0 if ($s > int $s)
1877 0 0 if ($isgen) { }
0 0 elsif ($Y <= 50) { }
1894 0 0 if (defined $n)
1896 0 0 if $n < 0 or $i > @$arg
1913 0 0 if ref $type eq 'ARRAY'
1918 0 0 unless $can
1923 0 0 unless defined $tag
1926 0 0 unless $tag == $want
1928 0 0 if (eval { do { Convert::BER::_decode($ber, [@{$arg;}[$i, $i + 1]]) } })
1933 0 0 if $@