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