Branch Coverage

blib/lib/Sys/HostAddr.pm
Criterion Covered Total %
branch 43 112 38.3


line true false branch
24 0 1 if (@_ % 2) { }
35 1 0 unless $$self{'ipv'}
45 0 0 unless ($$self{'ipv'} == 4)
68 0 0 if (/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/)
77 0 0 if $@
88 0 18 if (/^\s+Description[\s\.]+:\s+([^\r\n]+)/) { }
2 16 elsif (/^([a-z0-9]+(?::[0-9]+)?):?\s+/ and $^O ne 'MSWin32' and $^O ne 'cygwin') { }
104 2 16 if (/^\s+$ipv\s+(?:addr:)?(\S+)\s/) { }
0 16 elsif (/^\s+${ipv}[\s\.]+:\s+([a-f0-9:\.]{3,40})/) { }
0 16 elsif (/^\s+IP Address[\s\.]+:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) { }
0 16 elsif (/^\s+IP Address[\s\.]+:\s+([a-f0-9:\.]{3,40})/) { }
109 0 0 if $$self{'ipv'} eq '4'
111 0 0 if $$self{'ipv'} eq '6'
125 2 16 if ($line =~ /^([a-z0-9]+(?::[0-9]+)?):?\s+/ and $^O ne 'MSWin32' and $^O ne 'cygwin') { }
2 14 elsif ($line =~ /^\s+$ipv\s+(?:addr:)?(\S+)\s/) { }
0 14 elsif ($line =~ /^\s+Description[\s\.]+:\s([^\r\n]+)/) { }
0 14 elsif ($line =~ /^\s+${ipv}[\s\.]+:\s+([a-f0-9:\.]{3,40})/) { }
0 14 elsif ($line =~ /^\s+IP Address[\s\.]+:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) { }
0 14 elsif ($line =~ /^\s+IP Address[\s\.]+:\s+([a-f0-9:\.]{3,40})/) { }
0 14 elsif ($line =~ /^\s+Subnet Mask[\s\.]+:\s+(\S+)/) { }
129 0 2 if ($line =~ /netmask\s+(?:0x)?([a-f0-9]{8})\s/) { }
0 2 elsif ($line =~ /netmask\s+(\S+)/) { }
2 0 elsif ($line =~ /Mask:(\S+)/) { }
0 0 elsif ($$self{'ipv'} eq '6' and $line =~ m[(/\d{1,3})$]) { }
148 0 0 if $$self{'ipv'} eq '4'
150 0 0 if $$self{'ipv'} eq '6'
168 1 1 if (/^\s+$ipv\s+(?:addr:)?(\S+)\s/) { }
0 1 elsif (/^\s+${ipv}[\s\.]+:\s+([a-f0-9:\.]{3,40})/) { }
0 1 elsif (/^\s+IP Address[\s\.]+:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) { }
0 1 elsif (/^\s+IP Address[\s\.]+:\s+([a-f0-9:\.]{3,40})/) { }
173 0 0 if $$self{'ipv'} eq '4'
175 0 0 if $$self{'ipv'} eq '6'
177 1 1 if ($addr)
178 0 1 if $addr =~ /^(?:127\.|::1)/
191 0 4 if ($^O eq 'MSWin32' or $^O eq 'cygwin') { }
197 0 4 if $$self{'ipv'} eq '6' and $^O eq 'solaris'
208 0 0 if ($method eq 'preferred' and ($^O ne 'MSWin32' and $^O ne 'cygwin'))
211 0 1 unless ($method =~ /^(?:dns|route|preferred|auto)$/)
215 1 0 if ($method eq 'dns' or $method eq 'auto')
225 0 1 if @x > 1
229 0 1 if ($@)
232 1 0 if ($addr)
233 1 0 unless $addr =~ /^(?:127\.|::1)/
238 0 0 if ($method eq 'route' or $method eq 'auto')
243 0 0 if ($^O eq 'solaris') { }
254 0 0 if ($line =~ /^\s+0\.0\.0\.0\s+0\.0\.0\.0\s+\S+\s+(\S+)\s+/) { }
0 0 elsif ($line =~ /^(?:0\.0\.0\.0|default)\s.*\s(\S+)$/) { }
0 0 elsif ($line =~ /^\s+interface:\s+(\S+)$/) { }
265 0 0 if ($^O eq 'MSWin32' or $^O eq 'cygwin')
266 0 0 if ($method eq 'preferred' or $method eq 'auto')
269 0 0 if (/^\s+${ipv}[\s\.]+:\s+(\S+)\(Preferred\)/)
282 0 1 $$self{'ipv'} eq '6' ? :
0 1 $^O eq 'MSWin32' || $^O eq 'cygwin' ? :
0 1 ($^O eq 'MSWin32' || $^O eq 'cygwin') && $$self{'ipv'} eq '6' ? :
295 0 4 unless open my $fh, "$cmd $params |"
312 0 5 if $$self{'debug'}