File Coverage

examples/compress-zlib/filtinf
Criterion Covered Total %
statement 19 19 100.0
branch 4 8 50.0
condition 1 3 33.3
subroutine 3 3 100.0
pod n/a
total 27 33 81.8


line stmt bran cond sub pod time code
1             #!/usr/local/bin/perl
2              
3 1     1   3589 use strict ;
  1         1  
  1         30  
4 1     1   3 use warnings ;
  1         1  
  1         35  
5              
6 1     1   449 use Compress::Zlib ;
  1         3  
  1         1340  
7              
8 1 50       122312 my $x = inflateInit()
9             or die "Cannot create a inflation stream\n" ;
10              
11 1         2 my $input = '' ;
12 1         3 binmode STDIN;
13 1         1 binmode STDOUT;
14              
15 1         1 my ($output, $status) ;
16 1         1811941 while (read(STDIN, $input, 4096))
17             {
18 1         19 ($output, $status) = $x->inflate(\$input) ;
19              
20 1 50 33     16 print $output
21             if $status == Z_OK or $status == Z_STREAM_END ;
22              
23 1 50       68 last if $status != Z_OK ;
24             }
25              
26 1 50       6 die "inflation failed\n"
27             unless $status == Z_STREAM_END ;