Branch Coverage

blib/lib/PDLA/IO/Pnm.pm
Criterion Covered Total %
branch 85 128 66.4


line true false branch
52 0 36 if $type == $PDLA_S or $type == $PDLA_L
60 0 0 unless defined $showflag
61 0 0 if (-s "$file")
62 0 0 unless open INPUT, $file
63 0 0 if ($showerr) { }
72 0 0 unless $showflag
78 0 0 unless defined $err
250 0 26 if $#_ < 0 or $#_ > 2
255 10 16 if (ref $file) { }
265 0 26 unless open STDERR, ">$efile"
270 0 26 unless $succeed
274 0 26 unless $magic =~ /P[1-6]/
275 0 26 if $PDLA::debug > 1
278 18 8 if $magic =~ /P[4-6]/
279 2 24 if $magic =~ /P[3,6]/
280 7 19 if ($magic =~ /P[1,4]/)
288 26 45 if $line =~ /^\s*$/
290 71 0 if ($line =~ /\s*(\S+)(.*)$/) { }
301 26 10 if ($dims[2] <= dmax($pdlt))
311 0 26 if $pgot < $params
312 0 26 if $dims[0] <= 0 or $dims[1] <= 0
316 2 24 if $isrgb
317 2 24 if ($pdl->getndims == 1 and $pdl->getdim(0) == 0 and $isrgb)
321 2 24 $isrgb ? :
322 18 8 if ($israw) { }
326 8 0 if $magic =~ /P([1-3])/
330 0 3 $isrgb ? :
3 0 $israw ? :
3 23 if $PDLA::debug
336 26 0 unless (isbigendian())
337 18 8 if ($israw)
338 8 10 if $type == $PDLA_US or $pdl->type == ushort()
339 0 18 if $type == $PDLA_L
373 0 24 if $#_ < 2
383 0 24 unless $type =~ /P[P,G,B]M/
387 0 2 if $type =~ /PPM/ and $#Dims != 2 || $Dims[0] != 3
389 0 24 if $type =~ /P[G,B]M/ and $#Dims != 1
391 0 24 if $pdl->get_datatype == $PDLA_F or $pdl->get_datatype == $PDLA_D
393 0 24 if $pdl->get_datatype != $PDLA_B || $pdl->get_datatype != $PDLA_US and $pdl->min < 0
398 8 0 if $pdl->get_datatype == $PDLA_B or $pdl->get_datatype == $PDLA_US or $type =~ /PBM/
399 8 16 if defined $raw and not $raw
402 4 3 $israw ? :
7 17 if $type =~ /PBM/
403 10 5 $israw ? :
15 9 if $type =~ /PGM/
404 2 0 $israw ? :
2 22 if $type =~ /PPM/
405 2 22 if $magic =~ /P[3,6]/
412 16 8 !($file =~ /^\s*[|>]/) ? :
414 0 24 unless open STDERR, ">$efile"
418 0 24 unless $succeed
422 3 0 $israw ? :
3 21 if $PDLA::debug
427 17 7 unless ($type =~ /PBM/)
430 9 8 if ($max < 256) { }
8 0 elsif ($max < 65536) { }
438 17 0 unless $type =~ /PBM/
442 2 22 $isrgb ? :
446 24 0 unless (isbigendian())
447 16 8 if ($israw)
449 16 0 unless $swap_inplace
450 6 10 if (255 < $max and $max < 65536) { }
0 10 elsif ($max >= 65536) { }
460 0 24 unless (close PNM)