Branch Coverage

blib/lib/Patro/Server.pm
Criterion Covered Total %
branch 292 422 69.1


line true false branch
30 0 65 if ($INC{'Sys/HostAddr.pm'})
32 0 20 if $host2
36 0 65 unless socket my $socket, 2, 1, getprotobyname 'tcp'
38 0 65 unless setsockopt $socket, 1, 2, "\cA\000\000\000"
41 0 65 unless bind $socket, $sockaddr
42 0 65 unless listen $socket, 128
59 0 65 $threads_avail ? :
67 0 65 if ($threads_avail)
71 0 0 if ($@ =~ /CODE|GLOB/)
91 0 104 if ($ref eq 'threadsx::shared::code') { }
0 104 elsif ($ref eq 'threadsx::shared::glob') { }
101 12 92 if (overload::Overloaded($o))
102 12 0 if ($ref ne 'CODE' and $ref ne 'CODE*' and $ref ne 'GLOB')
116 0 20 if $@
117 20 0 if (@SERVERS == 1)
131 0 65 if ($meta->{'style'} eq 'threaded') { }
138 0 0 if ($self->{'meta'}{'pid_file'})
154 0 65 unless (defined $pid)
157 45 20 if ($pid == 0)
158 0 45 if ($self->{'meta'}{'pid_file'})
176 0 16 unless overload::Overloaded($obj)
177 6 10 unless (@oplist)
187 3 0 if ($ops{'0+'} or $ops{'""'} or $ops{'bool'})
193 175 81 if $ops{$binop}
197 13 3 if $ops{'<=>'}
198 13 3 if $ops{'cmp'}
200 13 3 if $ops{'-'}
201 13 3 if $ops{'-='}
202 13 0 if $ops{'<'} and $ops{'neg'}
203 13 3 if $ops{'+='}
206 0 16 if $ops{'nomethod'}
231 0 2 unless ($file)
235 0 2 unless (open $fh, '>', $file)
251 0 3 if (not defined $file || ref $self and $self ne 'Patro::Config')
255 0 3 if (ref $file eq 'GLOB') { }
0 3 elsif (not open($fh, '<', $file)) { }
284 25 65 unless ($paddr)
285 25 0 if $!{'EINTR'}
286 0 0 if $!{'ECHILD'} or $! == 10
299 65 0 if ($self->{'meta'}{'style'} eq 'forked') { }
301 0 65 unless (defined $pid)
304 40 25 if ($pid != 0)
305 0 40 if ($self->{'meta'}{'pid_file'})
324 0 0 if ($self->{'meta'}{'pid_file'})
350 0 66 if ($self->{'meta'}{'subthreads'})
355 0 0 if (@joinable)
360 0 0 unless (defined $i)
371 20 46 unless ($self->still_active)
382 0 66 if (time <= $meta->{'keep_alive'})
385 41 25 if (time < $meta->{'last_connection'} + $meta->{'idle_timeout'})
388 5 20 if (keys %{$$meta{'pids'};})
403 0 497 unless $req =~ /\S/
410 11 486 if $Patro::Server::disconnect
422 0 497 if &CORE::GLOBAL::ref($request)
426 0 497 unless (defined $topic)
432 342 155 if ($request->{'has_args'})
435 5 472 if (ref $_ eq '.Patroon') { }
440 0 342 if ($@)
447 342 155 $has_args ? :
448 342 155 $has_args ? :
457 40 457 if ($topic eq 'META') { }
61 396 elsif ($topic eq 'HASH') { }
240 156 elsif ($topic eq 'ARRAY') { }
18 138 elsif ($topic eq 'SCALAR') { }
30 108 elsif ($topic eq 'METHOD') { }
3 105 elsif ($topic eq 'CODE') { }
85 20 elsif ($topic eq 'HANDLE') { }
15 5 elsif ($topic eq 'OVERLOAD') { }
5 0 elsif ($topic eq 'REF') { }
480 40 457 if (@r and ref $r[0] eq '.Patroclus')
485 15 442 if $!
486 15 442 if $^E
487 1 456 if $?
488 2 455 if $@
507 601 407 if $orig_refs[$i] != \$args->[$j]
508 14 393 if ($orig_dump[$i] ne $dj)
515 12 445 if @out
516 0 457 if @outref
517 15 442 if ($ctx >= 2) { }
410 32 elsif ($ctx == 1 and defined $r[0]) { }
530 4 36 if ($cmd eq 'disconnect')
535 0 36 if ($cmd eq 'ref') { }
0 36 elsif ($cmd eq 'reftype') { }
36 0 elsif ($cmd eq 'destroy') { }
542 7 29 if (@ids == 0) { }
558 0 61 if (&reftype($obj) ne 'HASH')
563 6 55 if ($cmd eq 'STORE') { }
45 10 elsif ($cmd eq 'FETCH') { }
2 8 elsif ($cmd eq 'DELETE') { }
8 0 elsif ($cmd eq 'EXISTS') { }
0 0 elsif ($cmd eq 'CLEAR') { }
0 0 elsif ($cmd eq 'FIRSTKEY') { }
0 0 elsif ($cmd eq 'NEXTKEY') { }
0 0 elsif ($cmd eq 'SCALAR') { }
595 0 240 if (&reftype($obj) ne 'ARRAY')
599 6 234 if ($cmd eq 'STORE') { }
174 60 elsif ($cmd eq 'FETCH') { }
32 28 elsif ($cmd eq 'FETCHSIZE') { }
0 28 elsif ($cmd eq 'STORESIZE' or $cmd eq 'EXTEND') { }
16 12 elsif ($cmd eq 'SPLICE') { }
4 8 elsif ($cmd eq 'PUSH') { }
2 6 elsif ($cmd eq 'UNSHIFT') { }
3 3 elsif ($cmd eq 'POP') { }
3 0 elsif ($cmd eq 'SHIFT') { }
0 0 elsif ($cmd eq 'EXISTS') { }
614 3 13 if ($off < 0)
616 0 3 if ($off < 0)
622 2 14 if (not defined $len or $len eq 'undef')
625 2 14 if ($len < 0)
627 0 2 if ($len < 0)
634 6 10 if ($ctx == 1) { }
635 6 0 @val > 0 ? :
658 0 18 if (&reftype($obj) ne 'SCALAR')
662 6 12 if ($cmd eq 'STORE') { }
12 0 elsif ($cmd eq 'FETCH') { }
677 0 30 unless ($obj)
682 1 29 if ($command =~ /::/) { }
28 1 elsif ($context < 2) { }
684 1 0 if ($context < 2) { }
685 1 0 $has_args ? :
688 0 0 $has_args ? :
692 20 8 $has_args ? :
695 0 1 $has_args ? :
704 0 85 ref $obj eq 'threadsx::shared::glob' ? :
705 7 78 if ($command eq 'PRINT') { }
1 77 elsif ($command eq 'PRINTF') { }
0 77 elsif ($command eq 'WRITE') { }
13 64 elsif ($command eq 'READLINE') { }
5 59 elsif ($command eq 'GETC') { }
3 56 elsif ($command eq 'READ' or $command eq 'READ?' or $command eq 'SYSREAD') { }
2 54 elsif ($command eq 'EOF') { }
1 53 elsif ($command eq 'FILENO') { }
2 51 elsif ($command eq 'SEEK') { }
8 43 elsif ($command eq 'TELL') { }
3 40 elsif ($command eq 'BINMODE') { }
8 32 elsif ($command eq 'CLOSE') { }
5 27 elsif ($command eq 'OPEN') { }
1 26 elsif ($command eq 'TRUNCATE') { }
0 26 elsif ($command eq 'FCNTL') { }
4 22 elsif ($command eq 'FLOCK') { }
2 20 elsif ($command eq 'STAT') { }
0 20 elsif ($command eq 'LSTAT') { }
6 14 elsif ($command eq '-X') { }
3 11 elsif ($command eq 'SYSOPEN') { }
1 10 elsif ($command eq 'OPENDIR') { }
1 9 elsif ($command eq 'REWINDDIR') { }
3 6 elsif ($command eq 'TELLDIR') { }
3 3 elsif ($command eq 'READDIR') { }
1 2 elsif ($command eq 'SEEKDIR') { }
1 1 elsif ($command eq 'CLOSEDIR') { }
1 0 elsif ($command eq 'CHDIR') { }
709 1 0 if ($has_args) { }
719 0 0 if (@$args < 2)
726 2 11 if ($context > 1) { }
739 0 3 if (@$args < 2)
746 1 2 if ($command eq 'SYSREAD' or $command eq 'READ?' and fileno $fh >= 0) { }
761 0 2 if (@$args < 2) { }
0 2 elsif (@$args > 2) { }
776 2 1 if (@$args) { }
783 0 8 if ($Patro::SECURE)
790 0 5 if ($Patro::SECURE)
796 1 4 if (@$args == 0) { }
800 3 1 if (@$args == 0) { }
809 5 0 if ($z)
827 1 1 if ($context < 2) { }
833 0 0 if ($context < 2) { }
842 0 3 if ($Patro::SECURE)
846 0 3 @$args <= 2 ? :
852 0 1 if ($Patro::SECURE)
862 2 1 if ($context < 2) { }
884 0 3 if (ref $sub eq 'threadsx::shared::code')
887 3 0 if ($context < 2) { }
888 2 1 $has_args ? :
890 0 0 $has_args ? :
896 2 13 if ($op eq '@{}') { }
1 12 elsif ($op eq '%{}') { }
0 12 elsif ($op eq '&{}') { }
0 12 elsif ($op eq '${}') { }
906 0 12 if ($swap)
911 0 12 if ($op =~ /[&|~^][.]=?/)
914 0 12 if ($op eq '-X') { }
0 12 elsif ($op eq 'neg') { }
0 12 elsif ($op eq '!' or $op eq '~' or $op eq '++' or $op eq '--') { }
0 12 elsif ($op eq 'qr') { }
0 12 elsif ($op eq 'atan2') { }
0 12 elsif ($op eq 'cos' or $op eq 'sin' or $op eq 'exp' or $op eq 'abs' or $op eq 'int' or $op eq 'sqrt' or $op eq 'log') { }
3 9 elsif ($op eq 'bool') { }
0 9 elsif ($op eq '0+') { }
2 7 elsif ($op eq '""') { }
0 7 elsif ($op eq '<>') { }
928 3 0 $x ? :
939 0 12 if ($@)
942 0 12 if ($threads_avail)
951 0 5 if (&reftype($obj) ne 'REF')
955 5 0 if ($command eq 'deref')
966 32 0 if (@_ > 0 and ref $_[-1] eq '.Patroclus')
999 425 72 if ($resp->{'context'})
1000 410 15 if ($resp->{'context'} == 1) { }
15 0 elsif ($resp->{'context'} == 2) { }
1008 12 485 if ($resp->{'out'})
1022 506 0 defined $obj ? :
1023 444 62 unless &CORE::GLOBAL::ref($obj)
1025 0 62 if ($threads_avail)
1026 0 0 if (ref $obj eq 'CODE') { }
0 0 elsif (ref $obj eq 'GLOB') { }
1040 31 31 if (not $self->{'obj'}{$id}) { }
1044 0 31 if ($ref eq 'threadsx::shared::code') { }
0 31 elsif ($ref eq 'threadsx::shared::glob') { }
1057 4 27 if (overload::Overloaded($obj))
1068 0 65 if ($INC{'perl5db.pl'})
1079 0 65 if ($threads_avail)