Condition Coverage

blib/lib/Net/BitTorrent/Protocol.pm
Criterion Covered Total %
condition 83 120 69.1


and 3 conditions

line !l l&&!r l&&r condition
103 1 42 0 defined $index and $index =~ /^\d+$/
113 2 3 0 $bitfield and unpack('b*', $bitfield) =~ /^[01]+$/
123 2 17 0 defined $index and $index =~ /^\d+$/
128 1 14 0 defined $offset and $offset =~ /^\d+$/
133 1 11 0 defined $length and $length =~ /^\d+$/
144 1 16 0 defined $index and $index =~ /^\d+$/
149 1 13 0 defined $offset and $offset =~ /^\d+$/
154 1 10 0 $data and $$data
165 2 11 0 defined $index and $index =~ /^\d+$/
170 1 8 0 defined $offset and $offset =~ /^\d+$/
175 1 5 0 defined $length and $length =~ /^\d+$/
186 1 6 0 defined $port and $port =~ /^\d+$/
196 1 8 0 defined $index and $index =~ /^\d+$/
208 1 12 0 defined $index and $index =~ /^\d+$/
213 1 9 0 defined $offset and $offset =~ /^\d+$/
218 1 6 0 defined $length and $length =~ /^\d+$/
229 1 8 0 defined $index and $index =~ /^\d+$/
239 2 74 0 defined $msgID and $msgID =~ /^\d+$/
279 0 0 203 defined unpack('N', $$data) and unpack('N', $$data) =~ /\d/
443 2 52 0 $packet and length $packet
492 0 18 0 defined $tid and $port =~ /^\d+$/

or 3 conditions

line l !l&&r !l&&!r condition
82 2 1 98 grep {not defined $_;} @_[0..2] or length $reserved != 8
3 2 96 grep {not defined $_;} @_[0..2] or length $reserved != 8 or length $infohash != 20
3 2 94 grep {not defined $_;} @_[0..2] or length $reserved != 8 or length $infohash != 20 or length $peerid != 20
244 2 2 68 not $data or ref $data ne 'HASH'
273 2 2 271 not $data or ref $data ne 'SCALAR'
4 2 269 not $data or ref $data ne 'SCALAR' or not $$data
316 2 1 68 not $packet or length $packet < 68
339 2 0 32 not $packet or length $packet < 1
349 2 0 5 not $packet or length $packet < 1
359 2 0 11 not $packet or length $packet < 9
372 2 1 9 not $packet or length $packet < 9
385 2 0 5 not $packet or length $packet < 9
398 2 0 8 not $packet or length $packet < 1
408 2 0 9 not $packet or length $packet < 1
420 2 0 6 not $packet or length $packet < 9
433 2 0 9 not $packet or length $packet < 1
487 0 0 18 not defined $infohash or length $infohash != 20
523 0 0 47 not defined $target or length $target != 20
552 0 0 34 not defined $info_hash or length $info_hash != 20