Branch Coverage

blib/lib/Crypt/FileHandle.pm
Criterion Covered Total %
branch 83 138 60.1


line true false branch
62 0 2 unless (defined $cipher)
67 0 2 unless (ref $cipher)
72 0 2 unless ($cipher->can('start'))
75 0 2 unless ($cipher->can('crypt'))
78 0 2 unless ($cipher->can('finish'))
94 1 1 if (not defined $readsize or $readsize <= 0)
100 0 1 if ($readsize < 16)
112 0 1 if ($self->{$V_STATE} != $STATE_CLOSED)
133 0 1 unless ($self->verify_cipher($cipher))
150 0 1 if (scalar @_ > 0)
151 0 0 unless $self->OPEN(@_)
163 0 0 if $c
185 0 10 if (scalar @_ >= 3) { }
5 5 elsif (scalar @_ == 2) { }
4 1 elsif (scalar @_ == 1) { }
211 4 0 if (defined $expr)
212 3 1 if ($expr =~ /(?:^([<>\+\-\|]+)|(\|)$)/)
228 2 1 if ($fh->opened)
235 1 1 if ($self->{$V_STATE} eq $STATE_ENCRYPT) { }
1 0 elsif ($self->{$V_STATE} eq $STATE_DECRYPT) { }
267 0 2 if @_
279 0 3 if ($self->{$V_STATE} == $STATE_CLOSED)
283 0 3 if ($self->{$V_STATE} == $STATE_DECRYPT)
289 3 0 if ($self->_encrypt_write(@_))
315 0 1 if ($self->{$V_STATE} == $STATE_CLOSED)
319 0 1 if ($self->{$V_STATE} == $STATE_DECRYPT)
328 0 1 unless (defined $buf)
332 0 1 unless (defined $len)
335 0 1 if ($len < 0)
339 1 0 unless (defined $off)
358 0 2 if ($self->{$V_STATE} == $STATE_CLOSED)
362 0 2 if ($self->{$V_STATE} == $STATE_ENCRYPT)
368 0 2 if ($self->{$V_EOF} and length $self->{$V_READ_BUFFER} == 0)
374 2 0 if (defined $/) { }
391 1 1 $index >= 0 ? :
406 0 2 if ($self->{$V_STATE} == $STATE_CLOSED)
410 0 2 if ($self->{$V_STATE} == $STATE_ENCRYPT)
421 0 2 unless (defined $buf)
425 0 2 unless (defined $len)
429 0 2 if ($len < 0)
433 2 0 unless (defined $off)
439 0 1 unless $self->_decrypt_read
454 0 1 unless $self->READ($buf, 1)
473 0 2 if ($self->{$V_STATE} == $STATE_CLOSED)
496 2 0 if (defined $fh)
521 2 1 if ($self->{$V_STATE} == $STATE_CLOSED)
526 1 0 if ($self->{$V_EOF} and length $self->{$V_READ_BUFFER} == 0)
542 0 2 if ($self->{$V_STATE} == $STATE_CLOSED)
545 1 1 if ($self->{$V_STATE} == $STATE_DECRYPT)
568 2 7 if (not defined $mode or $mode =~ /^
1 6 elsif ($mode =~ /^>(?!>)/ or $mode =~ /^\|/) { }
2 4 elsif ($mode =~ /^\+?>>/) { }
4 0 elsif ($mode =~ /^\+[<>]/) { }
602 0 5 unless @_
605 0 5 if ($self->{$V_STATE} == $STATE_CLOSED)
609 0 5 if ($self->{$V_STATE} == $STATE_DECRYPT)
617 5 0 if defined $_
627 5 0 if (defined $ciphertext)
634 0 5 unless (defined $bw)
638 0 5 if ($bw < 0)
641 0 5 if ($bw == 0 and length $ciphertext > 0)
664 1 2 if ($self->{$V_EOF})
677 0 2 unless (defined $br)
681 1 1 if ($br == 0) { }
713 0 4 unless (defined $buf)
717 1 3 unless (defined $len)
721 0 4 if ($len < 0)
725 2 2 unless (defined $off)
738 4 0 if (not defined $$buf) { }