Condition Coverage

blib/lib/AnyEvent/BitTorrent.pm
Criterion Covered Total %
condition 13 108 12.0


and 3 conditions

line !l l&&!r l&&r condition
148 0 7 8409 $prio && !vec($s->bitfield, $index, 1)
394 0 0 6312 defined $length and $length > 0
406 6312 0 0 -f $s->files->[$file_index]{'path'} && $s->_open($file_index, 'r')
459 0 0 0 defined $data and length $data > 0
516 0 6303 9 defined $piece && $expected eq $reality
984 0 0 0 $_->[0] == $index and $_->[1] == $offset
1042 0 0 0 $_->[0] == $index and $_->[1] == $offset
1076 0 0 0 $_->[0] == $index and $_->[1] == $offset
1177 0 0 0 vec($p->{'bitfield'}, $index, 1) && !vec($s->bitfield, $index, 1)
1202 0 0 0 ref $s->working_pieces->{$index}{$_} && (defined $s->working_pieces->{$index}{$_}[4] || defined $s->working_pieces->{$index}{$_}[3])
1207 0 0 0 $index == $s->piece_count && $offset == $offsets[-1]
1318 0 4 0 $s->start and &AE::log('debug', 'Calling ->start()')
1320 0 0 0 $s->paused and &AE::log('debug', 'Calling ->paused() ')

or 2 conditions

line l !l condition
295 0 0 $s // (return)
314 0 0 $s // (return)
357 0 6312 $s->piece_cache->{$f} // (return)
358 0 0 $s->piece_cache->{$f}{$o} // (return)
423 0 0 $s // (return)
444 0 0 $offset || 0
487 0 0 $s // (return)
570 0 0 $s->peers->{$h} // (return)
596 1 3 $shuffle //= sub { my $deck = shift(); return unless @$deck; my $i = @$deck; while (--$i) { my $j = int rand $i + 1; @$deck[$i, $j] = @$deck[$j, $i]; } ; }
698 0 0 $reply->{'interval'} // 900
0 0 $reply->{'interval'} // 900
842 0 0 $msg // 'Connection timed out'
870 0 0 $h->rbuf // (return)
883 0 0 ref $packet->{'payload'} // (return)
918 0 0 ref $packet->{'payload'} // (return)
979 0 0 $s->working_pieces->{$index} // (return)
1099 0 0 $h->rbuf // ''
1120 0 0 $qualifier //= sub { 1; }
1170 0 0 $p // (return)
1171 0 0 $p->{'handle'} // (return)
1197 0 0 $s->working_pieces->{$index} //= {map({$_, undef;} @offsets)}
1206 0 0 $offset // (return)
1227 0 0 $p // (return)
1228 0 0 $p->{'handle'} // (return)

or 3 conditions

line l !l&&r !l&&!r condition
408 0 6312 0 $s->_read_cache($file_index, $total_offset, $this_read) // "\000" x $this_read
506 0 0 6312 $index < 0 or $index > $s->piece_count
638 0 4 0 $tier->{'announcer'} //= $s->_announce_tier($e, $tier)
990 0 0 0 $_->[0] != $index or $_->[1] != $offset
1048 0 0 0 $_->[0] != $index or $_->[1] != $offset
1083 0 0 0 $_->[0] != $index or $_->[1] != $offset
1234 0 0 0 $_->[0] != $index or $_->[1] != $offset