Branch Coverage

blib/lib/Geo/IP2Location/Lite.pm
Criterion Covered Total %
branch 48 54 88.8


line true false branch
83 2 3 unless $db_file
84 1 2 unless CORE::open my $handle, '<', "$db_file"
113 1 225 unless $pos
118 223 2 $ipv == 4 ? :
148 1 0 if ($res[0] eq $INVALID_IP_ADDRESS)
159 1 226 unless defined $mode
161 2 225 if ($ipnum eq '')
162 1 1 if ($mode == $ALL) { }
169 224 1 if ($mode != $ALL)
170 181 43 if ($POSITIONS->{$mode}[$dbtype] == 0)
187 0 44 if ($indexbaseaddr > 0)
196 1 43 if ($realipno == $MAX_IPV4_RANGE) { }
207 0 570 unless defined $ipfrom and defined $ipto
209 44 526 if ($ipno >= $ipfrom and $ipno < $ipto) { }
217 1 43 $mode == $ALL ? :
223 18 45 if ($POSITIONS->{$pos}[$dbtype] == 0) { }
226 0 45 if ($pos == $LATITUDE or $pos == $LONGITUDE) { }
21 24 elsif ($pos == $COUNTRYLONG) { }
246 6 18 if ($pos == $COUNTRYSHORT and $return_val eq 'UK')
255 1 43 $mode == $ALL ? :
258 290 236 if ($ipno < $ipfrom) { }
297 0 0 $IS_LITTLE_ENDIAN ? :
309 223 2 if ($obj->ip_is_ipv4($ip))
330 1 226 unless defined $host
332 223 3 if ($host =~ /$IPv4_re/) { }
335 1 2 if (my $ip = gethostbyname $host)
344 223 2 if ($ip =~ /$IPv4_re/) { }