Branch Coverage

blib/lib/Atomic/Pipe.pm
Criterion Covered Total %
branch 150 242 61.9


line true false branch
20 38 0 if "Errno"->can("ERESTART")
27 38 0 if ('POSIX'->can('PIPE_BUF') and eval { do { &POSIX::PIPE_BUF() } }) { }
34 38 0 if ('POSIX'->can('SSIZE_MAX') and eval { do { &POSIX::SSIZE_MAX() } }) { }
53 0 0 if ($can_thread and $] == "5.01" and $Atomic::Pipe::Config{'ccname'} eq "gcc" and $Atomic::Pipe::Config{'gccversion'})
55 0 0 if $parts[0] > 4 or $parts[0] == 4 and $parts[1] >= 8
60 38 0 if (not $can_thread) { }
0 0 elsif ($INC{'threads.pm'}) { }
67 0 0 $INC{'threads.pm'} ? :
70 0 38 if ($^O eq 'MSWin32') { }
72 0 0 unless eval { do { require Win32::API; 1 } }
73 0 0 unless eval { do { require Win32API::File; 1 } }
105 3 0 @_ ? :
111 0 0 if @_
118 0 25318 if $self->{'invalid_state'}
120 0 25318 unless my $rh = $self->{'rh'}
122 56 25262 if $self->{'eof'}
131 0 25262 unless $to_read
136 81 25181 unless (defined $got)
137 81 0 if $! == 11
138 0 0 if $RETRY_ERRNO{0 + $!}
142 25170 11 if ($got) { }
163 25149 775042 unless ($self->{'in_buffer_size'} and $self->{'in_buffer_size'} >= $size)
165 1 25148 unless ($self->{'in_buffer_size'} >= $size)
166 1 0 unless $params{'eof_invalid'} and $self->{'eof'}
173 800174 16 if ($params{'remove'}) { }
187 3 141 if $self->{'invalid_state'}
189 22 119 if $self->fill_buffer
190 67 52 unless $self->{'eof'}
191 7 45 if $self->{'in_buffer_size'}
193 45 0 if (my $buffer = $self->{'mixed_buffer'})
194 15 30 if $buffer->{'lines'} or defined $buffer->{'lines'} and length $buffer->{'lines'}
195 0 30 if $buffer->{'burst'} or defined $buffer->{'lines'} and length $buffer->{'burst'}
206 2 2 if $mode == 0
207 2 0 if $mode == 1
227 0 7 unless -p $fifo
229 0 7 unless open my $fh, "+<", $fifo
239 0 6 unless -p $fifo
241 0 6 unless open my $fh, ">", $fifo
252 0 5 unless -p $ifh
257 0 5 unless open my $fh, $mode, $ifh
268 0 4 unless open my $fh, $mode, $fd
270 0 4 unless -p $fh
281 0 1 unless pipe $rh, $wh
296 0 37 unless pipe $rh, $wh
304 15 22 if ($mixed)
315 0 30 if $self->{'invalid_state'}
317 15 15 if $self->{'rh'}
347 1 14 if $self->eof and keys %{$$self{'state'}{'buffers'};} || keys %{$$self{'state'}{'parts'};}
349 59 41 if ($buffer->{'lines'} or length $buffer->{'lines'})
354 14 45 if $term
355 8 0 if $self->{'eof'} and not $self->{'in_buffer_size'} and defined $line and length $line
358 2 0 if $params{'peek_line'} and defined $line and length $line
361 10 68 if ($buffer->{'in_message'})
364 0 10 unless (defined $id)
365 0 0 unless $self->{'eof'} and not $self->{'in_buffer_size'}
371 3 7 if defined $message
374 10 65 if ($buffer->{'strip_term'})
377 0 10 unless $term eq $postfix
381 16 59 if ($buffer->{'in_burst'})
384 10 6 if ($peek eq $key)
396 4 2 if ($term) { }
406 2 0 if $self->{'eof'}
409 28 31 unless ($self->{'in_buffer_size'} or $self->fill_buffer)
410 2 26 if $peek and not $self->{'eof'}
412 11 15 unless $self->{'eof'}
415 7 8 if $buffer->{'eof'}++
424 31 0 if defined $linedata
426 16 15 if ($buffer->{'in_burst'}) { }
469 0 0 if $ret == 0
484 0 0 $state ? :
493 0 20 unless my $rh = $self->{'rh'}
495 20 0 if @_
506 0 5 unless my $wh = $self->{'wh'}
508 0 5 unless @_
518 0 5 unless fcntl $wh, &Fcntl::F_GETFL, $flags
519 1 4 if ($val) { }
521 0 5 unless fcntl $wh, &Fcntl::F_SETFL, $flags
530 5 5 if ($self->{'rh'} and not $self->{'wh'}) { }
5 0 elsif ($self->{'wh'} and not $self->{'rh'}) { }
540 0 0 if $r and $w
541 0 0 unless $r or $w
547 0 0 unless defined &Fcntl::F_GETPIPE_SZ
556 0 3 unless defined &Fcntl::F_SETPIPE_SZ
565 0 0 unless -e "/proc/sys/fs/pipe-max-size"
567 0 0 unless open my $max, "<", "/proc/sys/fs/pipe-max-size"
582 4 0 if $self->{'rh'} and not $self->{'wh'}
588 4 0 if $self->{'wh'} and not $self->{'rh'}
595 0 3 unless open my $fh, ">&:raw", $self->{'wh'}
602 0 0 unless open my $fh, "<&:raw", $self->{'rh'}
609 0 0 unless $self->{'wh'}
611 0 0 unless $self->{'rh'}
620 0 1 unless $self->{'rh'}
622 0 1 unless $self->{'wh'}
630 11 1 if $self->{'wh'}
631 1 11 if $self->{'rh'}
639 0 35 if defined $_[0]{'delimiter_size'}
648 1 7 unless $size <= 4096
667 0 97 if $self->{'hit_epipe'}
668 0 97 if $self->pending_output
673 67 32 unless my $buffer = $self->{'out_buffer'}
674 31 1 unless @$buffer
689 592314 654079 unless $blocking or defined $got
690 254021 400058 unless defined $got
702 0 1246394 unless my $wh = $self->{'wh'}
704 1 1246393 if $self->{'hit_epipe'}
709 5 1246388 if length $prefix or length $postfix
715 1 1246392 if ($! == 32 or 0)
720 846334 400058 if $! == 11 or 0
721 0 400058 if not $wrote or $RETRY_ERRNO{0 + $!}
722 400058 0 if $wrote == $size
733 0 32 if defined $self->{'adjusted_dsize'}
753 100029 0 if $dtotal % $adjusted_dsize
758 16 100013 if ($parts == 1) { }
763 0 16 $message_key ? :
789 100039 1 if defined $id
800 400078 0 unless ($state->{'key'})
801 1 400077 unless my $key_bytes = $self->_get_from_buffer($psize)
815 300034 100043 $state->{'buffers'}{$tag} ? :
819 300035 100042 unless ($id == 0)
820 7 300028 if $params{'one_part_only'}
827 100041 1 unless $params{'debug'}