Branch Coverage

blib/lib/Net/SNMP/PDU.pm
Criterion Covered Total %
branch 45 228 19.7


line true false branch
47 1 1 ref $_[0] ? :
64 0 3 if (/^-?callback$/i) { }
0 3 elsif (/^-?contextengineid/i) { }
0 3 elsif (/^-?contextname/i) { }
0 3 elsif (/^-?debug$/i) { }
0 3 elsif (/^-?leadingdot$/i) { }
0 3 elsif (/^-?maxmsgsize$/i) { }
0 3 elsif (/^-?requestid$/i) { }
1 2 elsif (/^-?security$/i) { }
0 2 elsif (/^-?translate$/i) { }
1 1 elsif (/^-?transport$/i) { }
1 0 elsif (/^-?version$/i) { }
90 0 3 if (defined $$this{'_error'})
91 0 0 wantarray ? :
96 0 2 unless (defined $$this{'_transport'})
98 0 0 wantarray ? :
101 1 1 wantarray ? :
150 0 0 if @_ < 6
154 0 0 if (not defined $enterprise) { }
0 0 elsif (not $enterprise =~ /^\.?\d+(?:\.\d+)* *$/) { }
172 0 0 if (not defined $addr) { }
0 0 elsif (not $addr =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) { }
177 0 0 if (defined $$this{'_transport'})
178 0 0 if ($$this{'_transport'}->domain ne DOMAIN_UDPIPV4() and $$this{'_transport'}->domain ne DOMAIN_TCPIPV4()) { }
184 0 0 if ($$this{'_agent_addr'} eq '0.0.0.0')
189 0 0 unless (exists $$this{'_agent_addr'})
203 0 0 if (not defined $generic) { }
0 0 elsif (not $generic =~ /^\d+$/) { }
219 0 0 if (not defined $specific) { }
0 0 elsif (not $specific =~ /^\d+$/) { }
232 0 0 if (not defined $time) { }
0 0 elsif (not $time =~ /^\d+$/) { }
255 0 0 if (@_ < 3)
261 0 0 if (not defined $repeaters) { }
0 0 elsif (not $repeaters =~ /^\d+$/) { }
0 0 elsif ($repeaters > 2147483647) { }
279 0 0 if (not defined $repetitions) { }
0 0 elsif (not $repetitions =~ /^\d+$/) { }
0 0 elsif ($repetitions > 2147483647) { }
297 0 0 if (defined $oids and ref $oids eq 'ARRAY')
299 0 0 if ($$this{'_error_status'} > @{$oids;})
306 0 0 if ($$this{'_error_status'} == @{$oids;} and $$this{'_error_index'})
359 0 1 unless (defined $this->_prepare_var_bind_list($var_bind || []))
364 0 1 unless (defined $this->_prepare_pdu_sequence($type))
396 0 0 unless defined $this->_process_pdu_sequence
421 0 1 if ($$this{'_pdu_type'} == GET_RESPONSE() or $$this{'_pdu_type'} == TRAP() or $$this{'_pdu_type'} == SNMPV2_TRAP() or $$this{'_pdu_type'} == REPORT())
443 0 0 if (@_ == 2)
444 0 0 unless (defined $status)
447 0 0 $this->version > SNMP_VERSION_1() ? :
0 0 if ($status < 0 or $status > ($this->version > SNMP_VERSION_1() ? 18 : 5))
450 0 0 $this->version > SNMP_VERSION_1() ? :
467 0 0 if (@_ == 2)
468 0 0 unless (defined $index)
471 0 0 if ($index < 0 or $index > 2147483647)
526 0 0 if defined $$this{'_error'}
528 0 0 if (@_ > 1)
540 0 0 if (not defined $vbl or ref $vbl ne 'HASH') { }
561 0 0 if (not defined $types or ref $types ne 'HASH')
566 0 0 exists $$types{$_} ? :
581 0 0 if defined $$this{'_error'} or not defined $$this{'_var_bind_names'}
590 0 0 if defined $$this{'_error'}
606 0 0 if $$this{'_version'} < SNMP_VERSION_3() or $$this{'_scoped'}
609 0 0 unless (defined $this->prepare(OCTET_STRING(), $this->context_name))
614 0 0 unless (defined $this->prepare(OCTET_STRING(), $this->context_engine_id))
619 0 0 unless (defined $this->prepare(SEQUENCE()))
632 0 1 if defined $$this{'_error'}
635 0 1 if @_ != 2
641 1 0 unless (exists $$this{'_request_id'})
648 1 0 if ($$this{'_pdu_type'} != TRAP()) { }
651 0 1 unless (defined $this->prepare(INTEGER(), $$this{'_error_index'}))
656 0 1 unless (defined $this->prepare(INTEGER(), $$this{'_error_status'}))
661 0 1 unless (defined $this->prepare(INTEGER(), $$this{'_request_id'}))
668 0 0 unless (defined $this->prepare(TIMETICKS(), $$this{'_time_stamp'}))
673 0 0 unless (defined $this->prepare(INTEGER(), $$this{'_specific_trap'}))
678 0 0 unless (defined $this->prepare(INTEGER(), $$this{'_generic_trap'}))
683 0 0 unless (defined $this->prepare(IPADDRESS(), $$this{'_agent_addr'}))
688 0 0 unless (defined $this->prepare(OBJECT_IDENTIFIER(), $$this{'_enterprise'}))
695 0 1 unless (defined $this->prepare($$this{'_pdu_type'}))
709 0 1 if (@{$var_bind;} % 4)
737 0 1 unless (defined $this->prepare($syntax_type, $syntax_value))
743 0 1 if ($name_type != OBJECT_IDENTIFIER())
750 0 1 unless (defined $this->prepare($name_type, $name_value))
756 0 1 unless (defined $this->prepare(SEQUENCE()))
780 0 1 unless (defined $this->prepare(SEQUENCE(), $buffer))
792 0 0 unless defined $oids
794 0 0 if (ref $oids ne 'ARRAY')
813 0 1 unless defined $trios
815 0 1 if (ref $trios ne 'ARRAY')
819 0 1 if (@{$trios;} % 3)
839 0 0 if $$this{'_version'} < SNMP_VERSION_3()
842 0 0 unless defined $this->process(SEQUENCE())
845 0 0 unless (defined $this->context_engine_id($this->process(OCTET_STRING())))
850 0 0 unless (defined $this->context_name($this->process(OCTET_STRING())))
863 0 1 unless (defined($$this{'_pdu_type'} = $this->process))
867 1 0 if ($$this{'_pdu_type'} != TRAP()) { }
870 0 1 unless (defined($$this{'_request_id'} = $this->process(INTEGER())))
874 0 1 unless (defined($$this{'_error_status'} = $this->process(INTEGER())))
878 0 1 unless (defined($$this{'_error_index'} = $this->process(INTEGER())))
883 0 1 if ($$this{'_error_status'} and $$this{'_pdu_type'} == GET_RESPONSE())
893 0 0 unless (defined($$this{'_enterprise'} = $this->process(OBJECT_IDENTIFIER())))
897 0 0 unless (defined($$this{'_agent_addr'} = $this->process(IPADDRESS())))
901 0 0 unless (defined($$this{'_generic_trap'} = $this->process(INTEGER())))
905 0 0 unless (defined($$this{'_specific_trap'} = $this->process(INTEGER())))
909 0 0 unless (defined($$this{'_time_stamp'} = $this->process(TIMETICKS())))
925 0 0 unless (defined($value = $this->process(SEQUENCE())))
943 0 0 unless (defined $this->process(SEQUENCE()))
947 0 0 unless (defined($oid = $this->process(OBJECT_IDENTIFIER())))
951 0 0 unless (defined($value = $this->process(undef, $type)))
980 0 0 if ($$this{'_pdu_type'} == REPORT())
1013 0 0 if @_ != 1
1015 0 0 if ($_[0] > $#error_status or $_[0] < 0)
1052 0 0 if ($text =~ s/\Q$_\E/$report_oids{$_}/)
1061 0 0 if ($count == 1) { }
0 0 elsif ($count > 1) { }