Branch Coverage

blib/lib/Net/DHCP/Packet.pm
Criterion Covered Total %
branch 61 132 46.2


line true false branch
74 7 15 if (scalar @_ == 1) { }
84 8 14 if $k =~ /^\d+$/
86 14 0 if ($newargs{$k})
99 8 14 if ($key =~ /^\d+$/)
116 16 27 if $sort
131 0 33 unless exists $Net::DHCP::Packet::DHO_FORMATS{$code}
135 0 33 if ($format eq 'suboption')
142 22 11 if (defined $value and $value ne '')
148 3 30 if ($format eq 'string' or $format eq 'csr') { }
8 22 elsif ($format =~ /s$/) { }
6 16 elsif ($format =~ /2$/) { }
155 1 5 if @values % 2 != 0
160 6 10 if @values != 1
190 26 0 $options{$format} ? :
212 0 0 unless exists $Net::DHCP::Packet::DHO_FORMATS{$code}
215 0 0 unless $Net::DHCP::Packet::DHO_FORMATS{$code} eq 'suboptions'
220 0 0 unless $Net::DHCP::Packet::DHO_FORMATS{$code} eq 'suboptions'
223 0 0 unless exists $Net::DHCP::Packet::SUBOPTION_CODES{$code}
227 0 0 unless exists $Net::DHCP::Packet::SUBOPTION_CODES{$code}{$subcode}
233 0 0 if (defined $value and $value ne '')
239 0 0 if ($format eq 'string') { }
0 0 elsif ($format =~ /s$/) { }
0 0 elsif ($format =~ /2$/) { }
248 0 0 if @values % 2 != 0
253 0 0 if @values != 1
278 0 0 $options{$format} ? :
286 37 12 if exists $self->{'options'}{$key}
295 0 31 unless exists $Net::DHCP::Packet::DHO_FORMATS{$code}
300 0 31 if ($format eq 'suboptions')
306 7 24 unless defined $value_bin
333 24 0 if ($options{$format})
335 0 34 ref $_ ? :
348 0 0 if exists $self->{'options'}{$key}{$subkey}
401 3 2 if (exists $self->{'options'}{$key})
409 3 0 if ($i < @{$self->{'options_order'};})
450 8 0 if ($self->{'isDhcp'})
453 0 8 if (ref $self->{'options'}{$key} eq 'ARRAY') { }
470 2 6 if ($min_padding > 0)
475 1 7 if (length $bytes > 1500)
483 4 0 if ($options and exists $options->{'57'})
489 2 2 if ($max_message_size >= 300 and $max_message_size < 1500)
494 1 1 if (length $bytes > $max_message_size)
514 1 6 if (length $buf < 236)
520 0 6 if (length $buf < 300)
526 1 5 if (length $buf > 1500)
535 5 0 if $self->{'options'}
537 5 0 if $self->{'options_order'}
547 5 0 if (length $opt_buf > 4 and substr($opt_buf, 0, 4) eq "c\202Sc") { }
561 60 20 if $type eq 0
562 4 16 if $type eq 255
571 1 4 if ($type != 255)
576 4 0 if ($pos < $total) { }
600 0 0 if defined $self->comment
636 0 0 if ($key == 53) { }
645 0 0 if (exists $Net::DHCP::Packet::DHO_FORMATS{$key}) { }
658 0 0 exists $Net::DHCP::Packet::REV_DHO_CODES{$key} ? :
675 0 0 unless my(@relay_opt) = @_
692 0 0 unless my $opt_buf = shift()
717 0 0 unless my $clientid = shift()
722 0 0 if ($type == 0)
725 0 0 if ($type == 1)
740 0 0 unless my $sipserv = shift()
748 0 0 if ($type == 1)
761 0 0 if length $results->[-1] > 247
765 0 0 unless defined $mask
779 0 0 unless my $csr = shift()