Branch Coverage

blib/lib/Net/TFTP.pm
Criterion Covered Total %
branch 7 252 2.7


line true false branch
44 0 0 if @_
51 0 0 if @_
58 0 0 if @_
65 0 0 if @_
72 0 0 if @_
79 0 0 if @_
86 0 0 if @_
106 0 0 lc $_[0] eq 'netascii' ? :
0 0 if @_
114 0 0 exists $self->{'error'} ? :
120 2 0 if @_ % 2
127 1 1 unless defined $local and defined $io
131 1 0 unless (ref $local)
133 1 0 unless ($local)
139 0 0 if $self->{'Mode'} eq 'octet'
143 0 0 if ($len < 0) { }
0 0 elsif (syswrite($local, $pkt, length $pkt) < 0) { }
153 0 0 unless ref $file
156 0 0 unless close $io
159 0 0 exists $self->{'error'} ? :
165 0 0 if @_ % 2
171 0 0 if (defined $local)
173 0 0 unless (ref $local)
174 0 0 unless ($local = 'IO::File'->new($file, 0))
183 0 0 unless defined $local and defined $io
186 0 0 if $self->{'Mode'} eq 'octet'
190 0 0 if ($len < 0) { }
0 0 elsif (($len = syswrite($io, $pkt, length $pkt)) < 0) { }
200 0 0 unless ref $file
203 0 0 unless close $io
206 0 0 exists $self->{'error'} ? :
224 1 0 unless $opts->{'Mode'} eq 'octet'
228 1 0 unless (defined $host)
236 0 0 if ($opts->{'IpMode'} eq 'v6') { }
241 0 0 $host =~ s/:(\d+)$// ? :
246 0 0 if ($opts->{'IpMode'} eq 'v6') { }
249 0 0 unless ($addr)
257 0 0 if ($opts->{'IpMode'} eq 'v6') { }
266 0 0 if ($opts->{'BlockSize'} > 0)
277 0 0 if ($read) { }
284 0 0 if ($tftp->{'IpMode'} eq 'v6') { }
289 0 0 if $opts->{'Debug'}
298 0 0 exists $tied->{'error'} ? :
309 0 0 defined $, ? :
0 0 join(defined $, ? $, : '', @_) . defined($\) ? :
323 0 0 $1 eq "\n" ? :
324 0 0 if $self->{'ascii'}
329 0 0 if _write($self, 1) < 0
340 0 0 if exists $self->{'error'} or not exists $self->{'ibuf'}
347 0 0 if (defined($sep = $/))
349 0 0 unless (length $sep)
355 0 0 if ($offset >= 0)
367 0 0 if $res > 0
369 0 0 if ($res < 0)
393 0 0 if exists $self->{'error'}
396 0 0 unless exists $self->{'ibuf'}
400 0 0 unless ($self->{'eof'})
406 0 0 unless _read($self, 1) > 0
412 0 0 if exists $self->{'error'}
415 0 0 if $_[1] < $ret
419 0 0 if ($ret)
420 0 0 if ($_[2]) { }
434 0 0 if $self->{'eof'} and length $self->{'ibuf'} == 0
442 0 0 if (exists $self->{'sock'} and not exists $self->{'closing'})
444 0 0 if ($self->{'read'}) { }
445 0 0 unless ($self->{'eof'})
447 0 0 if $self->{'Debug'}
449 0 0 if $self->{'peer'}
454 0 0 unless (exists $self->{'error'})
456 0 0 if _write($self) < 0
461 0 0 unless exists $self->{'error'}
466 0 0 unless exists $self->{'error'}
472 0 0 exists $self->{'error'} ? :
482 0 0 if ($Net::TFTP::IO::cr)
484 0 0 if ($ch == 10) { }
0 0 elsif ($ch == 0) { }
496 0 0 if (ord $last eq 13) { }
516 0 0 if exists $self->{'peer'}
531 0 0 if exists $self->{'error'}
532 0 0 if $self->{'eof'}
536 0 0 $wait ? :
540 0 0 if ($select->can_read($timeout))
542 0 0 unless my($peer, $code, $blk) = _recv($self, $ipkt)
545 0 0 unless defined $peer
547 0 0 if ($code == 3) { }
0 0 elsif ($code == 6) { }
0 0 elsif ($code == 5) { }
551 0 0 if ($blk == $self->{'blk'}) { }
0 0 elsif ($blk < $self->{'blk'}) { }
556 0 0 if $self->{'ascii'}
564 0 0 if $self->{'Debug'}
567 0 0 if length $ipkt < $self->{'blksize'} + 4
580 0 0 if $self->{'Debug'}
594 0 0 unless $wait
596 0 0 if ($retry++ >= $self->{'Retries'})
602 0 0 if $self->{'peer'}
604 0 0 if ($self->{'Debug'})
617 0 0 if $bsize < 516
621 0 0 unless $peer
623 0 0 if $self->{'Debug'}
628 0 0 if ($self->{'IpMode'} eq 'v6') { }
638 0 0 if ($code == 6)
643 0 0 if ($self->{'peer'} ne $peer)
648 0 0 if $self->{'Debug'}
660 0 0 if (length $self->{'obuf'} >= $self->{'blksize'}) { }
0 0 elsif (length $self->{'obuf'} == 0 and $self->{'blksize'} == 1) { }
0 0 elsif ($^W) { }
670 0 0 if $self->{'Debug'}
686 0 0 if exists $self->{'error'}
694 0 0 if $self->{'ack'} == $self->{'blk'}
697 0 0 if ($select->can_read($timeout))
699 0 0 unless my($peer, $code, $blk) = _recv($self, $ipkt)
702 0 0 unless defined $peer
704 0 0 if ($code == 6)
709 0 0 if ($code == 4)
710 0 0 if ($self->{'blk'} == $blk) { }
0 0 elsif ($self->{'blk'} > $blk) { }
719 0 0 if ($code == 5)
729 0 0 if ($retry++ >= $self->{'Retries'})
735 0 0 if ($self->{'Debug'})
746 0 0 $send ? :
748 0 0 $code == 5 ? :
0 0 if $code == 3 or $code == 4 or $code == 5
754 0 0 if ($code == 1 or $code == 2 or $code == 6)
756 0 0 unless $code == 6
765 0 0 if $code == 5