Branch Coverage

blib/lib/Geo/IP2Location/Lite.pm
Criterion Covered Total %
branch 47 52 90.3


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) { }
206 44 526 if ($ipno >= $ipfrom and $ipno < $ipto) { }
214 1 43 $mode == $ALL ? :
220 18 45 if ($POSITIONS->{$pos}[$dbtype] == 0) { }
223 0 45 if ($pos == $LATITUDE or $pos == $LONGITUDE) { }
21 24 elsif ($pos == $COUNTRYLONG) { }
243 6 18 if ($pos == $COUNTRYSHORT and $return_val eq 'UK')
252 1 43 $mode == $ALL ? :
255 290 236 if ($ipno < $ipfrom) { }
294 0 0 $IS_LITTLE_ENDIAN ? :
306 223 2 if ($obj->ip_is_ipv4($ip))
327 1 226 unless defined $host
329 223 3 if ($host =~ /$IPv4_re/) { }
332 1 2 if (my $ip = gethostbyname $host)
341 223 2 if ($ip =~ /$IPv4_re/) { }