Branch Coverage

blib/lib/AnyEvent/DNS.pm
Criterion Covered Total %
branch 70 172 40.7


line true false branch
234 0 0 if (($w -= $rr[$_][1]) <= 0)
263 0 0 unless my $ipn = $_[0]
270 0 0 if ($af == 10)
274 0 0 if ($ipn =~ s/^\x00{10}(?:\xff\xff|\x00\x00)//) { }
281 0 0 if ($af == 2)
291 0 0 unless $ip = &_munge_ptr(scalar &AnyEvent::Socket::parse_address($ip))
302 0 0 unless my $ipn = &AnyEvent::Socket::parse_address($ip)
310 0 0 unless my $ptr = &_munge_ptr($ipn)
322 0 0 if $_->[4] eq $ip
325 0 0 unless --$cnt
326 0 0 $af == 2 ? :
329 0 0 unless $cnt
460 0 5 $_->[1] > 0 ? :
0 5 $_->[3] > 0 ? :
519 0 5 unless $req->{'qd'}
520 5 0 unless $req->{'an'}
521 5 0 unless $req->{'ns'}
522 5 0 unless $req->{'ar'}
524 0 5 unless $req->{'qd'}
525 5 0 unless $req->{'an'}
526 5 0 unless $req->{'ns'}
527 5 0 unless $req->{'ar'}
0 5 $EDNS0 ? :
543 0 57 if ++$cnt >= 256
547 1 56 if ($len >= 192) { }
38 18 elsif ($len) { }
549 1 0 if $ptr > $ofs
555 17 1 if $ptr > $ofs
822 2 6 unless ($RESOLVER)
830 0 2 $ENV{'PERL_ANYEVENT_RESOLV_CONF'} ? :
912 2 0 if (socket my $fh4, 2, 2, 0)
918 5 0 if (my $peer = recv($fh4, my $pkt, 4096, 0))
924 2 0 if (socket my $fh6, 10, 2, 0)
930 0 0 if (my $peer = recv($fh6, my $pkt, 4096, 0))
937 0 2 unless $got_socket
979 4 8 if (/^\s*nameserver\s+(\S+)\s*$/i) { }
2 6 elsif (/^\s*domain\s+(\S*)\s*$/i) { }
0 6 elsif (/^\s*search\s+(.*?)\s*$/i) { }
0 6 elsif (/^\s*sortlist\s+(.*?)\s*$/i) { }
0 6 elsif (/^\s*options\s+(.*?)\s*$/i) { }
981 4 0 if (my $ipn = &AnyEvent::Socket::parse_address($ip)) { }
994 0 0 if (/^timeout:(\d+)$/) { }
0 0 elsif (/^attempts:(\d+)$/) { }
0 0 elsif (/^ndots:(\d+)$/) { }
1009 0 2 if $attempts
1022 2 0 if (my($contents) = @_) { }
1050 0 2 if ($^O =~ /cygwin/i) { }
1065 0 0 unless (eval { do { require Net::DNS::Resolver; my $r = 'Net::DNS::Resolver'->new; die unless $r->nameservers; foreach my $s ($r->nameservers) { if (my $ipn = &AnyEvent::Socket::parse_address($s)) { push @{$$self{'server'};}, $ipn; } ; } ; $self->{'search'} = [$r->searchlist]; 1 } })
1071 0 0 unless $r->nameservers
1075 0 0 if (my $ipn = &AnyEvent::Socket::parse_address($s))
1088 0 0 if (open my $fh, 'ipconfig /all |')
1097 0 0 if (s/^\s.*\bdns\b.*://i) { }
0 0 elsif (/^\S/ or /^\s[^:]{16,}: /) { }
1102 0 0 if ($dns and /^\s*(\S+)\s*$/)
1105 0 0 if (my $ipn = &AnyEvent::Socket::parse_address($s)) { }
1124 2 0 if @_
1166 2 7 unless (@{$self->{'server'};})
1169 0 2 $AnyEvent::PROTOCOL{'ipv6'} > $AnyEvent::PROTOCOL{'ipv4'} ? :
1190 0 5 unless $res = &dns_unpack($res)
1195 0 5 unless ref $id
1209 0 5 unless $port == 53 and grep(($_ eq $host), @{$$self{'server'};})
1217 0 5 if ($timeout) { }
1239 0 5 unless (my $retry_cfg = $self->{'retry'}[$retry++])
1251 0 0 if $do_retry
1255 0 5 if ($res->{'tc'}) { }
1258 0 0 unless $do_retry
1260 0 0 unless my($fh) = @_
1270 0 0 unless $do_retry
1296 5 0 2 == AnyEvent::Socket::sockaddr_family($sa) ? :
0 5 unless my $fh = 2 == AnyEvent::Socket::sockaddr_family($sa) ? $self->{'fh4'} : $self->{'fh6'}
1307 2 17 if $self->{'inhibit'}
1319 0 27 if (@{$self->{'reuse_q'};} >= 30000)
1328 5 22 if (my $req = shift @{$$self{'queue'};}) { }
5 17 elsif (my $cb = shift @{$$self{'wait'};}) { }
1332 5 0 unless exists $self->{'id'}{$req->[2]}
1375 0 5 if 255 < length $_->[0]
1498 1 0 $qname =~ tr/.// >= $self->{'ndots'} ? :
0 1 $opt{'search'} ? :
4 1 $qname =~ s/\.$// ? :
1503 0 5 $opt{'accept'} ? :
1511 4 5 unless @search
1522 0 5 unless my($res) = @_
1531 1 4 if @rr
1537 0 4 if (@rr) { }
0 4 elsif ($cname) { }
1538 0 0 unless $depth--