Branch Coverage

blib/lib/Net/IMP/Cascade.pm
Criterion Covered Total %
branch 150 306 49.0


line true false branch
69 0 0 unless grep {not $rtypes_implemented_myself{$_};} @{$$if[1];}
71 0 0 unless @if
85 0 0 if $i == $k
89 0 0 if $in_k and !$in_i || $in_k != $in_i
93 0 0 if %out_k
106 0 0 unless $m{$key}++
118 0 0 unless my $np = $parts->[$i]->set_interface(@if)
120 0 0 if $np == $parts->[$i]
124 0 0 unless @new_parts
166 118 42 if @_
190 0 0 @_ ? :
192 0 0 !defined($buf->{'data'}) ? :
194 0 0 if length $_ > 30
205 0 0 $buf->{'eof'} ? :
0 0 $buf->{'gap'} ? :
0 0 defined $buf->{'data'} ? :
213 0 0 @_ ? :
215 0 0 unless ($part)
230 0 58 if $buf->{'dtype'} > 0
237 58 0 defined $buf->{'data'} ? :
246 54 4 if ($buf->{'rtype'} != 4113) { }
273 0 148 if $Net::IMP::Cascade::DEBUG
278 225 71 unless my $pass = $part->{$pp}
281 0 174 unless $buf->{'dtype'}
282 43 131 if ($pass != -1 and $buf->{'start'} >= $pass)
283 0 43 if $Net::IMP::Cascade::DEBUG
289 0 131 unless defined $buf->{'data'}
290 95 36 if ($pass == -1 or $buf->{'end'} <= $pass) { }
292 0 95 if $Net::IMP::Cascade::DEBUG
295 4 91 if $pp eq 'prepass' and $buf->{'rtype'} == 4097
301 4 91 if $r_passed and $pp eq 'prepass'
304 0 91 if $r_passed
311 24 67 unless (@$ibuf)
312 22 2 if ($part->{'pass'} == -1 or $buf->{'eof'})
323 24 0 $buf->{'dtype'} < 0 ? :
332 0 36 if $Net::IMP::Cascade::DEBUG
344 3 5 if ($buf->{'gstart'} == $buf->{'gend'} and not $buf->{'gap'} and $buf->{'rtype'} ~~ [4097, 4099])
354 35 33 $buf->{'rtype'} == 4113 ? :
360 50 20 if (@fwd > 1)
362 0 0 $_->[2] ? :
0 0 !defined($_->[0]) ? :
0 50 if $Net::IMP::Cascade::DEBUG
370 22 124 unless (defined $fwd[$i][0] and defined $fwd[$i][2])
374 0 74 if (not defined $lpi or $lpi != $fwd[$i][0] or $ldir != $fwd[$i][1])
383 28 46 if (not $buf->{'gap'} and $buf->{'dtype'} < 0 and $buf->{'start'} == $lbuf->{'end'} and $buf->{'rtype'} == $lbuf->{'rtype'} and $buf->{'dtype'} == $lbuf->{'dtype'}) { }
389 17 11 if ($buf->{'rtype'} == 4113) { }
390 2 15 if ($lbuf->{'gend'} == $buf->{'gend'}) { }
11 4 elsif ($buf->{'data'} ne '' or $lbuf->{'data'} ne '') { }
401 0 17 if $Net::IMP::Cascade::DEBUG
417 0 171 unless (defined $npi)
425 127 44 if ($buf) { }
429 13 114 $dir ? :
430 69 58 if $npi < 0 or $npi >= @imp
431 58 0 if ref($np = $parts[$dir][$npi])
433 0 0 if $Net::IMP::Cascade::DEBUG
436 22 105 if ($buf->{'eof'})
440 58 69 if ($np) { }
446 0 58 if $Net::IMP::Cascade::DEBUG
451 1 68 unless my $cb = &$fwd_up($dir, $buf)
452 0 68 if $Net::IMP::Cascade::DEBUG
460 20 24 unless ref $parts[$dir][$pi]
463 12 12 if (grep {ref $_;} @{$parts[$dir];}) { }
465 0 12 if $Net::IMP::Cascade::DEBUG
469 0 12 if $Net::IMP::Cascade::DEBUG
486 0 87 if $Net::IMP::Cascade::DEBUG
496 0 87 if $lbuf->{'eof'}
497 0 87 if ($buf->{'start'} != $lend) { }
0 87 elsif ($buf->{'gap'}) { }
498 0 0 if ($buf->{'start'} < $lend) { }
0 0 elsif (not $buf->{'gap'}) { }
506 0 87 if $part->{'pass'} == -1
511 26 61 if ($lbuf->{'data'} eq '' and $lbuf->{'rtype'} == 4097) { }
6 55 elsif (not $buf->{'gap'} and $buf->{'data'} eq '' and $buf->{'rtype'} == $lbuf->{'rtype'} and $buf->{'dtype'} == $lbuf->{'dtype'} and $buf->{'dtype'} < 0 and not $buf->{'eof'}) { }
513 0 26 if $Net::IMP::Cascade::DEBUG
514 0 26 unless @$ibuf == 1
525 0 6 if $Net::IMP::Cascade::DEBUG
530 0 6 if $Net::IMP::Cascade::DEBUG
535 0 55 if $Net::IMP::Cascade::DEBUG
542 22 59 $buf->{'eof'} ? :
80 1 if ($buf->{'eof'} ? $lend <= $buf->{'end'} : $lend < $buf->{'end'}) { }
546 89 84 if $_->{'start'} < $lend
548 0 84 if $_->{'start'} > $lend
554 0 0 $_->{'gap'} ? :
0 84 if $Net::IMP::Cascade::DEBUG
561 0 84 $_->{'gap'} ? :
563 8 76 if $buf->{'eof'} and $_->{'data'} ne ''
564 84 0 unless $rl
565 0 0 if ($rl == -1 or $rl >= $lend) { }
572 0 1 if $Net::IMP::Cascade::DEBUG
577 4 77 if @fwd
587 0 107 if ($rtype ~~ [4354, 4352, 4353, 4]) { }
0 107 elsif ($rtype == 1) { }
0 107 elsif ($rtype == 16) { }
0 107 elsif ($rtype == 17) { }
76 31 elsif ($rtype ~~ [4097, 4099]) { }
31 0 elsif ($rtype == 4113) { }
0 0 elsif ($rtype == 18) { }
588 0 0 if $Net::IMP::Cascade::DEBUG
593 0 0 if $Net::IMP::Cascade::DEBUG
599 0 0 if ($_->{'start'} <= $offset) { }
602 0 0 $_->{'rtype'} == 4113 ? :
611 0 0 if $Net::IMP::Cascade::DEBUG
612 0 0 if $pause[$pi]
614 0 0 if grep {$_;} @pause > 1
618 0 0 if $Net::IMP::Cascade::DEBUG
621 0 0 unless grep {$_;} @{$pause[$dir];}
625 0 76 if $Net::IMP::Cascade::DEBUG
626 7 69 unless ref(my $part = $parts[$dir][$pi])
627 65 4 if ($rtype == 4097) { }
628 0 65 if $part->{'pass'} == -1
629 22 43 if ($offset == -1) { }
43 0 elsif ($offset > $part->{'pass'}) { }
634 43 0 if ($part->{'prepass'} != -1 and $part->{'prepass'} <= $offset)
642 2 2 if $part->{'prepass'} == -1
643 2 0 if ($offset == -1) { }
0 0 elsif ($offset > $part->{'prepass'}) { }
657 0 31 if $Net::IMP::Cascade::DEBUG
660 0 31 unless ref(my $part = $parts[$dir][$pi])
665 0 31 unless $part
666 0 31 if $offset == -1
668 0 31 if $ibuf->[0]{'start'} > $offset
672 49 22 if ($offset >= $buf->{'end'}) { }
674 0 49 if $Net::IMP::Cascade::DEBUG
676 48 1 if (not defined $buf->{'data'} or $buf->{'data'} ne $newdata)
686 5 44 unless (@$ibuf)
689 0 5 if $buf->{'end'} < $offset
697 0 5 $buf->{'dtype'} > 0 ? :
704 26 18 if $buf->{'end'} == $offset
707 0 22 if $Net::IMP::Cascade::DEBUG
716 0 0 if $Net::IMP::Cascade::DEBUG
717 0 0 unless ref(my $part = $parts[$dir][$pi])
720 0 0 if $_->{'replace_later'} == -1
723 0 0 unless $part
727 0 0 if $offset != -1 and $ibuf->[0]{'start'} > $offset
729 0 0 if ($offset == -1) { }
0 0 elsif ($offset <= $part->{'replace_later'}) { }
739 0 0 unless defined $_->{'data'}
740 0 0 unless my $len = length $_->{'data'}
741 0 0 if ($_->{'start'} + $len <= $offset) { }
750 0 0 if $Net::IMP::Cascade::DEBUG
756 66 9 if @fwd
775 2 29 $dir ? :
778 29 5 if ref($np = $parts[$dir][$pi])
780 0 5 $dir ? :
781 2 3 if ($pi < 0 or $pi > $#imp)
782 0 2 if $Net::IMP::Cascade::DEBUG
783 0 2 if (my $cb = &$fwd_up($dir, &$new_buf(%buf)))
790 0 29 unless ref $np
793 29 0 if (not $offset) { }
0 0 elsif ($offset < $ibuf_end) { }
0 0 elsif ($offset > $ibuf_end) { }
821 75 0 if ($collect_callbacks)
848 0 11 if $closef