Branch Coverage

blib/lib/PDF/Builder/Resource/XObject/Image/PNM.pm
Criterion Covered Total %
branch 43 146 29.4


line true false branch
52 0 3 if ref $class
55 0 3 unless $self->is_obj($pdf)
82 0 2 if (length $content != 2)
87 2 0 if ($content =~ /^P([1-6])/) { }
89 2 0 if ($info{'type'} > 3) { }
99 0 2 if ($info{'type'} == 1 or $info{'type'} == 4) { }
0 2 elsif ($info{'type'} == 2 or $info{'type'} == 5) { }
113 0 2 if (length $content == 0)
117 2 0 if ($content =~ /(^\d+)$/) { }
123 0 2 if ($width < 1)
131 0 2 if (length $content == 0)
135 2 0 if ($content =~ /(^\d+)$/) { }
141 0 2 if ($height < 1)
148 2 0 if ($info{'bgp'} =~ /^[gp]$/)
151 0 2 if (length $content == 0)
155 2 0 if ($content =~ /(^\d+)$/) { }
161 0 2 if ($max < 1 or $max > 65535)
173 2 0 if ($info{'raw'}) { }
179 2 0 if ($buffer =~ /^\s/) { }
208 2 6 if (length $buffer == 0)
210 0 0 if ($count == 0 and !$qflag || $in_comment)
218 8 0 unless ($in_comment)
221 8 0 if (length $buffer > 0) { }
223 0 8 if ($buffer =~ /^#/) { }
228 0 0 if ($buffer =~ s/^#\n//) { }
0 0 elsif ($buffer =~ s/^#\s*([^\n]*)\n//) { }
237 0 0 if ($count == 0)
252 0 0 if ($qflag and not $in_comment)
258 0 8 if (scalar @comment > 0)
273 0 8 if (length $buffer == 0)
275 0 0 if ($count == 0)
286 0 8 if (length $buffer == 0)
311 1 2 if (ref $file) { }
314 1 1 unless open $inf, '<', $file
329 0 2 if (defined $info->{'error'})
339 0 2 if ($max > 255)
342 0 2 if ($info->{'type'} == 1) { }
0 2 elsif ($info->{'type'} == 2) { }
0 2 elsif ($info->{'type'} == 3) { }
0 2 elsif ($info->{'type'} == 4) { }
0 2 elsif ($info->{'type'} == 5) { }
2 0 elsif ($info->{'type'} == 6) { }
357 0 0 if (length $content == 0)
359 0 0 if ($row == $h - 1 and $col == $w - 1)
362 0 0 if (length $content == 0)
369 0 0 if ($sample ne '0' and $sample ne '1')
374 0 0 if (length $bits == 8)
380 0 0 if ($bits ne '')
396 0 0 if ($max == 255 or $max == 65535) { }
0 0 elsif ($max > 255) { }
405 0 0 if ($bytes_per_sample == 2)
410 0 0 if (length $content == 0)
416 0 0 if ($content =~ /^\d+$/) { }
417 0 0 if ($content > $max)
427 0 0 if ($s > 0)
440 0 0 if ($max == 255 or $max == 65535) { }
0 0 elsif ($max > 255) { }
449 0 0 if ($bytes_per_sample == 2)
456 0 0 if (length $content == 0)
461 0 0 if ($content =~ /^\d+$/) { }
462 0 0 if ($content > $max)
473 0 0 if ($s > 0)
490 0 0 if ($rc != $bytes)
503 0 0 if ($max == 255 or $max == 65535) { }
0 0 elsif ($max > 255) { }
512 0 0 if ($bytes_per_sample == 2)
518 0 0 if ($rc != $bytes)
523 0 0 if ($s > 0) { }
543 2 0 if ($max == 255 or $max == 65535) { }
0 0 elsif ($max > 255) { }
552 0 2 if ($bytes_per_sample == 2)
558 0 2 if ($rc != $bytes)
563 0 2 if ($s > 0) { }