Branch Coverage

blib/lib/Digest/SHA.pm
Criterion Covered Total %
branch 51 90 56.6


line true false branch
44 22 5 if defined $alg
45 9 18 if (ref $class)
46 7 2 if (not defined $alg or $alg == $class->algorithm)
50 2 0 &shainit($class, $alg) ? :
52 4 14 unless defined $alg
60 38 661 unless (defined $nbits)
64 0 699 if $nbits > length($data) * 8
85 1 0 unless (defined $_can_T_filehandle)
88 0 1 $@ ? :
89 1 0 $_can_T_filehandle ? :
91 0 0 $_can_T_filehandle ? :
104 0 2 unless defined $n
112 2 4 unless ref \$file eq "SCALAR"
114 4 0 defined $mode ? :
124 0 4 if ($file eq '-') { }
125 0 0 if (-d STDIN)
126 0 0 unless sysopen FH, getcwd(), 2
129 0 0 unless open FH, "< -"
133 0 4 -d $file ? :
0 4 unless sysopen FH, $file, -d $file ? 2 : 0
137 2 2 if ($BITS)
143 0 2 unless defined $n
148 2 0 if $binary or $UNIVERSAL
149 1 1 if ($UNIVERSAL and _istext(*FH, $file)) { }
161 0 4 unless my $alg = $self->algorithm
162 0 4 unless my $state = $self->_getstate
163 2 2 $alg <= 256 ? :
164 2 2 $alg <= 256 ? :
165 2 2 $alg <= 256 ? :
169 0 32 unless defined $_
191 8 88 if /^(#|$)/
198 0 11 unless grep {$_ == $s{'alg'};} 1, 224, 256, 384, 512, 512224, 512256
199 7 4 $s{'alg'} <= 256 ? :
0 11 unless length $s{'H'} == ($s{'alg'} <= 256 ? 64 : 128)
200 7 4 $s{'alg'} <= 256 ? :
0 11 unless length $s{'block'} == ($s{'alg'} <= 256 ? 128 : 256)
204 0 55 unless 0 <= $s{$_}
205 0 55 unless $s{$_} <= 4294967295
207 7 4 $s{'alg'} <= 256 ? :
0 11 unless $s{'blockcnt'} < ($s{'alg'} <= 256 ? 512 : 1024)
227 0 0 unless my $state = $self->getstate
228 0 0 if not defined $file or $file eq ""
231 0 0 unless open FH, "> $file"
242 0 0 if not defined $file or $file eq ""
245 0 0 unless open FH, "< $file"