Branch Coverage

perl_impl/blib/lib/Digest/SHA.pm
Criterion Covered Total %
branch 3 82 3.6


line true false branch
43 1 0 if defined $alg
44 0 1 if (ref $class)
45 0 0 if (not defined $alg or $alg == $class->algorithm)
49 0 0 &shainit($class, $alg) ? :
51 0 1 unless defined $alg
59 0 0 unless (defined $nbits)
63 0 0 if $nbits > length($data) * 8
84 0 0 unless (defined $_can_T_filehandle)
87 0 0 $@ ? :
88 0 0 $_can_T_filehandle ? :
90 0 0 $_can_T_filehandle ? :
103 0 0 unless defined $n
111 0 0 unless ref \$file eq "SCALAR"
113 0 0 defined $mode ? :
123 0 0 -d $file ? :
0 0 unless $file eq "-" and open FH, "< -" or sysopen FH, $file, -d $file ? 2 : 0
127 0 0 if ($BITS)
133 0 0 unless defined $n
138 0 0 if $binary or $UNIVERSAL
139 0 0 if ($UNIVERSAL and _istext(*FH, $file)) { }
151 0 0 unless my $alg = $self->algorithm
152 0 0 unless my $state = $self->_getstate
153 0 0 $alg <= 256 ? :
154 0 0 $alg <= 256 ? :
155 0 0 $alg <= 256 ? :
159 0 0 unless defined $_
181 0 0 if /^(#|$)/
188 0 0 unless grep {$_ == $s{'alg'};} 1, 224, 256, 384, 512, 512224, 512256
189 0 0 $s{'alg'} <= 256 ? :
0 0 unless length $s{'H'} == ($s{'alg'} <= 256 ? 64 : 128)
190 0 0 $s{'alg'} <= 256 ? :
0 0 unless length $s{'block'} == ($s{'alg'} <= 256 ? 128 : 256)
194 0 0 unless 0 <= $s{$_}
195 0 0 unless $s{$_} <= 4294967295
197 0 0 $s{'alg'} <= 256 ? :
0 0 unless $s{'blockcnt'} < ($s{'alg'} <= 256 ? 512 : 1024)
217 0 0 unless my $state = $self->getstate
218 0 0 if not defined $file or $file eq ""
221 0 0 unless open FH, "> $file"
232 0 0 if not defined $file or $file eq ""
235 0 0 unless open FH, "< $file"