Branch Coverage

blib/lib/IO/Uncompress/Base.pm
Criterion Covered Total %
branch 291 360 80.8


line true false branch
39 441 43890 if (defined *$self->{'InputLength'})
41 173 268 if *$self->{'InputLengthRemaining'} <= 0
45 14165 29993 if (length *$self->{'Prime'})
48 11871 2294 if (length $$out == $size)
50 136 11735 if defined *$self->{'InputLength'}
59 15871 16416 if (defined *$self->{'FH'}) { }
0 16416 elsif (defined *$self->{'InputEvent'}) { }
60 2294 13577 if ($offset) { }
69 724 1570 if defined $status and $status > 0
79 0 0 if ($got = *$self->{'InputEvent'}->($$out, $get_size)) <= 0
82 0 0 if (length $$out > $size)
87 0 0 if $got <= 0
92 0 16416 unless defined $$buf
94 0 16416 if (*$self->{'ConsumeInput'}) { }
101 132 32155 if defined *$self->{'InputLength'}
103 0 32287 unless (defined $status)
108 0 32287 length $$out < 0 ? :
117 3270 8336 if not defined $_[0] or length $_[0] == 0
119 4511 3825 if (defined *$self->{'FH'} or defined *$self->{'InputEvent'}) { }
126 0 3825 if ($len > *$self->{'BufferOffset'}) { }
147 72 48 if (defined *$self->{'FH'}) { }
150 0 48 if ($position == 2) { }
0 48 elsif ($position == 1) { }
160 0 48 if $truncate
170 0 0 if (defined *$self->{'FH'}) { }
181 36 24 if (defined *$self->{'FH'}) { }
184 36 0 if defined *$self->{'FH'}->write($out_data, length $out_data)
204 1478 13413 if length *$self->{'Prime'} or *$self->{'PushMode'}
206 7305 6108 if (defined *$self->{'FH'}) { }
0 6108 elsif (defined *$self->{'InputEvent'}) { }
221 102 7203 if length $buffer
274 3335 95 @_ ? :
373 568 2964 if *$self->{'OneShot'}
375 32 3500 unless $got->parse($Valid, @_)
378 0 3500 unless $self->postCheckParams($got)
391 5 0 unless @_ or $got
398 2964 678 unless ($got)
400 0 2952 unless $got = $obj->checkParams($class, undef, @_)
406 0 3625 unless $obj->ckInputParam($class, $inValue, 1)
412 0 3625 unless $obj->ckParams($got)
414 1450 2175 if ($inType eq 'buffer' or $inType eq 'code') { }
416 0 1450 if $inType eq "code"
420 468 1707 if ($inType eq 'handle') { }
425 15 453 if $got->getValue("scan")
431 27 1680 if $got->getValue("scan")
433 5 1702 unless *$obj->{'FH'} = "IO::File"->new("$mode $inValue")
452 70 3550 $got->parsed('inputlength') ? :
484 0 3620 if (*$obj->{'ConsumeInput'})
493 27 3592 unless defined $status
499 0 3592 if *$obj->{'Pause'}
501 3291 301 if ($status) { }
510 6 3285 if ($status < 0)
514 2821 470 if length $out_buffer
519 31 270 unless *$obj->{'Transparent'}
542 5 3625 unless $inType
568 10 718 unless @_ >= 1
576 50 568 unless my $x = "IO::Compress::Base::Validator"->new($class, *$obj->{'Error'}, $name, $input, $output)
579 0 568 if $haveOut and $x->{'Hash'}
583 0 548 unless my $got = $obj->checkParams($name, undef, @_)
586 10 538 if ($got->parsed("trailingdata"))
633 10 538 if ($x->{'GlobMap'})
639 0 30 unless $obj->_singleTarget($x, $from, $to, @_)
646 40 498 unless ($x->{'oneOutput'})
651 20 20 $inFile ? :
653 20 20 $x->{'oneInput'} ? :
658 0 70 unless $obj->_singleTarget($x, $in, $output, @_)
692 130 468 if ($x->{'outType'} eq 'filename') { }
85 383 elsif ($x->{'outType'} eq 'handle') { }
313 70 elsif ($x->{'outType'} eq 'buffer') { }
695 30 100 if $x->{'Got'}->getValue("append")
696 10 120 unless $x->{'fh'} = "IO::File"->new("$mode $output")
705 30 55 if ($x->{'Got'}->getValue("append"))
706 0 30 unless CORE::seek $x->{'fh'}, 0, 2
715 273 40 unless $x->{'Got'}->getValue("append")
719 528 60 if ($x->{'oneInput'}) { }
721 32 496 unless defined $self->_rd2($x, $input, $output)
726 0 60 $x->{'inType'} eq 'hash' ? :
728 0 150 unless defined $self->_rd2($x, $element, $output)
734 190 366 if ($x->{'outType'} eq "filename" and $output ne "-" or $x->{'outType'} eq "handle" and $x->{'Got'}->getValue("autoclose"))
737 0 190 unless $x->{'fh'}->close
753 14 664 unless $z->_create($x->{'Got'}, 1, $input, @_)
762 265 463 if ($fh)
764 0 265 unless print $fh ${$x->{'buff'};}
770 100 582 unless ($x->{'oneOutput'})
773 70 30 if ($ot eq 'array') { }
0 30 elsif ($ot eq 'hash') { }
782 626 56 if $status < 0 or $z->smartEof
785 38 18 unless *$self->{'MultiStream'}
790 0 18 unless $status == 1
793 18 646 if $status < 0
797 10 636 if defined *$self->{'TrailingData'}
799 0 646 unless $z->close
807 4375 0 if ref $_[0]
821 90 145 wantarray ? :
830 101 4726 if (defined *$self->{'CompressedInputLength'})
831 22 79 if (*$self->{'CompressedInputLengthRemaining'} == 0)
841 0 4805 if $status == -1
844 12 4793 if ($status == 0)
867 0 6544 if *$self->{'Closed'}
868 0 6544 if *$self->{'EndStream'}
873 541 6003 if (*$self->{'Plain'})
877 0 541 if $len == -1
880 260 281 if ($len == 0) { }
891 1176 4827 if (*$self->{'NewStream'})
893 0 1176 unless $self->gotoNextStream > 0
908 12 4815 if $status == -1
912 4815 0 if ($status == 0)
914 4815 0 defined $$buffer ? :
920 4815 0 if *$self->{'Uncomp'}{'ConsumesInput'}
923 4 4811 if $self->saveStatus($status) == -1
925 0 4811 unless $self->postBlockChk($buffer, $before_len) == 0
928 4811 0 defined $$buffer ? :
946 3968 843 if ($status == 1)
953 2824 1144 if (*$self->{'Info'}{'TrailerLength'})
958 3924 44 if ($got == $trailer_size) { }
959 6 3918 unless $self->chkTrailer($trailer) == 0
965 12 32 if *$self->{'Strict'}
971 1378 2572 unless ($self->smartEof)
974 942 436 if (*$self->{'MultiStream'})
1012 1 597 if *$self->{'Plain'}
1015 191 406 unless $status == 1
1019 330 0 unless $self =~ /IO::Uncompress::RawInflate/ or *$self->{'MultiStream'}
1031 271 1502 unless (*$self->{'NewStream'})
1040 0 271 if $status < 0
1054 194 1579 if (not defined $magic) { }
1055 191 3 if (not *$self->{'Transparent'} or $self->eof)
1074 0 1579 unless (defined *$self->{'Info'})
1088 0 1260 unless defined *$self->{'InfoList'}
1101 6 332735 if (defined *$self->{'ReadStatus'})
1108 10 332725 if *$self->{'Closed'}
1112 4695 328030 if (ref $_[0]) { }
1114 0 4695 if &Scalar::Util::readonly(${$_[0];})
1116 0 4695 unless ref $_[0] eq "SCALAR"
1121 5 328025 if &Scalar::Util::readonly($_[0])
1130 161620 171100 if (not *$self->{'AppendOutput'}) { }
2208 168892 elsif (not defined $$buffer) { }
1131 161585 35 if (not $offset) { }
1136 10 25 if ($offset > length $$buffer) { }
1148 3274 3987 if not length *$self->{'Pending'} and *$self->{'EndStream'}
1151 20 329426 if defined $length and $length == 0
1155 5 329421 if $length < 0
1160 7002 322419 unless ($length or $offset)
1161 3401 3601 if (length *$self->{'Pending'}) { }
1184 0 2494 if $buf_len < 0
1188 783 321636 if length $out_buffer < $length
1191 110 322309 if $length == 0
1194 0 322309 unless defined $$buffer
1198 161609 160700 if *$self->{'AppendOutput'}
1215 55 1425 unless (defined $/)
1222 85 0 if (ref $/ eq "SCALAR" and ${$/;} =~ /^\d+$/ and ${$/;} > 0)
1230 60 1280 unless (length $/)
1233 50 0 if ($paragraph =~ s/^(.*?\n\n+)//s)
1248 1242 33 if ($offset >= 0)
1264 0 2035 if (defined *$self->{'ReadStatus'})
1271 555 232 if *$self->{'Closed'} or not length *$self->{'Pending'} and *$self->{'EndStream'}
1280 28 1452 if $status < 0 or length $$lineref == 0
1291 0 110 unless wantarray
1300 30 129 if wantarray
1308 60 45 if $self->read($buf, 1)
1315 0 2921 unless defined *$self->{'Pending'}
1324 24 10 if (defined *$self->{'FH'} or defined *$self->{'InputEvent'}) { }
1349 250 883 if (*$self->{'Plain'}) { }
1358 36 1097 if $pending > $in
1368 2730 3580 if *$self->{'Closed'}
1370 3580 0 if $] >= "5.008"
1375 2129 1451 if (defined *$self->{'FH'})
1376 1941 188 if (!*$self->{'Handle'} || *$self->{'AutoClose'} and not *$self->{'StdIO'})
1381 0 1941 if not *$self->{'InNew'} and $self->saveStatus($!) != 0
1409 21 85 if ($whence == 0) { }
63 22 elsif ($whence == 1) { }
11 11 elsif ($whence == 2) { }
1424 26 58 if ($target == $here)
1429 10 16 if (*$self->{'Plain'})
1431 5 5 if *$self->{'FH'}
1437 11 47 if $target < $here
1447 47 0 if $offset == 0
1451 47 0 $offset == 0 ? :
1459 30 5 defined *$self->{'FH'} ? :
1481 0 10 defined *$self->{'FH'} ? :
1489 0 80 if @_