examples/compress-zlib/filtinf

filter: Statementstmt 100% 19 / 19 Branchbran 50.0% 5 / 10 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 75.6% 28 / 37 CC 1 SCAR 0.0
CC
1
Cov
78%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/IO/Compress.pm ↑ Summary examples/io/bzip2/bzgrep »
1 #!/usr/local/bin/perl
2  
3 1 ▶use strict ;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings ;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Compress::Zlib ;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶my $x = inflateInit()
Branch: 1 branch
BranchTrueFalseTotal
my $x = &inflateInit() or die "Cannot create a inflation stream\n" 1 0 1
9 or die "Cannot create a inflation stream\n" ;
10  
11 1 my $input = '' ;
12 1 binmode STDIN;
13 1 binmode STDOUT;
14  
15 1 my ($output, $status) ;
16 1 ▶while (read(STDIN, $input, 4096))
Branch: 1 branch
BranchTrueFalseTotal
if (read STDIN, $input, 4096) 1 0 1
17 {
18 1 ($output, $status) = $x->inflate(\$input) ;
19  
20 1 ▶ print $output
Branch: 1 branch
BranchTrueFalseTotal
if $status == Z_OK() or $status == Z_STREAM_END() 1 0 1
Condition33%1/3
$status == Z_OK() or $status == Z_STREAM_END()
l!l&&r!l&&!r
010
MC/DC0%0/2
$status == Z_OK() or $status == Z_STREAM_END()
$status == Z_OK() $status == Z_STREAM_END()
Truth table33%1/3
A or B
A= $status == Z_OK()B= $status == Z_STREAM_END()
ABresult
1X1
011
000
21 if $status == Z_OK or $status == Z_STREAM_END ;
22  
23 1 ▶ last if $status != Z_OK ;
Branch: 1 branch
BranchTrueFalseTotal
if $status != Z_OK() 1 0 1
24 }
25  
26 1 ▶die "inflation failed\n"
Branch: 1 branch
BranchTrueFalseTotal
unless $status == Z_STREAM_END() 0 1 1
27 unless $status == Z_STREAM_END ;
« blib/lib/IO/Compress.pm ↑ Summary examples/io/bzip2/bzgrep »