Branch Coverage

blib/lib/GDS2.pm
Criterion Covered Total %
branch 267 864 30.9


line true false branch
544 0 8 unless defined $fileName
547 8 0 unless defined $fileHandle
549 0 8 if ($fileName and $fileHandle)
553 0 8 unless ($fileName or $fileHandle)
558 8 0 if ($fileName)
564 0 8 if ($openModStr =~ /^\+/)
569 5 3 if ($openModStr eq '>') { }
0 3 elsif ($openModStr eq '>>') { }
582 0 8 unless $fileHandle->open("$fileName", $openModeNum)
585 0 8 unless flock $fileHandle, $lockMode
589 8 0 unless (defined $resolution)
593 0 8 if $resolution <= 0 or not $resolution =~ /^\d+$/
701 0 5 if (defined $markEnd and $markEnd)
707 1 4 if (defined $pad and $pad > 0)
714 0 1 if $padSize == $pad
753 0 2 unless (defined $libName)
759 2 0 if (not defined $isoDate) { }
0 0 elsif ($isoDate != 0) { }
770 2 0 if (not defined $uUnit) { }
782 2 0 unless defined $dbUnit
788 0 2 if $isoDate
813 0 4 unless (defined $strName)
819 4 0 if (not defined $isoDate) { }
0 0 elsif ($isoDate != 0) { }
828 0 4 if (defined $createTime) { }
840 0 4 if (defined $modTime) { }
850 0 4 if ($isoDate)
893 0 2 unless defined $layer
896 2 0 unless defined $dataType
899 0 2 unless defined $pathType
902 2 0 unless defined $bgnExtn
905 2 0 unless defined $endExtn
910 0 2 if (defined $unitWidth and $unitWidth >= 0)
914 2 0 if (defined $widthReal and $widthReal >= 0)
922 0 2 unless (defined $xy or defined $xyInt)
926 0 2 if (defined $xyInt)
934 0 2 if $pathType
935 2 0 if $width
936 0 2 if ($pathType == 4)
943 12 0 if ($xy->[$i] >= 0) { }
946 0 2 if ($bgnExtn or $endExtn)
956 0 0 if ($bgnExtn)
958 0 0 if ($bgnX1 == $bgnX2) { }
0 0 elsif ($bgnY1 == $bgnY2) { }
960 0 0 if ($bgnY1 < $bgnY2) { }
963 0 0 if $pathType != 0
968 0 0 if $pathType != 0
973 0 0 if ($bgnX1 < $bgnX2) { }
976 0 0 if $pathType != 0
981 0 0 if $pathType != 0
986 0 0 if ($endExtn)
988 0 0 if ($endX1 == $endX2) { }
0 0 elsif ($endY1 == $endY2) { }
990 0 0 if ($endY1 < $endY2) { }
993 0 0 if $pathType != 0
998 0 0 if $pathType != 0
1003 0 0 if ($endX1 < $endX2) { }
1006 0 0 if $pathType != 0
1011 0 0 if $pathType != 0
1046 0 2 unless defined $layer
1048 2 0 unless defined $dataType
1053 0 2 unless (defined $xy or defined $xyInt)
1057 0 2 if (defined $xyInt)
1065 0 2 if (my $numPoints = $#$xy + 1 < 6)
1071 16 0 if ($xy->[$i] >= 0) { }
1075 2 0 if ($xy->[0] != $$xy[$#$xy - 1] or $xy->[1] != $$xy[$#$xy])
1077 2 0 if ($xy->[0] >= 0) { }
1079 2 0 if ($xy->[1] >= 0) { }
1116 0 2 unless (defined $sname)
1123 0 2 unless (defined $xy or defined $xyInt)
1127 0 2 if (defined $xyInt)
1135 2 0 if (not defined $reflect or $reflect <= 0) { }
1145 2 0 if (not defined $mag or $mag <= 0) { }
1155 2 0 if (not defined $angle) { }
1164 0 2 if ($useSTRANS)
1168 0 0 if $mag
1169 0 0 if $angle >= 0
1174 4 0 if ($xy->[$i] >= 0) { }
1214 0 2 unless (defined $sname)
1221 0 2 unless (defined $xy or defined $xyInt)
1225 0 2 if (defined $xyInt)
1233 2 0 if (not defined $reflect or $reflect <= 0) { }
1243 2 0 if (not defined $mag or $mag <= 0) { }
1253 2 0 if (not defined $angle) { }
1262 0 2 if ($useSTRANS)
1266 0 0 if $mag
1267 0 0 if $angle >= 0
1270 0 2 if (not defined $columns or $columns <= 0) { }
1279 0 2 if (not defined $rows or $rows <= 0) { }
1291 8 0 if ($xy->[$i] >= 0) { }
1335 0 0 unless (defined $string)
1345 0 0 if (defined $xyInt)
1350 0 0 if (defined $xy)
1357 0 0 if (defined $x2)
1361 0 0 unless (defined $x)
1365 0 0 if ($x >= 0) { }
1369 0 0 if (defined $y2)
1373 0 0 unless (defined $y)
1377 0 0 if ($y >= 0) { }
1381 0 0 unless defined $layer
1383 0 0 unless defined $textType
1385 0 0 if (not defined $reflect or $reflect <= 0) { }
1396 0 0 if (not defined $font or $font < 0 or $font > 3)
1406 0 0 if (defined $top) { }
0 0 elsif (defined $bottom) { }
1413 0 0 if (defined $left) { }
0 0 elsif (defined $right) { }
1420 0 0 if (not defined $mag or $mag <= 0) { }
1429 0 0 if (not defined $angle) { }
1440 0 0 if defined $font or defined $top or defined $middle or defined $bottom or defined $bottom or defined $left or defined $center or defined $right
1441 0 0 if ($useSTRANS)
1446 0 0 if $mag
1447 0 0 if $angle >= 0
1487 0 0 if (not defined $type) { }
1501 0 0 if defined $dataString and (defined $data[0] and $data[0] ne '')
1504 0 0 if ($type eq 'RECORD') { }
1514 0 0 unless (defined $scale)
1518 0 0 if ($scale <= 0)
1524 0 0 if (not defined $snap) { }
1532 0 0 if ($snap < 1)
1537 0 0 if (defined $data[0] and $data[0] ne '')
1541 0 0 if ($numDataElements) { }
1552 0 0 if (defined $dataString)
1556 0 0 unless $dataString =~ /'/
1559 0 0 if ($recordDataType == 1 or $recordDataType == 6) { }
1568 0 0 if ($recordDataType == 3)
1573 0 0 if ($data[$i] >= 0) { }
1582 0 0 if ($recordDataType == 1) { }
0 0 elsif ($recordDataType == 2) { }
0 0 elsif ($recordDataType == 3) { }
0 0 elsif ($recordDataType == 5) { }
0 0 elsif ($recordDataType == 6) { }
1612 0 0 if ($recordDataType == 1) { }
0 0 elsif ($recordDataType == 2) { }
0 0 elsif ($recordDataType == 3) { }
0 0 elsif ($recordDataType == 5) { }
0 0 elsif ($recordDataType == 6) { }
1628 0 0 if $scale != 1
1629 0 0 if $snap != 1
1639 0 0 if ($num < 0)
1652 0 0 if ($real != 0)
1661 0 0 if ($negative) { }
1667 0 0 if ($real >= 0) { }
1721 317 0 if (defined $type) { }
1731 0 255 if defined $dataString and (defined $data[0] and $data[0] ne '')
1738 277 40 unless defined $data[0]
1740 0 317 if ($type eq 'RECORD') { }
1742 0 0 if ($isLittleEndian) { }
1758 0 0 if ($recordLength > 4)
1763 0 0 if ($recordDataType == 2 or $recordDataType == 1) { }
0 0 elsif ($recordDataType == 3) { }
0 0 elsif ($recordDataType == 5) { }
0 0 elsif ($recordDataType == 6) { }
0 0 elsif ($recordDataType == 4) { }
1830 317 0 unless (defined $scale)
1834 0 317 if ($scale <= 0)
1840 317 0 if (not defined $snap) { }
1848 0 317 if ($snap < 1)
1853 40 277 if (defined $data[0] and $data[0] ne '')
1857 18 22 if ($numDataElements) { }
1869 255 62 if (defined $dataString)
1873 225 30 unless $dataString =~ /'/
1876 57 198 if ($recordDataType == 1 or $recordDataType == 6) { }
1885 33 165 if ($recordDataType == 3)
1890 126 39 if ($data[$i] >= 0) { }
1899 27 290 if ($recordDataType == 1) { }
87 203 elsif ($recordDataType == 2) { }
43 160 elsif ($recordDataType == 3) { }
26 134 elsif ($recordDataType == 5) { }
40 94 elsif ($recordDataType == 6) { }
1921 317 0 if ($isLittleEndian) { }
1933 317 0 if $isLittleEndian
1937 317 0 if $isLittleEndian
1940 27 290 if ($recordDataType == 1) { }
87 203 elsif ($recordDataType == 2) { }
43 160 elsif ($recordDataType == 3) { }
26 134 elsif ($recordDataType == 5) { }
40 94 elsif ($recordDataType == 6) { }
1952 287 0 if $isLittleEndian
1961 0 211 if $scale != 1
1962 0 211 if $snap != 1
1964 211 0 if $isLittleEndian
1975 0 31 if ($num < 0)
1988 31 0 if ($real != 0)
1996 0 31 if ($negative) { }
1999 31 0 if $isLittleEndian
2004 217 0 if ($real >= 0) { }
2007 217 0 if $isLittleEndian
2035 0 0 unless (defined $record)
2040 0 0 if (defined $type)
2072 2 170 if $self->{'EOLIB'}
2100 24 232 if not $self->{'INDATA'} and $self->{'INHEADER'} != -1
2105 1 255 if $self->{'EOLIB'}
2108 0 255 unless read $self->{'FileHandle'}, $buffer, 4
2113 255 0 if $isLittleEndian
2122 255 0 if $isLittleEndian
2125 3 252 if $self->{'RecordType'} == 4
2127 252 3 if ($self->{'UsingPrettyPrint'})
2129 9 243 if $self->{'RecordType'} == 7
2130 9 243 if $self->{'RecordType'} == 5
2134 9 222 if $self->{'RecordType'} == 12 or $self->{'RecordType'} == 9 or $self->{'RecordType'} == 8 or $self->{'RecordType'} == 10 or $self->{'RecordType'} == 11
2135 30 222 if ($self->{'RecordType'} == 17)
2141 9 243 if $self->{'RecordType'} == 12
2142 9 243 if $self->{'RecordType'} == 8
2143 12 240 if ($self->{'RecordType'} == 2 or $self->{'RecordType'} == 6)
2148 12 240 if $self->{'RecordType'} == 1 or $self->{'RecordType'} == 5
2155 255 0 if $isLittleEndian
2183 0 255 if $self->{'INHEADER'} != 1
2184 72 183 if $self->{'DataType'} == 0
2192 27 156 if ($self->{'DataType'} == 1) { }
69 87 elsif ($self->{'DataType'} == 2) { }
33 54 elsif ($self->{'DataType'} == 3) { }
0 54 elsif ($self->{'DataType'} == 4) { }
24 30 elsif ($self->{'DataType'} == 5) { }
30 0 elsif ($self->{'DataType'} == 6) { }
2196 27 0 if $isLittleEndian
2209 201 0 if $isLittleEndian
2229 165 0 if $isLittleEndian
2255 0 27 if ($negative) { }
2275 0 27 if $negative
2276 6 21 if ($RecordTypeStrings[$self->{'RecordType'}] eq 'UNITS') { }
2278 3 3 if ($self->{'UUnits'} == -1) { }
3 0 elsif ($self->{'DBUnits'} == -1) { }
2290 21 0 if $self->{'UUnits'} != 0
2368 170 85 unless defined $compact
2374 170 85 unless ($compact)
2376 164 6 if $self->{'RecordType'} != 5
2382 150 6 unless $self->{'RecordType'} == 8 or $self->{'RecordType'} == 9 or $self->{'RecordType'} == 12 or $self->{'RecordType'} == 10 or $self->{'RecordType'} == 11
2386 85 170 if ($compact) { }
2397 27 689 if ($self->{'DataType'} == 1) { }
201 488 elsif ($self->{'DataType'} == 2) { }
165 323 elsif ($self->{'DataType'} == 3) { }
27 296 elsif ($self->{'DataType'} == 5) { }
30 266 elsif ($self->{'DataType'} == 6) { }
2400 27 0 if ($isLittleEndian)
2405 9 18 if ($compact) { }
2407 2 7 if $bitString =~ /^1/
2408 3 6 if ($inText and $self->{'RecordType'} != 26)
2411 3 0 if $bitString =~ /00....$/
2412 0 3 if $bitString =~ /01....$/
2413 0 3 if $bitString =~ /10....$/
2414 0 3 if $bitString =~ /11....$/
2415 0 3 if $bitString =~ /00..$/
2416 0 3 if $bitString =~ /01..$/
2417 3 0 if $bitString =~ /10..$/
2418 2 1 if $bitString =~ /00$/
2419 0 3 if $bitString =~ /01$/
2420 1 2 if $bitString =~ /10$/
2430 67 134 if ($compact) { }
2432 48 19 if ($dateFld) { }
2435 8 40 if ($dateFld =~ /^[17]$/)
2437 4 4 if ($dateFld eq '1') { }
4 0 elsif ($dateFld eq '7') { }
2439 1 3 if ($recordType eq 'BGNLIB') { }
2450 1 3 if ($recordType eq 'BGNLIB') { }
2459 8 0 if $num < 1900
2462 16 32 if $dateFld =~ /^[2389]/
2463 8 40 if $dateFld =~ /^[56]/
2464 8 40 if $dateFld =~ /^1[12]/
2465 8 40 if $dateFld eq '4' or $dateFld eq '10'
2470 8 11 unless $string =~ / (a|m|pt|dt|tt)$/i
2479 0 201 if ($recordType eq 'UNITS')
2487 55 110 if ($compact) { }
2489 44 11 if $i
2496 10 45 if ($compact and $i and $i == $#{$$self{'RecordData'};})
2498 3 7 if $inBoundary
2504 9 18 if ($compact) { }
2506 2 7 unless $string =~ / (a|m|pt|dt|tt)$/i
2513 3 24 if ($num =~ /e/i) { }
2522 6 21 if ($recordType eq 'UNITS')
2530 20 10 unless $compact
2534 144 572 if $dateFld
2537 85 170 if ($compact)
2540 20 65 if ($G_gdtString =~ /}$/ or $G_gdtString =~ /^(gds2|lib|m).*\d$/ or $G_gdtString =~ /^cell.*'$/) { }
2579 0 0 unless defined $asInteger
2581 0 0 unless defined $withClosure
2583 0 0 if ($self->isXy)
2587 0 0 if ($withClosure) { }
2589 0 0 if $asInteger
2598 0 0 if ($asInteger) { }
2633 0 0 unless defined $gds2File
2636 0 0 unless defined $PGR
2640 0 0 if $self->{'RecordType'} != 5
2646 0 0 unless $self->{'RecordType'} == 12 or $self->{'RecordType'} == 9 or $self->{'RecordType'} == 8 or $self->{'RecordType'} == 10 or $self->{'RecordType'} == 11
2648 0 0 if ($self->{'RecordType'} == 12 or $self->{'RecordType'} == 9 or $self->{'RecordType'} == 8 or $self->{'RecordType'} == 10 or $self->{'RecordType'} == 11 or $self->{'RecordType'} == 17 or $self->{'RecordType'} == 7 or $self->{'RecordType'} == 4) { }
2666 0 0 if ($maxi >= 1)
2669 0 0 if ($self->{'DataType'} == 1) { }
0 0 elsif ($self->{'DataType'} == 2) { }
0 0 elsif ($self->{'DataType'} == 3) { }
0 0 elsif ($self->{'DataType'} == 5) { }
0 0 elsif ($self->{'DataType'} == 6) { }
2672 0 0 if ($isLittleEndian)
2695 0 0 if ($i < $maxi)
2698 0 0 if ($maxi >= 1)
2723 0 0 if (defined $angle) { }
2731 0 0 if $angle >= 0
2746 0 0 unless (defined $string)
2765 0 0 unless (defined $num)
2770 0 0 if ($num >= 0) { }
2789 0 0 if (not defined $isoDate) { }
0 0 elsif ($isoDate != 0) { }
2799 0 0 if $isoDate
2829 0 0 unless (defined $num)
2848 0 0 if (not defined $columns or $columns <= 0) { }
2857 0 0 if (not defined $rows or $rows <= 0) { }
2880 0 0 unless defined $dataType
2903 0 0 unless (defined $num)
2933 0 0 unless (defined $num)
2938 0 0 if ($num >= 0) { }
2988 0 0 unless (defined $string)
3000 0 0 unless (defined $num)
3028 0 0 unless (defined $rev)
3049 0 0 unless defined $layer
3072 0 0 unless (defined $libName)
3091 0 0 unless (defined $num)
3103 0 0 unless (defined $num)
3124 0 0 unless defined $pathType
3125 0 0 if $pathType
3142 0 0 if not defined $mag or $mag <= 0
3144 0 0 if $mag
3152 0 0 unless (defined $string)
3180 0 0 unless (defined $num)
3192 0 0 unless (defined $num)
3218 0 0 if (not defined $font or $font < 0 or $font > 3)
3228 0 0 if (defined $top) { }
0 0 elsif (defined $bottom) { }
3235 0 0 if (defined $left) { }
0 0 elsif (defined $right) { }
3256 0 0 unless (defined $num)
3275 0 0 unless (defined $string)
3287 0 0 unless (defined $string)
3299 0 0 unless (defined $num)
3318 0 0 unless (defined $string)
3351 0 0 if (not defined $reflect or $reflect <= 0) { }
3382 0 0 unless (defined $string)
3401 0 0 unless (defined $strName)
3420 0 0 unless (defined $string)
3432 0 0 unless (defined $num)
3444 0 0 unless (defined $num)
3470 0 0 unless (defined $num)
3474 0 0 if $num < 0
3499 0 0 if (not defined $uUnit) { }
3510 0 0 unless (defined $dbUnit)
3539 0 0 if (not defined $width or $width <= 0)
3543 0 0 if $width
3565 0 0 unless (defined $xy or defined $xyInt)
3569 0 0 if (defined $xyInt)
3577 0 0 if ($xy->[$i] >= 0) { }
3621 0 0 if ($self->isBgnextn) { }
3637 0 0 if ($self->isDatatype) { }
3652 0 0 if ($self->isEndextn) { }
3669 0 0 if ($self->isLayer) { }
3684 0 0 if ($self->isPathtype) { }
3699 0 0 if ($self->isPropattr) { }
3713 0 0 if ($self->isPropvalue) { }
3725 0 0 if ($self->isSname) { }
3737 0 0 if ($self->isString) { }
3749 0 0 if ($self->isStrname) { }
3765 0 0 if ($self->isTexttype) { }
3780 0 0 if ($self->isWidth) { }
3800 0 0 if ($self->{'RecordType'} == 11) { }
3812 0 0 if ($self->{'RecordType'} == 1) { }
3824 0 0 if ($self->{'RecordType'} == 5) { }
3836 0 0 if ($self->{'RecordType'} == 8) { }
3848 0 0 if ($self->{'RecordType'} == 14) { }
3860 0 0 if ($self->{'RecordType'} == 4) { }
3872 0 0 if ($self->{'RecordType'} == 17) { }
3884 0 0 if ($self->{'RecordType'} == 7) { }
3897 0 0 if ($self->{'RecordType'} == 0) { }
3909 0 0 if ($self->{'RecordType'} == 2) { }
3921 0 0 if ($self->{'RecordType'} == 9) { }
3933 0 0 if ($self->{'RecordType'} == 10) { }
3945 0 0 if ($self->{'RecordType'} == 58) { }
3957 0 0 if ($self->{'RecordType'} == 12) { }
3969 0 0 if ($self->{'RecordType'} == 3) { }
3981 0 0 if ($self->{'RecordType'} == 13) { }
3993 0 0 if ($self->{'RecordType'} == 6) { }
4005 0 0 if ($self->{'RecordType'} == 15) { }
4017 0 0 if ($self->{'RecordType'} == 16) { }
4029 0 0 if ($self->{'RecordType'} == 18) { }
4041 0 0 if ($self->{'RecordType'} == 19) { }
4053 0 0 if ($self->{'RecordType'} == 20) { }
4065 0 0 if ($self->{'RecordType'} == 21) { }
4077 0 0 if ($self->{'RecordType'} == 22) { }
4089 0 0 if ($self->{'RecordType'} == 23) { }
4101 0 0 if ($self->{'RecordType'} == 24) { }
4113 0 0 if ($self->{'RecordType'} == 25) { }
4125 0 0 if ($self->{'RecordType'} == 26) { }
4137 0 0 if ($self->{'RecordType'} == 27) { }
4149 0 0 if ($self->{'RecordType'} == 28) { }
4161 0 0 if ($self->{'RecordType'} == 29) { }
4173 0 0 if ($self->{'RecordType'} == 30) { }
4185 0 0 if ($self->{'RecordType'} == 31) { }
4197 0 0 if ($self->{'RecordType'} == 32) { }
4209 0 0 if ($self->{'RecordType'} == 33) { }
4221 0 0 if ($self->{'RecordType'} == 34) { }
4233 0 0 if ($self->{'RecordType'} == 35) { }
4245 0 0 if ($self->{'RecordType'} == 36) { }
4257 0 0 if ($self->{'RecordType'} == 37) { }
4269 0 0 if ($self->{'RecordType'} == 38) { }
4281 0 0 if ($self->{'RecordType'} == 39) { }
4293 0 0 if ($self->{'RecordType'} == 40) { }
4305 0 0 if ($self->{'RecordType'} == 41) { }
4317 0 0 if ($self->{'RecordType'} == 42) { }
4329 0 0 if ($self->{'RecordType'} == 43) { }
4341 0 0 if ($self->{'RecordType'} == 44) { }
4353 0 0 if ($self->{'RecordType'} == 45) { }
4365 0 0 if ($self->{'RecordType'} == 46) { }
4377 0 0 if ($self->{'RecordType'} == 47) { }
4389 0 0 if ($self->{'RecordType'} == 48) { }
4401 0 0 if ($self->{'RecordType'} == 49) { }
4413 0 0 if ($self->{'RecordType'} == 50) { }
4425 0 0 if ($self->{'RecordType'} == 51) { }
4437 0 0 if ($self->{'RecordType'} == 52) { }
4449 0 0 if ($self->{'RecordType'} == 53) { }
4461 0 0 if ($self->{'RecordType'} == 54) { }
4473 0 0 if ($self->{'RecordType'} == 55) { }
4485 0 0 if ($self->{'RecordType'} == 56) { }
4497 0 0 if ($self->{'RecordType'} == 57) { }
4509 0 0 if ($self->{'RecordType'} == 59) { }
4521 0 0 if ($dt == 0) { }
0 0 elsif ($dt == 2 or $dt == 3 or $dt == 5) { }
0 0 elsif ($dt == 6) { }
4554 0 24 if $self->{'INHEADER'} != 1
4568 0 0 if ($self->{'RecordType'} == 16) { }
4592 0 0 unless $num =~ /^-?\d+/
4594 0 0 if $num =~ /\./
4602 0 0 unless $num =~ /^-?\d+$/
4606 0 0 if $num < 0
4609 0 0 if ($num < 0)
4615 0 0 if ($bigPart =~ /^[-]?$/) { }
4690 0 0 if ($self->isUnits) { }