Branch Coverage

blib/lib/P2P/pDonkey/Meta.pm
Criterion Covered Total %
branch 133 266 50.0


line true false branch
221 1132 1 if (defined $_[1]) { }
223 1132 0 if defined $res
232 78 1 if (defined $_[1]) { }
234 78 0 if defined $res
243 707 1 if (defined $_[1]) { }
245 707 0 if defined $res
254 7 0 if (defined $_[1]) { }
256 7 0 if defined $res
265 1378 2 if (defined $_[1]) { }
266 0 1378 unless defined($len = unpack("x$_[1] S", $_[0]))
267 0 1378 unless defined($res = unpack("x$_[1] x2 a$len", $_[0]))
268 0 1378 unless length $res == $len
272 0 2 unless defined($len = unpack('S', $_[0]))
281 0 1 unless defined($len = &unpackW)
283 0 2 unless defined($s = &unpackS)
291 0 1042 unless length $res == 16
298 0 283 unless length $res == 32
305 0 4 unless defined($n = &unpackW)
308 0 103 unless defined($hash = &unpackHash)
358 26 0 if ($st)
359 11 15 if ($st == 1 or $st == 11 or $st == 3 or $st == 4 or $st == 18) { }
367 0 26 unless defined $vt
368 26 0 $st ? :
383 0 828 unless defined($name = &unpackS)
384 0 828 unless $len = length $name
388 10 818 if ($st == 10 or $st == 9) { }
716 102 elsif ($len == 1) { }
392 1 715 unless $name
405 2 35 if ($st == 9 or $st == 10) { }
35 0 elsif ($st) { }
416 0 825 unless defined($vt = &unpackB)
417 0 825 unless $meta = &unpackMetaTagName
419 546 279 if ($vt == 2) { }
272 7 elsif ($vt == 3) { }
7 0 elsif ($vt == 4) { }
428 0 825 unless defined $val
438 17 17 if ($vt == 2) { }
17 0 elsif ($vt == 3) { }
0 0 elsif ($vt == 4) { }
451 0 0 $$m{'Type'} == 16 ? :
457 0 143 unless defined($ntags = &unpackD)
460 0 568 unless $meta = &unpackMeta
488 0 71 unless defined($ntags = &unpackD)
491 0 239 unless $meta = &unpackMeta
532 0 0 unless defined($hash = &unpackHash)
533 0 0 unless ($ip, $port) = &unpackAddr
534 0 0 unless $meta = &unpackMetaListU
546 0 0 unless defined($nres = &unpackD)
549 0 0 unless $info = &unpackInfo
594 0 0 unless $info
596 0 0 if (defined $$info{'Date'})
600 0 0 if (defined $$info{'IP'})
606 0 0 if (defined $$info{'Hash'})
610 0 0 if ($$info{'Parts'})
619 0 0 if ($$info{'Parts8'})
628 0 0 if ($$info{'Gaps'})
636 0 0 if ($$info{'Meta'})
651 0 140 unless $bb == 2
653 0 140 unless defined($res{'Date'} = &unpackD)
654 0 140 unless defined($res{'Hash'} = &unpackHash)
655 0 140 unless $metas = &unpackMetaList
659 2 544 if ($$meta{'Type'} == 9 or $$meta{'Type'} == 10) { }
669 67 73 if ($bb == 1) { }
71 2 elsif ($bb == 2) { }
671 9 58 if ($size >= 9728000)
677 0 9 unless &unpackB == 1
679 67 0 if ($size >= 486400)
687 71 0 if (defined $_[1])
700 0 2 if ($$d{'Gaps'} and @{$$d{'Gaps'};})
711 0 2 if ($$d{'Parts'} and @{$$d{'Parts'};})
717 0 2 if ($$d{'Parts8'} and @{$$d{'Parts8'};})
729 0 1 unless defined($nres = &unpackD)
732 0 138 unless $info = &unpackFileInfo
755 0 1 unless -e $path and -r _
757 0 1 if $debug
777 1 0 if $ext
778 1 0 if ($ext)
790 1 0 if $type
791 1 0 if $ext
793 0 1 unless open HANDLE, $path
802 0 1 if ($size > 9728000)
810 0 1 if ($size >= 486400)
829 0 0 if -f $File::Find::name
838 0 7 unless defined($t = &unpackB)
840 3 4 if ($t == 0) { }
1 3 elsif ($t == 1) { }
1 2 elsif ($t == 2) { }
2 0 elsif ($t == 3) { }
842 0 3 unless defined($op = &unpackB)
843 0 3 unless $exp1 = &unpackSearchQuery
844 0 3 unless $exp2 = &unpackSearchQuery
849 0 1 unless defined($str = &unpackS)
854 0 1 unless defined($val = &unpackS)
855 0 1 unless $metaname = &unpackMetaTagName
860 0 2 unless defined($val = &unpackD)
861 0 2 unless defined($comp = &unpackB)
862 0 2 unless $comp == 1 or $comp == 2
863 0 2 unless $metaname = &unpackMetaTagName
875 3 4 if ($t == 0) { }
1 3 elsif ($t == 1) { }
1 2 elsif ($t == 2) { }
2 0 elsif ($t == 3) { }
900 6 8 if ($t == 0) { }
2 6 elsif ($t == 1) { }
2 4 elsif ($t == 2) { }
4 0 elsif ($t == 3) { }
903 2 4 if ($op == 0) { }
2 2 elsif ($op == 1) { }
2 0 elsif ($op == 2) { }
917 2 0 if (defined $ft and $ft == 2) { }
929 2 0 if (defined $ft and $ft == 2) { }
941 4 0 if (defined $ft and $ft == 3) { }
942 2 2 if ($$q{'Compare'} == 1) { }
2 0 elsif ($$q{'Compare'} == 2) { }
965 0 0 if ($t == 0) { }
0 0 elsif ($t == 1) { }
0 0 elsif ($t == 2) { }
0 0 elsif ($t == 3) { }
968 0 0 if ($op == 0) { }
0 0 elsif ($op == 1) { }
0 0 elsif ($op == 2) { }
988 0 0 unless $mm and $$mm{'ValType'} == 2
995 0 0 unless $mm and $$mm{'ValType'} == 3
997 0 0 if ($$q{'Compare'} == 1) { }
0 0 elsif ($$q{'Compare'} == 2) { }
1014 0 1 unless defined($snum = &unpackB)
1017 0 2 unless defined($ip = &unpackD)
1018 0 2 unless defined($port = &unpackW)
1031 0 71 unless defined($ip = &unpackD)
1032 0 71 unless defined($port = &unpackW)
1038 0 1 if (ref $p) { }
1047 0 0 if (ref $ip and not defined $port) { }
1056 69 0 if (ref $ip and not defined $port) { }