Branch Coverage

blib/lib/Mojo/TFTPd/Connection.pm
Criterion Covered Total %
branch 42 70 60.0


line true false branch
19 0 6 $ENV{'MOJO_TFTPD_DEBUG'} ? :
163 65545 10 if (UNIVERSAL::isa($FH, 'Mojo::Asset')) { }
165 0 65545 unless defined $data
168 0 10 unless (seek $FH, ($n - 1) * $self->blocksize, 0)
171 0 10 unless (defined read($FH, $data, $self->blocksize))
176 4 65551 if (length $data < $self->blocksize)
189 2 65553 unless length $data
190 65553 0 if $sent or $$self{'retries'}--
209 2 65556 if $n == 0 and $self->lastop eq 6
210 3 65553 if $self->lastop eq 5
211 2 65551 if $$self{'_last_sequence_number'} and $n == $$self{'_last_sequence_number'} % 65536
212 65543 8 if ($n == $seq)
218 2 6 if $self->retransmit and $n < $seq
220 4 2 if $$self{'retries'}--
240 0 65546 unless ($n == $seq)
241 0 0 if $self->retransmit and $n < $seq
242 0 0 if $$self{'retries'}--
247 65541 5 if (UNIVERSAL::isa($FH, 'Mojo::Asset')) { }
250 0 65541 if $!
253 0 5 unless (print $FH $data)
258 2 65544 unless (length $data == $self->blocksize)
262 1 65545 if $self->filesize and $self->filesize < $self->blocksize * ($n - 1) + length($data)
291 2 65545 if defined $$self{'_last_sequence_number'}
292 65545 0 if $sent or $$self{'retries'}--
363 5 3 if $self->rfc->{'blksize'}
364 1 7 if $self->rfc->{'timeout'}
365 4 4 if exists $self->rfc->{'tsize'} and $self->filesize
376 8 0 if $sent or $$self{'retries'}--
390 0 0 unless $self->lastop
392 0 0 unless ($self->retransmit)
398 0 0 if $self->lastop == 5
400 0 0 if ($self->_attempt >= $self->retransmit)
407 0 0 if $self->lastop eq 6
408 0 0 if $self->lastop eq 4
409 0 0 if $self->lastop eq 3