Branch Coverage

blib/lib/Mojo/TFTPd/Connection.pm
Criterion Covered Total %
branch 40 68 58.8


line true false branch
60 2 65551 if $n == 0 and $self->lastop eq 6
61 0 65551 if $self->lastop eq 5
62 2 65549 if $self->{'last_sequence_number'} and $n == $self->{'last_sequence_number'} % 65536
64 65542 7 if ($n == $seq)
70 2 5 if $self->retransmit and $n < $seq
71 3 2 if $self->{'retries'}--
84 0 65546 unless ($n == $seq)
85 0 0 if $self->retransmit and $n < $seq
86 0 0 if $self->{'retries'}--
92 65541 5 if (&blessed($handle) and $handle->isa('Mojo::Asset')) { }
0 5 elsif (not $handle->syswrite($data)) { }
95 0 65541 if $!
101 2 65544 unless (length $data == $self->blocksize)
105 1 65545 if $self->filesize and $self->filesize < $self->blocksize * ($n - 1) + length($data)
130 2 65545 if defined $self->{'last_sequence_number'}
131 65545 0 if $sent or $self->{'retries'}--
141 65545 7 if (&blessed($handle) and $handle->isa('Mojo::Asset')) { }
0 7 elsif (not seek($handle, ($n - 1) * $self->blocksize, 0)) { }
0 7 elsif (not defined $handle->sysread($data, $self->blocksize)) { }
143 0 65545 unless defined $data
152 3 65549 if (length $data < $self->blocksize)
163 1 65551 unless length $data
164 65551 0 if $sent or $self->{'retries'}--
187 5 3 if $self->rfc->{'blksize'}
188 1 7 if $self->rfc->{'timeout'}
189 4 4 if exists $self->rfc->{'tsize'} and $self->filesize
197 8 0 if $sent or $self->{'retries'}--
204 0 0 unless $self->lastop
206 0 0 unless ($self->retransmit)
212 0 0 if $self->lastop == 5
214 0 0 if ($self->_attempt >= $self->retransmit)
221 0 0 if $self->lastop eq 6
222 0 0 if $self->lastop eq 4
223 0 0 if $self->lastop eq 3