Branch Coverage

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


line true false branch
233 0 0 if (($w -= $rr[$_][1]) <= 0)
262 0 0 unless my $ipn = $_[0]
269 0 0 if ($af == 10)
273 0 0 if ($ipn =~ s/^\x00{10}(?:\xff\xff|\x00\x00)//) { }
280 0 0 if ($af == 2)
290 0 0 unless $ip = &_munge_ptr(scalar &AnyEvent::Socket::parse_address($ip))
301 0 0 unless my $ipn = &AnyEvent::Socket::parse_address($ip)
309 0 0 unless my $ptr = &_munge_ptr($ipn)
321 0 0 if $_->[4] eq $ip
324 0 0 unless --$cnt
325 0 0 $af == 2 ? :
328 0 0 unless $cnt
459 0 5 $_->[1] > 0 ? :
0 5 $_->[3] > 0 ? :
518 0 5 unless $req->{'qd'}
519 5 0 unless $req->{'an'}
520 5 0 unless $req->{'ns'}
521 5 0 unless $req->{'ar'}
523 0 5 unless $req->{'qd'}
524 5 0 unless $req->{'an'}
525 5 0 unless $req->{'ns'}
526 5 0 unless $req->{'ar'}
0 5 $EDNS0 ? :
542 0 57 if ++$cnt >= 256
546 1 56 if ($len >= 192) { }
38 18 elsif ($len) { }
548 1 0 if $ptr > $ofs
554 17 1 if $ptr > $ofs
821 2 6 unless ($RESOLVER)
829 0 2 $ENV{'PERL_ANYEVENT_RESOLV_CONF'} ? :
911 2 0 if (socket my $fh4, 2, 2, 0)
917 5 0 if (my $peer = recv($fh4, my $pkt, 4096, 0))
923 2 0 if (socket my $fh6, 10, 2, 0)
929 0 0 if (my $peer = recv($fh6, my $pkt, 4096, 0))
936 0 2 unless $got_socket
978 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) { }
980 4 0 if (my $ipn = &AnyEvent::Socket::parse_address($ip)) { }
993 0 0 if (/^timeout:(\d+)$/) { }
0 0 elsif (/^attempts:(\d+)$/) { }
0 0 elsif (/^ndots:(\d+)$/) { }
1008 0 2 if $attempts
1021 2 0 if (my($contents) = @_) { }
1049 0 2 if ($^O =~ /cygwin/i) { }
1064 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 } })
1070 0 0 unless $r->nameservers
1074 0 0 if (my $ipn = &AnyEvent::Socket::parse_address($s))
1087 0 0 if (open my $fh, 'ipconfig /all |')
1096 0 0 if (s/^\s.*\bdns\b.*://i) { }
0 0 elsif (/^\S/ or /^\s[^:]{16,}: /) { }
1101 0 0 if ($dns and /^\s*(\S+)\s*$/)
1104 0 0 if (my $ipn = &AnyEvent::Socket::parse_address($s)) { }
1123 2 0 if @_
1165 2 7 unless (@{$self->{'server'};})
1168 0 2 $AnyEvent::PROTOCOL{'ipv6'} > $AnyEvent::PROTOCOL{'ipv4'} ? :
1189 0 5 unless $res = &dns_unpack($res)
1194 0 5 unless ref $id
1208 0 5 unless $port == 53 and grep(($_ eq $host), @{$$self{'server'};})
1216 0 5 if ($timeout) { }
1238 0 5 unless (my $retry_cfg = $self->{'retry'}[$retry++])
1250 0 0 if $do_retry
1254 0 5 if ($res->{'tc'}) { }
1257 0 0 unless $do_retry
1259 0 0 unless my($fh) = @_
1269 0 0 unless $do_retry
1295 5 0 2 == AnyEvent::Socket::sockaddr_family($sa) ? :
0 5 unless my $fh = 2 == AnyEvent::Socket::sockaddr_family($sa) ? $self->{'fh4'} : $self->{'fh6'}
1306 2 17 if $self->{'inhibit'}
1318 0 27 if (@{$self->{'reuse_q'};} >= 30000)
1327 5 22 if (my $req = shift @{$$self{'queue'};}) { }
5 17 elsif (my $cb = shift @{$$self{'wait'};}) { }
1331 5 0 unless exists $self->{'id'}{$req->[2]}
1374 0 5 if 255 < length $_->[0]
1497 1 0 $qname =~ tr/.// >= $self->{'ndots'} ? :
0 1 $opt{'search'} ? :
4 1 $qname =~ s/\.$// ? :
1502 0 5 $opt{'accept'} ? :
1510 4 5 unless @search
1521 0 5 unless my($res) = @_
1530 1 4 if @rr
1536 0 4 if (@rr) { }
0 4 elsif ($cname) { }
1537 0 0 unless $depth--