Condition Coverage

blib/lib/Net/BitTorrent/Torrent.pm
Criterion Covered Total %
condition 55 117 47.0


and 3 conditions

line !l l&&!r l&&r condition
67 5 5 41 blessed($$args{'Client'}) && $$args{'Client'}->isa('Net::BitTorrent')
31 41 10 $$args{'Client'} and not blessed($$args{'Client'}) && $$args{'Client'}->isa('Net::BitTorrent')
75 47 20 5 $$args{'BlockLength'} and not $$args{'BlockLength'} =~ /^\d+$/
81 62 5 5 $$args{'Status'} and not $$args{'Status'} =~ /^\d+$/
167 0 124 0 defined $raw_data{refaddr $self}{'encoding'} and not $raw_data{refaddr $self}{'encoding'} =~ /^utf-?8$/i
124 0 0 defined $raw_data{refaddr $self}{'encoding'} and not $raw_data{refaddr $self}{'encoding'} =~ /^utf-?8$/i and not utf8::is_utf8($path)
124 0 0 defined $raw_data{refaddr $self}{'encoding'} and not $raw_data{refaddr $self}{'encoding'} =~ /^utf-?8$/i and not utf8::is_utf8($path) and require Encode
202 30 0 41 $$args{'Client'} and blessed($$args{'Client'})
30 0 41 $$args{'Client'} and blessed($$args{'Client'}) and $$args{'Client'}->isa('Net::BitTorrent')
238 0 0 0 $$_resume_data{'.format'} and $$_resume_data{'.format'} eq 'Net::BitTorrent resume'
0 0 0 $$_resume_data{'.format'} and $$_resume_data{'.format'} eq 'Net::BitTorrent resume' and $$_resume_data{'.version'}
0 0 0 $$_resume_data{'.format'} and $$_resume_data{'.format'} eq 'Net::BitTorrent resume' and $$_resume_data{'.version'} and $$_resume_data{'.version'} <= 2
250 0 0 0 not -f $files{refaddr $self}[$_index]->path and $$_resume_data{'files'}[$_index]{'mtime'}
334 0 30 41 $_start and ${$status{refaddr $self};} & QUEUED()
391 1343 0 1428 $$_{'Object'}->isa('Net::BitTorrent::Peer') && $$_{'Object'}->torrent && $$_{'Object'}->torrent eq $self
553 0 41 0 $client and blessed $client
0 41 0 $client and blessed $client and $client->isa('Net::BitTorrent')
645 32 0 0 defined $ok and $ok == 0
676 5 31 0 defined $index and $index =~ /^\d+$/
703 0 18 0 $peer and blessed $peer
0 18 0 $peer and blessed $peer and $peer->isa('Net::BitTorrent::Peer')
810 9 9 18 $rand_val <= 0 and vec($relevence, $i, 1) == 1
913 0 292 0 defined $index and $index =~ /^\d+$/
914 0 292 0 defined $offset and $offset =~ /^\d+$/
915 0 292 0 defined $length and $length =~ /^\d+$/
938 0 0 308 defined $length and $length > 0
959 0 287 0 defined $index and $index =~ /^\d+$/
1091 0 0 5 ${$status{refaddr $self};} & QUEUED() && !$self->private

or 2 conditions

line l !l condition
213 5 66 $$args{'Status'} ||= 0
639 644 0 $_->host || ''
644 0 $_->port || 0
881 0 3 $offset || 0
927 0 292 $offset || 0
1223 0 10 scalar keys %{$_working_pieces{refaddr $self};} || 'N/A'

or 3 conditions

line l !l&&r !l&&!r condition
48 1 1 85 not $args or ref $args ne 'HASH'
250 0 0 0 (stat $files{refaddr $self}[$_index]->path)[9] or 0 != $$_resume_data{'files'}[$_index]{'mtime'}
0 0 0 not -f $files{refaddr $self}[$_index]->path and $$_resume_data{'files'}[$_index]{'mtime'} or ((stat $files{refaddr $self}[$_index]->path)[9] or 0 != $$_resume_data{'files'}[$_index]{'mtime'})
560 0 0 41 $_client{refaddr $self} or ${$status{refaddr $self};} & QUEUED()
697 0 0 18 !${$status{refaddr $self};} & STARTED() or ${$status{refaddr $self};} & CHECKING()
974 273 0 14 not $data or sha1_hex($$data) ne substr(unpack('H*', $raw_data{refaddr $self}{'info'}{'pieces'}), $index * 40, 40)
1080 5 0 5 $file ||= $resume_path{refaddr $self}