Branch Coverage

blib/lib/Net/SNMP/Transport.pm
Criterion Covered Total %
branch 25 184 13.5


line true false branch
128 0 2 if (/^-?domain$/i)
134 0 0 if ($key =~ /^$_$/i)
140 0 0 unless (defined $domain)
144 0 0 wantarray ? :
157 0 3 if ($domain eq DOMAIN_UDPIPV6()) { }
0 3 elsif ($domain eq DOMAIN_TCPIPV6()) { }
0 3 elsif ($domain eq DOMAIN_TCPIPV4()) { }
159 0 0 if (defined($error = load_module('Net::SNMP::Transport::IPv6::UDP')))
162 0 0 wantarray ? :
168 0 0 if (defined($error = load_module('Net::SNMP::Transport::IPv6::TCP')))
171 0 0 wantarray ? :
177 0 0 if (defined($error = load_module('Net::SNMP::Transport::IPv4::TCP')))
180 0 0 wantarray ? :
198 0 0 if (@_ < 2)
204 0 0 unless ($size =~ /^\d+$/)
211 0 0 if ($size < MSG_SIZE_MINIMUM() or $size > MSG_SIZE_MAXIMUM())
228 0 0 if (@_ < 2)
234 0 0 unless ($timeout =~ /^\d+(?:\.\d+)?$/)
241 0 0 if ($timeout < TIMEOUT_MINIMUM() or $timeout > TIMEOUT_MAXIMUM())
255 0 0 if (@_ < 2)
261 0 0 unless ($retries =~ /^\d+$/)
268 0 0 if ($retries < RETRIES_MINIMUM() or $retries > RETRIES_MAXIMUM())
290 0 0 $_[1] ? :
0 0 @_ == 2 ? :
305 5 0 defined $_[0]{'_socket'} ? :
320 0 0 if (defined $_[0]{'_socket'}) { }
404 0 0 if (defined $_[0]{'_socket'}) { }
450 0 0 if $AUTOLOAD =~ /::DESTROY$/
454 0 0 if (ref $this) { }
455 0 0 if (defined $$this{'_socket'} and $$this{'_socket'}->can($AUTOLOAD)) { }
478 0 2 unless $this->connectionless
483 2 0 if (defined $$this{'_sock_name'} and exists $$SOCKETS{$$this{'_sock_name'}})
484 2 0 if (--$$SOCKETS{$$this{'_sock_name'}}[_SHARED_REFC()] < 1)
562 0 2 if (/^-?debug$/i) { }
1 1 elsif (/^-?(?:de?st|peer)?port$/i) { }
1 0 elsif (/^-?(?:src|sock|local)port$/i) { }
572 0 2 if (defined $$this{'_error'})
573 0 0 wantarray ? :
581 0 0 if (/^-?domain$/i) { }
0 0 elsif (/^-?hostname$/i or /^-?(?:de?st|peer)?addr$/i) { }
0 0 elsif (/^-?(?:src|sock|local)addr$/i) { }
0 0 elsif (/^-?listen$/i) { }
0 0 elsif (/^-?maxmsgsize$/i or /^-?mtu$/i) { }
0 0 elsif (/^-?retries$/i) { }
0 0 elsif (/^-?timeout$/i) { }
582 0 0 if ($argv{$_} ne $this->domain)
592 0 0 if (defined $dest_port and $dest_port != $$dest_nh{'port'})
602 0 0 if (defined $sock_port and $sock_port != $$sock_nh{'port'})
609 0 0 if (not $argv{$_} =~ /^\d+$/ or $argv{$_} < 1) { }
0 0 elsif (not $this->connectionless) { }
627 0 0 if (defined $$this{'_error'})
628 0 0 wantarray ? :
642 3 0 if (not $this->connectionless && exists $$SOCKETS{$$this{'_sock_name'}}) { }
646 0 3 unless (defined($$this{'_socket'} = $this->_socket_create))
648 0 0 wantarray ? :
655 0 3 unless (defined $$this{'_socket'}->bind($$this{'_sock_name'}))
657 0 0 wantarray ? :
662 0 3 unless ($this->connectionless)
664 0 0 if ($listen) { }
665 0 0 unless (defined $$this{'_socket'}->listen($listen))
667 0 0 wantarray ? :
670 0 0 unless (defined $$this{'_socket'}->connect($$this{'_dest_name'}))
675 0 0 wantarray ? :
689 3 0 if ($this->connectionless)
713 1 2 wantarray ? :
722 0 2 if (not $serv =~ /^\d+$/) { }
0 2 elsif ($serv > 65535) { }
723 0 0 $1 > 65535 ? :
0 0 $serv =~ s/\((\d+)\)$// ? :
725 0 0 unless (defined $$nh{'port'})
752 0 1 unless ($this->connectionless)
756 0 1 if (@_ == 2)
759 0 0 unless (defined $$this{'_sock_name'})
766 0 0 if ($size > $$SOCKETS{$$this{'_sock_name'}}[_SHARED_MAXSIZE()])
784 0 0 unless (defined $$this{'_error'})
785 0 0 @_ > 1 ? :
786 0 0 if ($this->debug)
797 0 0 if ($! =~ /^Unknown error/)
798 0 0 if $^E
801 0 0 if ($!{$_})
808 0 0 $! ? :
815 0 0 unless (defined $$this{'_error'})
817 0 0 $$this{'_error'} ? :
818 0 0 if ($this->debug)
850 0 0 if exists $modules{$module}
852 0 0 if (not eval "require $module") { }
853 0 0 if ($@ =~ /locate (\S+\.pm)/) { }
0 0 elsif ($@ =~ /(.*)\n/) { }
870 0 0 @_ > 1 ? :
872 0 0 if ($DEBUG)
881 3 0 unless $DEBUG
883 0 0 @_ > 1 ? :