Branch Coverage

blib/lib/IPC/Messaging.pm
Criterion Covered Total %
branch 47 184 25.5


line true false branch
55 0 0 unless defined $pid
56 0 0 if ($pid) { }
77 2 0 if ($messaging_dir and $i_am_root and -e $messaging_dir and not -l $messaging_dir) { }
0 0 elsif ($messaging_dir and not $i_am_root) { }
89 0 0 unless @{$$r{'pats'};}
93 0 0 if ($$pat{'name'} ne $$m{'m'} and $$pat{'name'} ne '_')
97 0 0 if ($$pat{'proc'} and $$m{'f'} and $$m{'f'} != $$pat{'proc'})
102 0 0 if ($$pat{'sock'} and $msock and $msock->fileno != $$pat{'sock'})
109 0 0 unless (exists $$m{'d'}{$k} and $$m{'d'}{$k} eq $$h{$k})
114 0 0 unless $match
116 0 0 if ($$pat{'filter'})
117 0 0 unless $$pat{'filter'}($$m{'m'}, $$m{'d'})
131 0 2 if ($kq) { }
2 0 elsif ($epfd) { }
132 0 0 if ($write) { }
138 0 2 if ($write) { }
151 0 0 if ($kq) { }
0 0 elsif ($epfd) { }
152 0 0 if $rd
153 0 0 if $wr
155 0 0 if $rd
156 0 0 if $wr
166 0 0 if $x == 0
175 0 0 if @processes_to_reap
176 0 0 if ($use_kqueue) { }
0 0 elsif ($use_epoll) { }
181 0 0 unless IO::Epoll::epoll_wait($epfd, 100, $t * 1000)
189 0 0 if ($fd == $my_sock_fileno) { }
0 0 elsif ($write_socks{$fd}) { }
0 0 elsif ($read_socks{$fd}) { }
192 0 0 unless $data
195 0 0 if not $msg and $@
196 0 0 unless $msg
197 0 0 unless $$msg{'s'} and $$msg{'s'} eq $secret and $$msg{'m'} and $$msg{'f'}
200 0 0 if ($$msg{'m'} eq 'EXIT')
202 0 0 if $x == 0
207 0 0 if ($$s{'type'} eq 'tcp_connecting')
212 0 0 if defined $opt
213 0 0 if ($opt) { }
242 0 0 if ($$s{'type'} eq 'tcp_listen') { }
0 0 elsif ($$s{'type'} eq 'tcp') { }
0 0 elsif ($$s{'type'} eq 'udp') { }
268 0 0 if (not defined $len or $len <= 0) { }
0 0 elsif ($$s{'by_line'}) { }
269 0 0 if ($$s{'buf'} and $$s{'by_line'})
317 0 0 unless $d
342 0 0 $p{'bind'} ? :
0 0 unless my $sock = 'IO::Socket::INET'->new('Listen', $p{'listen_queue'} || 5, $p{'bind'} ? ('LocalAddr', $p{'bind'}) : (), 'LocalPort', $port, 'Proto', 'tcp', 'ReuseAddr', 1)
361 0 0 unless my $sock = 'IO::Socket::INET'->new('Proto', 'tcp', 'PeerHost', $host, 'PeerPort', $port, 'Blocking', 0)
380 0 0 $bind ? :
0 0 unless my $sock = 'IPC::Messaging::UDP'->new('Proto', 'udp', 'LocalPort', $port, $bind ? ('LocalAddr', $bind) : (), 'ReuseAddr', 1)
397 0 10 if $recv
401 9 1 if $@
402 1 0 if $$r{'then_balance'}
403 0 0 unless ($$r{'pats'} or $$r{'timeout'})
414 0 0 unless ($i_am_root or kill 0, $root)
417 0 0 if (run_queue($r))
422 0 0 if ($$r{'timeout'}) { }
425 0 0 if pickup_one_message($$r{'timeout'}[0] - (&Time::HiRes::time() - $start))
428 0 0 if pickup_one_message(5)
430 0 0 if ($$r{'timeout'} and $$r{'timeout'}[0] - (&Time::HiRes::time() - $start) < 0)
453 1 7 unless $recv
454 1 6 unless @p >= 2
457 1 5 unless UNIVERSAL::isa($$pat{'then'}, 'IPC::Messaging::Then')
459 3 2 if (UNIVERSAL::isa($p[0], 'ARRAY'))
460 1 2 if (@p != 1)
465 1 3 unless @p
467 1 2 if ref $name
469 2 0 if (@p)
471 0 2 if (UNIVERSAL::isa($from, 'IPC::Messaging::Process')) { }
0 2 elsif (UNIVERSAL::isa($from, 'IO::Handle')) { }
479 2 0 if (@p)
480 0 2 if (UNIVERSAL::isa($p[0], 'CODE'))
484 2 0 if (@p)
485 1 1 if (UNIVERSAL::isa($p[0], 'HASH')) { }
1 0 elsif (@p % 2 != 0) { }
486 1 0 unless @p == 1
492 0 0 if @p
500 1 8 unless $recv
508 1 3 unless $recv
509 1 2 unless UNIVERSAL::isa($then, 'IPC::Messaging::Then')
511 1 1 if $$recv{'timeout'}
529 0 2 if -e $messaging_dir and not -l $messaging_dir
534 0 2 unless $use_kqueue or $use_epoll or $use_select
540 0 2 if ref $$
541 2 0 unless $secret
548 0 2 if $use_kqueue
549 2 0 if $use_epoll
551 0 2 unless $my_sock = 'IO::Socket::UNIX'->new('Local', "$messaging_dir/$$.sock", 'Type', 2)
606 0 0 unless ($sock)
612 0 0 unless $sock
659 0 0 if (defined $r and not $r)