Branch Coverage

blib/lib/Compress/Zlib.pm
Criterion Covered Total %
branch 118 128 92.2


line true false branch
48 0 0 if $error
78 181 80 if ($value == 0) { }
0 80 elsif ($value == Z_ERRNO() or $value > 2) { }
98 36 164 if ($test_eof)
101 3 33 if $gz->eof and $value == 0
120 2 58 if $mode =~ /(\d)/
121 1 59 if $mode =~ /f/i
122 1 59 if $mode =~ /h/i
123 2 58 if $mode =~ /a/i
125 29 31 $writing ? :
128 1 59 unless isaFilehandle $file or isaFilename $file or ref $file and ref $file eq 'SCALAR'
132 1 58 unless $mode =~ /[rwa]/i
136 29 29 if ($writing) { }
137 1 28 unless $gz = 'IO::Compress::Gzip'->new($file, 'Minimal', 1, 'AutoClose', 1, %defOpts)
142 1 28 unless $gz = 'IO::Uncompress::Gunzip'->new($file, 'Transparent', 1, 'Append', 0, 'AutoClose', 1, 'MultiStream', 1, 'Strict', 0)
152 2 56 if not defined $gz
161 1 33 if $$self[1] ne 'inflate'
164 19 14 defined $_[1] ? :
166 9 24 if ($self->gzeof or $len == 0)
185 9 3 defined $_[0] ? :
193 1 25 if $$self[1] ne 'deflate'
219 5 6 if ($@)
256 1 67 if $$self[1] ne 'inflate'
267 1 2 unless @_ eq 2
274 1 1 if $$self[1] ne 'deflate'
296 3 6 if (ref $_[0]) { }
298 1 2 unless ref $in eq 'SCALAR'
304 2 6 @_ == 2 ? :
306 1 7 unless $x = 'Compress::Raw::Zlib::Deflate'->new(-'AppendOutput', 1, -'Level', $level)
310 0 7 unless $err == Z_OK()
313 0 7 unless $err == Z_OK()
323 4 4 if (ref $_[0]) { }
325 1 3 unless ref $in eq 'SCALAR'
331 0 7 unless $x = 'Compress::Raw::Zlib::Inflate'->new(-'ConsumeInput', 0)
334 1 6 unless $err == Z_STREAM_END()
354 1 10 unless $got->value('Bufsize') >= 1
371 10 0 $status == Z_OK() ? :
372 5 5 wantarray ? :
385 1 11 unless $got->value('Bufsize') >= 1
396 11 0 $status == Z_OK() ? :
398 6 5 wantarray ? :
413 59 1 wantarray ? :
423 10 1 wantarray ? :
436 152 1 wantarray ? :
448 2 2 ref $_[0] ? :
450 0 4 unless IO::Compress::Gzip::gzip($string, \$out, 'Minimal', 1)
461 1 51 if length $$string < 10
467 9 42 unless $magic1 == 31 and $magic2 == 139 and $method == Z_DEFLATED() and not $flags & 224
473 4 38 if ($flags & 4)
475 1 3 if length $$string < 2
480 2 1 if length $$string < $extra_len
487 5 34 if ($flags & 8)
490 4 1 if $name_end == -1
496 8 27 if ($flags & 16)
499 7 1 if $comment_end == -1
505 3 25 if ($flags & 2)
507 2 1 if length $$string < 2
519 47 5 ref $_[0] ? :
521 26 26 unless _removeGzipHeader $string == Z_OK()
524 1 25 length $$string > 4096 ? :
525 0 26 unless my $x = 'Compress::Raw::Zlib::Inflate'->new({-'WindowBits', -MAX_WBITS(), -'Bufsize', $bufsize})
533 1 25 unless $status == Z_STREAM_END()
535 9 16 if (length $$string >= 8) { }
540 4 5 unless $len == length $output and $crc == crc32($output)