Condition Coverage

blib/lib/Net/Ping.pm
Criterion Covered Total %
condition 89 334 26.6


and 3 conditions

line !l l&&!r l&&r condition
171 7 2 2 $ttl and $ttl < 0 || $ttl > 255
195 35 0 2 defined $data_size and $proto ne 'tcp'
246 0 1 0 $self->{'family'} and $self->{'family'} != $AF_INET6
337 0 0 0 defined $self->{'local_addr'} and $self->{'proto'} eq 'udp' || $self->{'proto'} eq 'icmp'
343 0 0 0 $self->{'proto'} ne 'udp' and $self->{'proto'} ne 'icmp'
0 0 0 $self->{'proto'} ne 'udp' and $self->{'proto'} ne 'icmp' and $self->{'proto'} ne 'tcp'
0 0 0 $self->{'proto'} ne 'udp' and $self->{'proto'} ne 'icmp' and $self->{'proto'} ne 'tcp' and $self->{'proto'} ne 'syn'
358 0 63 0 $_[3] > 0 and $^O eq 'MSWin32'
391 0 0 0 defined $self && ref $self
429 16 0 0 $> and $^O ne 'VMS'
16 0 0 $> and $^O ne 'VMS' and $^O ne 'cygwin'
16 0 0 $^O eq 'MSWin32' || $^O eq 'cygwin' and not _IsAdminUser()
16 0 0 $^O eq 'VMS' and `write sys\$output f\$privilege("SYSPRV")` =~ /FALSE/
516 0 0 3 defined $self && ref $self
570 60 0 0 not defined $host and $self->{'host'}
629 0 0 0 not defined $ip and $self->{'host'}
630 0 0 0 not defined $timeout and $self->{'timeout'}
712 5 0 0 not defined $ip and $self->{'host'}
713 5 0 0 not defined $timeout and $self->{'timeout'}
714 5 0 0 $self->{'message_type'} && $self->{'message_type'} eq 'timestamp'
719 5 0 0 defined $self->{'local_addr'} and not CORE::bind($self->{'fh'}, &_pack_sockaddr_in(0, $self->{'local_addr'}))
767 5 0 9 not $done and $timeout > 0
791 0 0 4 $ip->{'family'} == 2 and $recv_msg_len == 28
793 4 0 0 $ip->{'family'} == $AF_INET6 and $recv_msg_len == 8
801 0 0 0 $ip->{'family'} == $AF_INET6 and $recv_msg_len == 8
816 0 0 4 not $timestamp_msg and $from_type == 0 || $from_type == 129
0 0 0 $timestamp_msg and $from_type == 14
894 28 0 0 not defined $ip and $self->{'host'}
895 28 0 0 not defined $timeout and $self->{'timeout'}
899 2 14 11 not $self->{'econnrefused'} and $! == 111
915 28 0 0 not defined $ip and $self->{'host'}
916 28 0 0 not defined $timeout and $self->{'timeout'}
925 28 0 0 defined $self->{'local_addr'} and not CORE::bind($self->{'fh'}, &_pack_sockaddr_in(0, $self->{'local_addr'}))
943 28 0 0 $! != 115 and $^O ne 'MSWin32' || $! != 11
966 6 0 21 $nfound and vec $wout, $self->{'fh'}->fileno, 1
981 12 0 0 $! == 11 and $^O =~ /cygwin/i
984 1 0 11 not $self->{'econnrefused'} and $! == 111
994 0 0 0 $nfound and vec $wexc, $self->{'fh'}->fileno, 1
1054 0 0 0 &time() < $patience and $child != $self->{'tcp_chld'}
1088 26 15 0 $self->{'proto'} eq 'tcp' and $self->{'tcp_chld'}
1103 0 0 0 not defined $timeout and $self->{'timeout'}
1104 0 0 0 not defined $pingstring and $self->{'pingstring'}
1291 1 0 0 defined $self->{'local_addr'} and not CORE::bind($self->{'fh'}, &_pack_sockaddr_in(0, $self->{'local_addr'}))
1337 1 0 1 not $done and $timeout > 0
1359 0 1 0 not $self->{'econnrefused'} and $! == 111 || $! == 104
1370 0 0 0 $from_ip eq $addr_in and $from_port == $self->{'port_num'}
0 0 0 $from_ip eq $addr_in and $from_port == $self->{'port_num'} and $from_msg eq $msg
1392 0 0 0 not $self->{'econnrefused'} and $! == 111
1426 26 0 0 defined $self->{'local_addr'} and not CORE::bind($fh, &_pack_sockaddr_in(0, $self->{'local_addr'}))
1444 0 0 0 $^O eq 'MSWin32' and $! == 11
1488 0 0 0 defined $self->{'local_addr'} and not CORE::bind($self->{'fh'}, &_pack_sockaddr_in(0, $self->{'local_addr'}))
1531 0 0 0 not $self->{'econnrefused'} and $self->{'bad'}{$host}
0 0 0 not $self->{'econnrefused'} and $self->{'bad'}{$host} and ($! = 111) > 0
0 0 0 not $self->{'econnrefused'} and $self->{'bad'}{$host} and ($! = 111) > 0 and $self->{'bad'}{$host} eq "$!"
1603 8 14 0 not $self->{'econnrefused'} and $self->{'bad'}{$entry->[0]}
22 0 0 not $self->{'econnrefused'} and $self->{'bad'}{$entry->[0]} and ($! = 111) > 0
14 0 0 not $self->{'econnrefused'} and $self->{'bad'}{$entry->[0]} and ($! = 111) > 0 and $self->{'bad'}{$entry->[0]} eq "$!"
1621 1 0 2 not $self->{'econnrefused'} and $! == 111 || $! == 11 && $^O =~ /cygwin/i
1689 0 0 0 keys %{$$self{'syn'};} and $nfound = mselect(my $rout = $rbits, undef, undef, $timeout)
1703 0 0 0 not $self->{'econnrefused'} and $how == 111
1706 0 0 0 $host and $entry->[0] ne $host
1797 0 0 0 defined $port and $port =~ /^\d+$/
1864 60 0 0 defined $h{'port'} and !($h{'port'} =~ /^\d{1,5}$/) || $h{'port'} < 1 || $h{'port'} > 65535
1895 0 0 0 defined $ret and _inet_ntoa($ret) eq $h{'host'}
1973 0 0 0 not defined $family and length $addr <= 16

or 2 conditions

line l !l condition
263 0 0 eval { do { Socket::IPV6_NEXTHOP() } } || 48
268 0 0 eval { do { Socket::IPV6_USE_MIN_MTU() } } || 42
274 0 0 eval { do { Socket::IPV6_RECVPATHMTU() } } || 43
472 0 0 eval { do { Socket::IPV6_USE_MIN_MTU() } } || 43
494 0 0 eval { do { Socket::IPV6_RECVPATHMTU() } } || 43
673 0 1 $self->{'message_type'} || 'echo'
843 0 0 $self->{'from_ip'} || ''
845 0 0 $self->{'from_type'} || 0
0 0 $self->{'from_subcode'} || 0
1747 0 0 $self->{'bad'}{$host} || undef
1800 0 0 'IO::Socket::INET'->new('Proto', 'udp') || (return undef)

or 3 conditions

line l !l&&r !l&&!r condition
105 1 40 0 ref $this || $this
171 1 1 2 $ttl < 0 || $ttl > 255
197 1 1 35 $data_size < $min_datasize or $data_size > $Net::Ping::max_datasize
214 14 1 8 $self->{'proto'} eq 'tcp' or $self->{'proto'} eq 'stream'
216 2 0 0 eval { do { (getprotobyname 'udp')[2] } } || croak(q[Can't udp protocol by name])
219 2 0 0 $self->{'port'} || (getservbyname 'echo', 'udp')[2] || croak(q[Can't get udp echo port by name])
230 9 0 0 eval { do { (getprotobyname 'icmp')[2] } } || croak(q[Can't get icmp protocol by name])
248 1 0 0 eval { do { (getprotobyname 'ipv6-icmp')[2] } } || croak(q[Can't get ipv6-icmp protocol by name])
292 15 0 0 eval { do { (getprotobyname 'tcp')[2] } } || croak(q[Can't get tcp protocol by name])
295 15 0 0 $self->{'port'} || (getservbyname 'echo', 'tcp')[2] || croak(q[Can't get tcp echo port by name])
301 8 0 0 eval { do { (getprotobyname 'tcp')[2] } } || croak(q[Can't get tcp protocol by name])
303 8 0 0 (getservbyname 'echo', 'tcp')[2] || croak(q[Can't get tcp echo port by name])
337 0 0 0 $self->{'proto'} eq 'udp' || $self->{'proto'} eq 'icmp'
371 0 0 0 $nfound or not defined $nfound
0 0 0 $nfound or not defined $nfound or $t <= 0
422 0 0 0 $^O eq 'MSWin32' or $^O eq 'cygwin'
429 0 0 16 $^O eq 'MSWin32' || $^O eq 'cygwin'
0 0 16 $> and $^O ne 'VMS' and $^O ne 'cygwin' or $^O eq 'MSWin32' || $^O eq 'cygwin' and not _IsAdminUser()
0 0 16 $> and $^O ne 'VMS' and $^O ne 'cygwin' or $^O eq 'MSWin32' || $^O eq 'cygwin' and not _IsAdminUser() or $^O eq 'VMS' and `write sys\$output f\$privilege("SYSPRV")` =~ /FALSE/
535 0 0 81 $^O eq 'MSWin32' or $^O eq 'VMS'
571 0 0 60 @_ > 4 or not $host
815 0 4 0 not $Net::Ping::source_verify or $self->ntop($from_ip) eq $self->ntop($ip)
816 4 0 0 $from_type == 0 || $from_type == 129
0 0 0 $from_type == 3 or $from_type == 1
935 0 0 0 connect($self->{'fh'}, $saddr) || $! == 111 && !$self->{'econnrefused'}
943 0 0 0 $^O ne 'MSWin32' || $! != 11
1324 0 1 0 $flush or $connect
1359 1 0 0 $! == 111 || $! == 104
1370 0 0 0 not $Net::Ping::source_verify or $from_ip eq $addr_in and $from_port == $self->{'port_num'} and $from_msg eq $msg
1444 26 0 0 $! == 115 or $^O eq 'MSWin32' and $! == 11
1527 8 0 20 my $host = shift() or $self->{'host'}
1547 8 0 0 $entry->[4] || croak("Corrupted SYN entry for [$host]")
1586 0 22 3 defined $winner_fd or my $nfound = mselect(undef, $wout = $wbits, undef, $timeout)
1593 0 22 165 $wout =~ /^\0*\z/ or vec $wout, $fd, 1
1621 2 0 0 $! == 111 || $! == 11 && $^O =~ /cygwin/i
1703 0 0 0 not $how or not $self->{'econnrefused'} and $how == 111
1746 0 0 0 shift() || croak('Usage> nack($failed_ack_host)')
1864 0 0 0 !($h{'port'} =~ /^\d{1,5}$/) || $h{'port'} < 1 || $h{'port'} > 65535
1973 8 0 0 $family == 2 or not defined $family and length $addr <= 16