Branch Coverage

blib/lib/IO/Uncompress/Unzip.pm
Criterion Covered Total %
branch 104 212 49.0


line true false branch
116 54 421 unless my $magic = $self->ckMagic
119 2 418 unless *$self->{'Info'} = $self->readHeader($magic)
135 47 1340 if length $magic != 4
139 324 1016 unless _isZipMagic($magic)
160 81 1097 if length $offset < $c
165 0 1178 unless $self->smartReadExact(\$buffer, $c)
183 1013 37 if (not defined $name or $hdr->{'Name'} eq $name)
191 11 26 if (*$self->{'ZipData'}{'Streaming'}) { }
197 0 12 if $status <= 0
207 0 12 if $self->saveStatus($status) == -1
211 11 1 if ($status == 1)
219 0 11 unless $self->smartReadExact(\$buffer, $hdr->{'TrailerLength'})
223 0 26 unless $self->fastForward($c)
228 0 37 unless $self->chkTrailer($buffer) == 0
233 0 37 if $self->smartEof
247 939 102 if (*$self->{'ZipData'}{'Streaming'}) { }
251 31 908 if (*$self->{'ZipData'}{'Zip64'}) { }
260 2 937 if $sig != 134695760
274 489 550 if (*$self->{'Strict'})
276 0 489 if $CRC32 != *$self->{'ZipData'}{'CRC32'}
279 0 489 unless $cSize->equal(*$self->{'CompSize'})
282 0 489 unless $uSize->equal(*$self->{'UnCompSize'})
293 0 0 if $got != 4 and *$self->{'Strict'}
295 0 2113 if ($got == 0) { }
0 2113 elsif ($got < 0) { }
0 2113 elsif ($got < 4) { }
309 1725 388 if ($hdr = $headerLookup{$sig}) { }
388 0 elsif ($sig == 67324752) { }
311 0 1725 if (&$hdr($self, $magic) != 0)
312 0 0 if (*$self->{'Strict'}) { }
321 651 1074 if ($sig == 101010256)
349 0 1006 unless $self->smartReadExact(\$buffer, 42)
376 240 766 if ($filename_length)
378 0 240 unless $self->smartReadExact(\$filename, $filename_length)
383 166 840 if ($extra_length)
385 0 166 unless $self->smartReadExact(\$extraField, $extra_length)
390 1 1005 if ($comment_length)
392 0 1 unless $self->smartReadExact(\$comment, $comment_length)
406 0 0 unless $self->smartReadExact(\$buffer, 4)
414 0 0 unless $self->smartReadExact(\$buffer, $size)
431 0 34 unless $self->smartReadExact(\$buffer, 8)
440 0 34 unless $self->fastForward($size)
465 0 34 unless $self->smartReadExact(\$buffer, 16)
486 0 651 unless $self->smartReadExact(\$buffer, 18)
503 0 651 if ($comment_length)
505 0 0 unless $self->smartReadExact(\$comment, $comment_length)
517 0 1377 if length $buffer < 4
532 0 37 if length $magic != 4
537 0 37 unless _isZipMagic($magic)
541 0 37 unless defined $status
551 0 1053 unless $self->smartReadExact(\$buffer, 26)
576 943 110 $gpFlag & 8 && $crc32 == 0 ? :
578 35 1018 $gpFlag & 2048 ? :
580 2 1051 if $gpFlag & 65
583 0 1051 if $gpFlag & 32
589 276 775 if ($filename_length)
591 0 276 unless $self->smartReadExact(\$filename, $filename_length)
594 5 0 if (*$self->{'UnzipData'}{'efs'} and $efs_flag and $] >= "5.008004")
597 1 4 unless eval { do { $filename = Encode::decode_utf8($filename, 1) } }
606 197 853 if ($extra_length)
608 0 197 unless $self->smartReadExact(\$extraField, $extra_length)
613 0 197 if defined $bad
624 47 150 if (defined $Extra{"\cA\000"})
634 16 31 unless ($streamingMode)
637 16 0 if (U64::full32($uncompressedLength->get32bit))
644 16 0 if (U64::full32($compressedLength->get32bit))
657 108 942 unless ($streamingMode)
668 943 107 if ($compressedMethod == 8) { }
32 75 elsif ($compressedMethod == 12) { }
0 75 elsif ($compressedMethod == 95) { }
0 75 elsif ($compressedMethod == 93) { }
0 75 elsif ($compressedMethod == 14) { }
75 0 elsif ($compressedMethod == 0) { }
677 0 32 unless defined $IO::Uncompress::Adapter::Bunzip2::VERSION
688 0 0 unless defined $IO::Uncompress::Adapter::UnXz::VERSION
699 0 0 unless defined $IO::Uncompress::Adapter::UnZstd::VERSION
710 0 0 unless defined $IO::Uncompress::Adapter::UnLzma::VERSION
715 0 0 unless $self->smartReadExact(\$LzmaHeader, 4)
722 0 0 unless $self->smartReadExact(\$LzmaPropertyData, $LzmaPropertiesSize)
725 0 0 unless ($streamingMode)
768 31 911 $zip64 ? :
108 942 !$streamingMode ? :
793 1125 95 if (*$self->{'ZipData'}{'Method'} == 8) { }
817 0 1050 unless defined $time_t
893 0 0 if (ref $size eq 'U64') { }
917 0 0 unless defined $offset
936 0 0 if (U64::full32($compressedLength)) { }
938 0 0 if length $buffer != $extra_length
943 0 0 if defined $got
968 0 0 if (not defined $extra) { }
974 0 0 $is_uncomp ? :
984 0 0 unless $self->smartSeek($here - 20, 0, 0)
989 0 0 unless $self->smartReadExact(\$buffer, 20)
992 0 0 if (unpack("V", $buffer) == 117853008)
997 0 0 unless $self->smartReadExact(\$buffer, 4)
1000 0 0 if (unpack("V", $buffer) == 101075792)
1002 0 0 unless $self->smartReadExact(\$buffer, 8)
1005 0 0 unless $self->smartReadExact(\$buffer, $size)
1033 0 0 unless $self->smartReadExact(\$buffer, 22)
1038 0 0 if (unpack('V', $buffer) == 101010256) { }
1050 0 0 if ($seekTo < 0)
1054 0 0 unless $self->smartSeek($seekTo, 0, 0)
1057 0 0 unless $self->smartReadExact($buffer, $want)
1061 0 0 if ($pos >= 0)
1069 0 0 if $want == $fileLen
1073 0 0 if U64::full32($centralDirOffset)