Branch Coverage

blib/lib/Net/DHCP/Packet.pm
Criterion Covered Total %
branch 62 140 44.2


line true false branch
76 7 15 if (scalar @_ == 1) { }
86 8 14 if $k =~ /^\d+$/
88 14 0 if ($newargs{$k})
101 8 14 if ($key =~ /^\d+$/)
118 16 27 if $sort
133 0 33 unless exists $Net::DHCP::Packet::DHO_FORMATS{$code}
137 0 33 if ($format eq 'suboption')
144 22 11 if (defined $value and $value ne '')
150 3 30 if ($format eq 'string' or $format eq 'csr') { }
8 22 elsif ($format =~ /s$/) { }
6 16 elsif ($format =~ /2$/) { }
157 1 5 if @values % 2 != 0
162 6 10 if @values != 1
192 26 0 $options{$format} ? :
201 0 0 unless (grep /$key/, @{$$self{'options_order'};})
217 0 0 unless exists $Net::DHCP::Packet::DHO_FORMATS{$code}
220 0 0 unless $Net::DHCP::Packet::DHO_FORMATS{$code} eq 'suboptions'
225 0 0 unless $Net::DHCP::Packet::DHO_FORMATS{$code} eq 'suboptions'
228 0 0 unless exists $Net::DHCP::Packet::SUBOPTION_CODES{$code}
232 0 0 unless exists $Net::DHCP::Packet::SUBOPTION_CODES{$code}{$subcode}
238 0 0 if (defined $value and $value ne '')
244 0 0 if ($format eq 'string') { }
0 0 elsif ($format =~ /s$/) { }
0 0 elsif ($format =~ /2$/) { }
253 0 0 if @values % 2 != 0
258 0 0 if @values != 1
284 0 0 $options{$format} ? :
292 37 12 if exists $self->{'options'}{$key}
301 0 31 unless exists $Net::DHCP::Packet::DHO_FORMATS{$code}
306 0 31 if ($format eq 'suboptions')
312 7 24 unless defined $value_bin
339 24 0 if ($options{$format})
341 0 34 ref $_ ? :
354 0 0 if exists $self->{'options'}{$key}{$subkey}
407 3 2 if (exists $self->{'options'}{$key})
415 3 0 if ($i < @{$self->{'options_order'};})
456 8 0 if ($self->{'isDhcp'})
459 0 8 if (ref $self->{'options'}{$key} eq 'ARRAY') { }
0 8 elsif (ref $self->{'options'}{$key} eq 'HASH') { }
484 2 6 if ($min_padding > 0)
489 1 7 if (length $bytes > 1500)
497 4 0 if ($options and exists $options->{'57'})
503 2 2 if ($max_message_size >= 300 and $max_message_size < 1500)
508 1 1 if (length $bytes > $max_message_size)
528 1 6 if (length $buf < 236)
534 0 6 if (length $buf < 300)
540 1 5 if (length $buf > 1500)
549 5 0 if $self->{'options'}
551 5 0 if $self->{'options_order'}
561 5 0 if (length $opt_buf > 4 and substr($opt_buf, 0, 4) eq "c\202Sc") { }
575 60 20 if $type eq 0
576 4 16 if $type eq 255
585 1 4 if ($type != 255)
590 4 0 if ($pos < $total) { }
614 0 0 if defined $self->comment
650 0 0 if ($key == 53) { }
659 0 0 if (exists $Net::DHCP::Packet::DHO_FORMATS{$key}) { }
660 0 0 if ($Net::DHCP::Packet::DHO_FORMATS{$key} eq 'suboptions') { }
666 0 0 exists $Net::DHCP::Packet::SUBOPTION_CODES{$key} ? :
684 0 0 exists $Net::DHCP::Packet::REV_DHO_CODES{$key} ? :
701 0 0 unless my(@relay_opt) = @_
718 0 0 unless my $opt_buf = shift()
743 0 0 unless my $clientid = shift()
748 0 0 if ($type == 0)
751 0 0 if ($type == 1)
766 0 0 unless my $sipserv = shift()
774 0 0 if ($type == 1)
787 0 0 if length $results->[-1] > 247
791 0 0 unless defined $mask
805 0 0 unless my $csr = shift()