Branch Coverage

blib/lib/File/KDBX/IO/HmacBlock.pm
Criterion Covered Total %
branch 39 58 67.2


line true false branch
32 55 512 if @_
33 42 43 ref $default eq 'CODE' ? :
40 22 0 @_ % 2 == 1 ? :
42 0 22 unless $self->_fh($args{'fh'})
43 0 22 unless $self->key($args{'key'})
52 0 54 if $ENV{'DEBUG_STREAM'}
53 8 46 if $self->_finished
56 1 45 if (my $err = $@)
60 11 34 if (length $block == 0)
70 0 17 if $ENV{'DEBUG_STREAM'}
71 0 17 if $self->_finished
83 0 22 if $ENV{'DEBUG_STREAM'}
84 12 10 if $self->_mode ne "w"
91 0 10 if $@
97 0 27 if $ENV{'DEBUG_STREAM'}
98 0 27 if $self->_mode ne "w"
105 0 27 if (my $err = $@)
115 0 1 if $ENV{'DEBUG_STREAM'}
116 1 0 if (exists &Errno::EPROTO) { }
0 0 elsif (exists &Errno::EIO) { }
131 1 45 unless &read_all($fh, my $hmac, 32)
133 0 45 unless &read_all($fh, my $packed_size, 4)
137 34 11 if (0 < $size)
138 0 34 unless &read_all($fh, $block, $size)
149 0 45 unless $hmac eq $got_hmac
163 23 22 if $self->block_size < $size
164 2 43 if $size == 0 and not $allow_empty
167 33 10 if 0 < $size
177 0 43 unless $fh->print($hmac, $packed_size, $block)