Branch Coverage

blib/lib/AnyEvent/FDpasser.pm
Criterion Covered Total %
branch 64 128 50.0


line true false branch
28 2 16 if (ref $arg{'fh'} eq 'ARRAY') { }
29 0 2 if scalar @{$arg{'fh'};} > 2
33 10 6 if (not defined $arg{'fh'}) { }
40 18 0 unless ($arg{'dont_set_nonblocking'})
42 12 6 if exists $$self{'fh_pair'}
57 0 6 unless defined $$self{'fh_pair'}
58 0 6 if exists $$self{'error_state'}
67 0 6 unless defined $$self{'fh_pair'}
68 0 6 if exists $$self{'error_state'}
81 0 17 if exists $$self{'error_state'}
82 0 17 if exists $$self{'fh_pair'}
95 0 15 if exists $$self{'error_state'}
96 0 15 if exists $$self{'fh_pair'}
109 0 34 unless $$self{'fh'}
110 13 21 unless @{$$self{'obuf'};}
111 4 17 if defined $$self{'owatcher'}
112 0 17 if defined $$self{'full_descriptor_table_state'}
120 0 17 if ($rv < 0) { }
0 17 elsif ($rv == 0) { }
121 0 0 if ($!{'EAGAIN'} or $!{'EWOULDBLOCK'} or $!{'EINTR'}) { }
145 11 18 unless @{$$self{'ibuf'};}
146 3 15 if defined $$self{'iwatcher'}
147 0 15 if defined $$self{'full_descriptor_table_state'}
162 1 14 if ($rv == -1) { }
0 14 elsif ($rv == -2) { }
0 14 elsif ($rv == 0) { }
163 0 1 if ($!{'EAGAIN'} or $!{'EWOULDBLOCK'} or $!{'EINTR'}) { }
0 1 elsif ($!{'EMSGSIZE'} or $!{'EMFILE'} or $!{'ENFILE'}) { }
202 0 0 unless $fh =~ /^\d+$/u
209 0 15 if ($^O eq 'MSWin32') { }
0 15 elsif (fdpasser_mode == 2) { }
213 0 0 unless $s1
216 0 15 unless $s2
229 0 1 if ($^O eq 'MSWin32') { }
0 1 elsif (fdpasser_mode == 2) { }
233 0 0 if $fd < 0
234 0 0 unless open $fh, '+<&=', $fd
236 0 1 unless socket $fh, 1, 1, 0
237 0 1 unless setsockopt $fh, 1, 2, "\cA\000\000\000"
239 0 1 unless bind $fh, Socket::sockaddr_un($path)
240 0 1 unless listen $fh, $backlog
251 0 1 if ($^O eq 'MSWin32') { }
0 1 elsif (fdpasser_mode == 2) { }
255 0 0 if $fd < 0
256 0 0 unless open $passer_fh, '+<&=', $fd
269 0 1 if ($^O eq 'MSWin32') { }
0 1 elsif (fdpasser_mode == 2) { }
273 0 0 if $fd < 0
274 0 0 unless open $fh, '+<&=', $fd
276 0 1 unless socket $fh, 1, 1, 0
277 0 1 unless connect $fh, Socket::sockaddr_un($path)
289 0 1 if exists $$self{'fh_pair'}
291 0 1 if (exists $$self{'fh_duped'})
295 1 0 if (exists $$self{'fh_duped_orig'})
306 1 0 if $on_error
314 6 12 if (exists $$self{'fh_duped'})
318 17 1 if (exists $$self{'fh_duped_orig'})
328 12 21 if exists $$self{'fh_duped'}
330 18 3 unless (exists $$self{'fh_duped_orig'})
332 0 18 unless defined $r
339 0 21 if (not defined $$self{'fh_duped'})
341 0 0 if ($!{'EMFILE'} or $!{'ENFILE'}) { }
353 0 0 if $$self{'full_descriptor_table_state'}
361 0 0 if (exists $$self{'fh_duped'})