Branch Coverage

blib/lib/Lock/Server.pm
Criterion Covered Total %
branch 50 66 75.7


line true false branch
173 3 0 if ($self->{'listener_socket'})
177 2 1 if (my $pid = $self->{'server_pid'}) { }
204 0 11 unless $sock
206 7 4 if (my $pid = fork)
227 0 0 unless $sock
248 11 6 if $listener_socket
250 6 0 unless $listener_socket or $count > $self->{'attempts'}
252 0 11 unless ($listener_socket)
262 1 0 if $listener_socket
283 106 105 if ($connection == $listener_socket) { }
292 105 0 unless $data =~ /\S/
296 20 85 if ($cmd eq 'CHECK') { }
22 63 elsif ($cmd eq 'LOCK') { }
17 46 elsif ($cmd eq 'UNLOCK') { }
35 11 elsif ($cmd eq 'VERIFY') { }
9 2 elsif ($cmd eq 'PING') { }
2 0 elsif ($cmd eq 'SHUTDOWN') { }
307 1 1 if ($self->{'allow_shutdown'}) { }
336 2 0 if (1 == keys %{$self->{'_locker_counts'}{$lockers->[0]};}) { }
345 12 8 if (@$lockers) { }
355 0 339 if $Lock::Server::DEBUG
369 0 0 if (1 == keys %{$self->{'_locker_counts'}{$lockers->[0]};}) { }
377 3 19 if (0 < grep({$_ eq $locker_id;} @$lockers))
389 5 14 if (@$lockers > 1) { }
390 3 2 if (my $pid = fork) { }
429 11 6 if ($lockers->[0] eq $locker_id) { }
432 8 3 if (0 == scalar keys %{$$self{'_locker_counts'}{$locker_id};})
438 2 9 if (@$lockers) { }
468 0 1 if (1 == keys %{$self->{'_locker_counts'}{$lockers->[0]};}) { }
476 17 18 if ($lockers->[0] eq $locker_id) { }
513 0 22 unless $lockerName
536 4 158 unless $sock or $count > $attempts
538 0 158 unless $sock