Branch Coverage

blib/lib/File/KDBX/IO/HashBlock.pm
Criterion Covered Total %
branch 45 72 62.5


line true false branch
33 83 531 if @_
34 82 56 ref $default eq 'CODE' ? :
41 28 0 @_ % 2 == 1 ? :
43 0 28 unless $self->_fh($args{'fh'})
53 0 107 if $ENV{'DEBUG_STREAM'}
54 51 56 if $self->_finished
57 1 55 if (my $err = $@)
61 39 16 if defined $block
67 0 19 if $ENV{'DEBUG_STREAM'}
68 0 19 if $self->_finished
80 0 28 if $ENV{'DEBUG_STREAM'}
81 17 11 if $self->_mode ne "w"
88 0 11 if $@
94 0 30 if $ENV{'DEBUG_STREAM'}
95 0 30 if $self->_mode ne "w"
102 0 30 if (my $err = $@)
116 0 56 unless &read_all($fh, my $buf, 4)
119 1 55 unless $index == $self->_block_index
121 0 55 unless &read_all($fh, my $hash, 32)
123 0 55 unless &read_all($fh, $buf, 4)
126 16 39 if ($size == 0)
127 0 16 unless $hash eq "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
132 0 39 unless &read_all($fh, my $block, $size)
135 0 39 unless $hash eq $got_hash
147 23 13 if $self->block_size < $size
148 2 34 if $size == 0
153 0 34 unless print $fh $buf
156 0 34 unless print $fh $hash
159 0 34 unless print $fh $buf
162 0 34 unless print $fh $block
173 0 11 unless print $fh $buf
176 0 11 unless print $fh $hash
179 0 11 unless print $fh $buf
187 0 1 if $ENV{'DEBUG_STREAM'}
188 1 0 if (exists &Errno::EPROTO) { }
0 0 elsif (exists &Errno::EIO) { }