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   5790 use strict ;
  1         2  
  1         39  
4 1     1   28 use warnings ;
  1         2  
  1         54  
5              
6 1     1   687 use Compress::Zlib ;
  1         3  
  1         5381  
7              
8 1 50       403099 my $x = inflateInit()
9             or die "Cannot create a inflation stream\n" ;
10              
11 1         3 my $input = '' ;
12 1         5 binmode STDIN;
13 1         2 binmode STDOUT;
14              
15 1         2 my ($output, $status) ;
16 1         3737876 while (read(STDIN, $input, 4096))
17             {
18 1         17 ($output, $status) = $x->inflate(\$input) ;
19              
20 1 50 33     79 print $output
21             if $status == Z_OK or $status == Z_STREAM_END ;
22              
23 1 50       156 last if $status != Z_OK ;
24             }
25              
26 1 50       9 die "inflation failed\n"
27             unless $status == Z_STREAM_END ;