Branch Coverage

blib/lib/Archive/Zip/Member.pm
Criterion Covered Total %
branch 222 318 69.8


line true false branch
12 0 26 if ($^O eq 'MSWin32')
55 0 15 if (ref $_[0] eq 'HASH') { }
71 0 314 if (ref $_[0] eq 'HASH') { }
87 0 11 if (ref $_[0] eq 'HASH') { }
112 19 439 $Archive::Zip::UNICODE ? :
149 0 242 if (@_) { }
151 0 0 ref $_[0] eq 'HASH' ? :
164 1 347 if (@_)
166 0 1 ref $_[0] eq 'HASH' ? :
183 0 242 if ($self->desiredCompressionLevel == 1 or $self->desiredCompressionLevel == 2) { }
0 242 elsif ($self->desiredCompressionLevel == 3 or $self->desiredCompressionLevel == 4 or $self->desiredCompressionLevel == 5 or $self->desiredCompressionLevel == 6 or $self->desiredCompressionLevel == 7) { }
0 242 elsif ($self->desiredCompressionLevel == 8 or $self->desiredCompressionLevel == 9) { }
197 5 237 if ($Archive::Zip::UNICODE)
205 3 5 if @_
216 0 1776 ref $_[0] eq 'HASH' ? :
218 614 1162 if (defined $newDesiredCompressionMethod)
220 229 385 if ($newDesiredCompressionMethod == 0) { }
380 5 elsif ($oldDesiredCompressionMethod == 0) { }
222 93 136 if $self->uncompressedSize == 0
234 0 2672 ref $_[0] eq 'HASH' ? :
236 0 2672 if (defined $newDesiredCompressionLevel)
238 0 0 $newDesiredCompressionLevel ? :
250 54 10316 if (defined $newName)
260 35 1042 if ($self->{'bitFlag'} & 2048)
299 22 776 if ($mode & 16384)
327 0 859 if ($format == 1)
333 0 859 if ($format == 18)
335 0 0 if (($attribs & 4026531840) != 1073741824) { }
342 0 4 if ($format == 3 or $format == 2 or $format == 13 or $format == 5 or $format == 16 or $format == 12 or $format == 17)
350 855 0 if $mode != 0 or not $self->localExtraField
377 4 0 if ($format == 0)
386 0 4 if ($mode & 448) == (256 | $attribs << 6)
396 798 61 if (@_)
397 0 798 ref $_[0] eq 'HASH' ? :
399 22 776 if ($self->isDirectory) { }
416 6 796 if (@_) { }
418 0 6 ref $_[0] eq 'HASH' ? :
421 2 4 if ($status != 0) { }
1 3 elsif ($zip64) { }
439 6 254 if (@_) { }
441 0 6 ref $_[0] eq 'HASH' ? :
444 2 4 if ($status != 0) { }
1 3 elsif ($zip64) { }
467 0 242 if (@_) { }
471 0 0 ref $_[0] eq 'HASH' ? :
479 24 583 if (@_)
481 24 0 if ($shouldHave) { }
513 314 27 if (@_)
514 0 314 ref $_[0] eq 'HASH' ? :
516 191 123 $flag ? :
525 0 27 if (@_)
528 0 0 $flag ? :
538 0 54 ref $_[0] eq 'HASH' ? :
542 0 54 if ($^O eq 'MSWin32' and $Archive::Zip::UNICODE) { }
556 5 49 if ($self->isSymbolicLink and 1) { }
560 0 49 if ($^O eq 'MSWin32' and $Archive::Zip::UNICODE) { }
566 0 49 unless $status
569 0 49 unless chmod $self->unixFileAttributes, $name
624 2 40 if (length $extraField < 4 + $dataSize) { }
4 36 elsif ($headerId != 1) { }
636 2 47 if (length $extraField != 0)
641 36 11 if (defined $zip64Data)
658 25 11 if (@_ == 3 and $dataLength == 16) { }
0 11 elsif (@_ == 3 and $dataLength == 24) { }
0 11 elsif (@_ == 3 and $dataLength == 28) { }
0 11 elsif (@_ == 5 and $dataLength == 24) { }
1 10 elsif (@_ == 5 and $dataLength == 28) { }
682 28 8 if ($fields[1] == 4294967295)
687 27 9 if ($fields[2] == 4294967295)
692 7 29 if (@fields > 3 and $fields[3] == 4294967295)
697 1 35 if (@fields > 3 and $fields[4] == 65535)
703 35 1 if ($dataLength == $expDataLength) { }
761 0 337 unless defined $dt
774 0 337 if $@
786 1 372 unless ($time_t)
790 0 373 if ($time_t < $safe_epoch)
821 231 95 if (not $zip64) { }
824 59 172 if ($refresh) { }
67 105 elsif ($hasDataDescriptor) { }
833 0 59 if ($compressedSize > 4294967295)
853 25 70 if ($refresh) { }
31 39 elsif ($hasDataDescriptor) { }
885 0 326 unless $self->_print($fh, $signatureData)
899 0 326 unless $self->_print($fh, $header)
903 267 59 if (not $refresh or $zip64)
904 267 0 if ($fileNameLength)
905 0 267 unless $self->_print($fh, $self->fileNameAsBytes)
908 96 171 if ($localFieldLength)
909 0 96 unless $self->_print($fh, $localExtraField)
930 0 84 unless $fh->seek($self->writeLocalHeaderRelativeOffset, 0)
934 0 84 if $status != 0
936 0 84 unless $fh->seek($here, 0)
966 172 70 if (not $zip64) { }
977 0 70 if ($uncompressedSize > 4294967295)
983 0 70 if ($compressedSize > 4294967295)
990 70 0 if ($localHeaderRelativeOffset > 4294967295 or @extraFieldValues == 0)
1010 0 242 unless $self->_print($fh, $sigData)
1032 0 242 unless $self->_print($fh, $header)
1035 242 0 if ($fileNameLength)
1036 0 242 unless $self->_print($fh, $self->fileNameAsBytes)
1039 71 171 if ($extraFieldLength)
1040 0 71 unless $self->_print($fh, $cdExtraField)
1043 0 242 if ($fileCommentLength)
1044 0 0 unless $self->_print($fh, $self->fileComment)
1076 67 31 if (not $self->zip64) { }
1093 0 98 unless $self->_print($fh, $descriptor)
1101 0 272 ref $_[0] eq 'HASH' ? :
1103 12 260 if ($self->readIsDone)
1109 0 260 unless defined $chunkSize
1110 241 19 if $chunkSize > $self->_readDataRemaining
1116 0 260 unless $status == 0
1118 3 257 if $buffer and $self->isEncrypted
1122 213 47 if ($self->compressionMethod == 0)
1129 253 7 if $self->readIsDone
1161 61 2 if ($self->_readDataRemaining == 0) { }
2 0 elsif ($status == Z_OK()) { }
1182 13 2 unless $status == Z_OK()
1183 15 0 if ($status == Z_OK() or $status == Z_STREAM_END()) { }
1184 13 2 $status == Z_STREAM_END() ? :
1201 63 257 if $self->uncompressedSize == 0
1205 268 52 if $self->compressionMethod == 0
1209 61 259 if ($self->compressionMethod == 0 and $self->desiredCompressionMethod == 8) { }
20 239 elsif ($self->compressionMethod == 8 and $self->desiredCompressionMethod == 0) { }
239 0 elsif ($self->compressionMethod == $self->desiredCompressionMethod) { }
1217 0 61 unless $status == Z_OK()
1227 0 20 unless $status == Z_OK()
1240 268 52 $self->compressionMethod == 0 ? :
1268 6 12 if (defined $newContents) { }
1273 0 0 wantarray ? :
0 6 unless $self->_ISA('Archive::Zip::StringMember')
1283 6 0 wantarray ? :
1288 0 12 if ($status != 0)
1290 0 0 wantarray ? :
1298 11 12 if (length $$ref == $self->uncompressedSize) { }
1306 12 0 if $status == 1
1307 0 12 unless $status == 0
1308 3 9 wantarray ? :
1315 0 56 ref $_[0] eq 'HASH' ? :
1316 49 7 if ref $fhOrName
1319 56 0 if $status == 0
1336 0 242 if $self->fileName eq ''
1352 24 218 if $shouldWriteDataDescriptor
1365 0 242 if $status != 0
1369 0 242 if $status != 0
1372 0 242 if $status != 0
1375 98 144 if ($self->hasDataDescriptor) { }
84 60 elsif ($headerFieldsUnknown) { }
1382 0 242 if $status != 0
1393 7 291 if ($self->isSymbolicLink and 1) { }
1396 2 5 unless symlink $$outRef, $fhOrName
1399 63 228 if $self->uncompressedSize == 0
1405 0 234 if $status != 0 and $status != 1
1407 232 2 if (length $$outRef > 0)
1408 0 232 unless $self->_print($fhOrName, $$outRef)
1412 73 161 if $status == 1
1529 0 3 unless $self->isEncrypted
1532 0 3 unless defined $pass
1544 3 0 $self->{'externalFileAttributes'} ? :
1545 1 2 unless $head[-1] == $x