Branch Coverage

blib/lib/MogileFS/Backend.pm
Criterion Covered Total %
branch 25 92 27.1


line true false branch
31 1 0 unless ref $self
38 0 0 unless $self
50 0 1 unless $$self{'hosts'} = $args{'hosts'}
53 0 1 unless ref $$self{'hosts'} eq 'ARRAY'
57 0 1 if grep((!/:\d+$/), @{$$self{'hosts'};})
59 0 1 if $args{'timeout'} and not $args{'timeout'} =~ /^\d+$/
76 0 0 unless $hook
80 0 0 if $@
87 0 0 if (@_) { }
97 0 0 unless $$self{'pref_ip'} and ref $$self{'pref_ip'} eq 'HASH'
104 0 0 unless $fileno and $timeout
113 0 0 $nfound ? :
120 0 1 unless $cmd and $args
123 0 1 unless $MogileFS::Backend::FLAG_NOSIGNAL
131 0 1 if ($sock)
136 0 0 if ($! or not defined $rv) { }
0 0 elsif ($rv != $reqlen) { }
146 1 0 unless ($rv)
147 1 0 unless $sock = $self->_get_sock
152 0 0 if ($!) { }
0 0 elsif ($rv != $reqlen) { }
163 0 0 unless (_wait_for_readability(fileno $sock, $$self{'timeout'}))
181 0 0 unless (defined $line)
187 0 0 if ($line =~ /^ERR\s+(\w+)\s*(\S*)/)
189 0 0 $2 ? :
195 0 0 if ($line =~ /^OK\s+\d*\s*(\S*)/)
208 0 0 unless $$self{'lasterr'}
224 0 0 $$self{'lasterr'} ? :
250 1 0 if ($timeout) { }
258 1 0 if (not $ret and $timeout and $! == 115)
263 1 0 if (select(undef, $win, undef, $timeout) > 0)
266 0 1 if not $ret and $! == 106
271 1 0 if $timeout
288 0 1 if ($$self{'pref_ip'} and my $prefip = $$self{'pref_ip'}{$ip})
292 0 0 if (_connect_sock($sock, $sin, 0.1)) { }
302 1 0 unless ($connected)
304 0 1 unless my $aton_ip = Socket::inet_aton($ip)
307 1 0 unless _connect_sock($sock, $sin)
319 0 1 unless $self
322 0 1 $size > 15 ? :
324 1 0 unless (defined $$self{'last_host_idx'})
335 0 1 if $$self{'host_dead'}{$host} and $$self{'host_dead'}{$host} > $now - 5
338 0 1 if $sock = $self->_sock_to_host($host)
364 1 0 unless %args
374 0 0 ref $arg ? :
386 0 0 $$hashref{$name} ? :