Branch Coverage

blib/lib/Image/BMP.pm
Criterion Covered Total %
branch 91 192 47.4


line true false branch
117 11 0 if $self->{'file'}
129 11 0 if defined $val
138 0 0 unless defined $val
139 0 0 if ($val) { }
140 0 0 unless ref $val eq "CODE"
155 557695 11 unless $lvl <= $self->{'debug'}
172 0 11 $file =~ /\|/ ? :
173 0 11 if ($bmp->{'_pipe'}) { }
175 0 0 unless open $bmp->{'fh'}, $bmp->{'file'}
177 0 11 unless sysopen $bmp->{'fh'}, $bmp->{'file'}, 0
187 0 22 if $k =~ /^_/ and $k ne "_pipe" and $k ne "_colors"
200 0 0 unless $bmp and $bmp->{'fh'}
208 121241 1466 if defined $bmp->{'_byte'}
209 0 122707 unless $num == $bytes
235 39894 198708 if $bits % 8 == 0
238 4 198704 unless $bmp->{'_extra_bits'}
241 24839 173869 unless ($#{$$bmp{"_extra_bits"};} >= 0)
254 424 497 if $pad == $chunk
255 9 912 if $bmp->{'_byte'} + $pad >= $bmp->{'_size'}
257 497 424 if $pad > 0
264 0 0 unless $wfile
267 0 0 unless sysopen $bmp->{'wfh'}, $bmp->{'wfile'}, 65
274 0 0 unless $num == $bytes
294 0 0 if $bits > 32
295 0 0 if $val >= 1 << $bits
303 0 0 if $bits % 8 == 0
334 0 11 unless $bmp->{'Signature'} eq "BM"
348 0 0 unless $bmp->{'Signature'} eq "BM"
385 3 8 if $bmp->{'ColorsUsed'} == 0
395 0 55 if $bmp->{'HeaderSize'} == $s
399 0 11 unless $bmp->{'HeaderSize'} == 40 or $bmp->{'HeaderSize'} == 108
402 2 9 if $bmp->{'HeaderSize'} == 108
405 1 10 if $bmp->{'_colors'} == 16777216
415 1 10 if $bmp->{'Compression'} == 3
419 0 11 unless $bmp->{'DataOffset'} == $DataOffset
424 1 10 if $bmp->{'BitCount'} == 24
425 1 10 if $bmp->{'BitCount'} == 32
427 0 11 if not $bmp->{'ColorsUsed'}
441 0 0 if $pad == 32
453 0 623622 unless defined $rgb
462 2 9 unless ($bmp->{'IndexedColor'})
466 0 2 if ($bmp->{'_pipe'}) { }
503 197149 1559 $index ? :
198708 113543 if $bmp->{'BitCount'} == 1 or not $bmp->{'ColorsUsed'} and $bmp->{'BitCount'} != 24
506 37888 75655 unless $bmp->{'IndexedColor'}
515 0 0 $color ? :
0 0 if $bmp->{'BitCount'} == 1 or not $bmp->{'ColorsUsed'}
518 0 0 unless $bmp->{'IndexedColor'}
521 0 0 if defined $index
532 921 311330 if $pad and $x == $bmp->{'Width'} - 1
533 0 312251 if $bmp->{'_byte'} > $bmp->{'_size'}
535 1249 311002 if ++$x >= $bmp->{'Width'}
536 14 312237 unless defined $y and $y >= 0
545 0 3 unless $bmp->{'ignore_imagemagick_bug'}++
550 3 312248 unless defined $y and $y >= 0
556 312248 0 if not $bmp->{'add_pixel'} or $bmp->{'remember_image'}
559 312248 0 unless $bmp->{'add_pixel'}
561 0 0 unless ref $bmp->{'add_pixel'} eq "CODE"
568 0 11 if $file
569 0 11 unless $bmp->{'file'}
571 0 11 if ($bmp->{'_image_loaded'})
572 0 0 if ($bmp->{'_pipe'}) { }
0 0 elsif ($bmp->{'_image_remembered'} and not $bmp->{'add_pixel'}) { }
583 2 9 $bmp->{'Compression'} == 1 && $bmp->{'BitCount'} == 8 ? :
585 0 11 if $bmp->{'Compression'} and not $rle
589 0 11 unless $bmp->{'BitCount'} == 1 or $bmp->{'BitCount'} % 8 == 0
594 4 7 if $pad == 32
598 2 9 if $rle
603 0 11 unless $bmp->{'_size'} == $bmp->{'ImageSize'}
611 28254 238105 if ($rle) { }
614 27928 326 if ($n) { }
621 2 27926 unless defined $x
623 326 0 if ($c == 0) { }
0 0 elsif ($c == 1) { }
0 0 elsif ($c == 2) { }
625 326 0 if $x
650 0 0 if $pad and read_bmp($bmp, 1)
660 9 238096 unless defined $x
665 11 0 !$bmp->{'add_pixel'} || $bmp->{'remember_image'} ? :
669 0 0 if defined $x and $x != $bmp->{'Width'} - 1 || $y
678 0 11 unless $bmp->{'_image_loaded'} or $bmp->load
681 0 11 unless ($bmp->{'_image_remembered'})
702 0 0 if $pad == 32
712 0 0 if $pad > 0
721 311374 0 unless defined $g
731 0 0 if ($x >= $bmp->{'Width'} or $x < 0 or $y >= $bmp->{'Height'} or $y < 0)
737 0 0 if defined $index
746 0 0 if ($x >= $bmp->{'Width'} or $x < 0 or $y >= $bmp->{'Height'} or $y < 0)
752 0 0 unless defined $val
759 0 0 if (defined $r)
764 0 0 unless defined $color
773 0 11 if (not $file or $file eq '-') { }
774 0 0 unless open $fh, ">&STDOUT"
776 0 11 unless open $fh, ">", $file
789 11 0 unless not $file or $file eq "-"
800 0 0 unless $bmp->{'_lasty'} == $y