Branch Coverage

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


line true false branch
542 0 8 unless defined $fileName
545 8 0 unless defined $fileHandle
547 0 8 if ($fileName and $fileHandle)
551 0 8 unless ($fileName or $fileHandle)
556 8 0 if ($fileName)
562 0 8 if ($openModStr =~ /^\+/)
567 5 3 if ($openModStr eq '>') { }
0 3 elsif ($openModStr eq '>>') { }
580 0 8 unless $fileHandle->open("$fileName", $openModeNum)
583 0 8 unless flock $fileHandle, $lockMode
587 8 0 unless (defined $resolution)
591 0 8 if $resolution <= 0 or not $resolution =~ /^\d+$/
699 0 5 if (defined $markEnd and $markEnd)
705 1 4 if (defined $pad and $pad > 0)
712 0 1 if $padSize == $pad
751 0 2 unless (defined $libName)
757 2 0 if (not defined $isoDate) { }
0 0 elsif ($isoDate != 0) { }
768 2 0 if (not defined $uUnit) { }
780 2 0 unless defined $dbUnit
786 0 2 if $isoDate
811 0 4 unless (defined $strName)
817 4 0 if (not defined $isoDate) { }
0 0 elsif ($isoDate != 0) { }
826 0 4 if (defined $createTime) { }
838 0 4 if (defined $modTime) { }
848 0 4 if ($isoDate)
891 0 2 unless defined $layer
894 2 0 unless defined $dataType
897 0 2 unless defined $pathType
900 2 0 unless defined $bgnExtn
903 2 0 unless defined $endExtn
908 0 2 if (defined $unitWidth and $unitWidth >= 0)
912 2 0 if (defined $widthReal and $widthReal >= 0)
920 0 2 unless (defined $xy or defined $xyInt)
924 0 2 if (defined $xyInt)
932 0 2 if $pathType
933 2 0 if $width
934 0 2 if ($pathType == 4)
941 12 0 if ($$xy[$i] >= 0) { }
944 0 2 if ($bgnExtn or $endExtn)
954 0 0 if ($bgnExtn)
956 0 0 if ($bgnX1 == $bgnX2) { }
0 0 elsif ($bgnY1 == $bgnY2) { }
958 0 0 if ($bgnY1 < $bgnY2) { }
961 0 0 if $pathType != 0
966 0 0 if $pathType != 0
971 0 0 if ($bgnX1 < $bgnX2) { }
974 0 0 if $pathType != 0
979 0 0 if $pathType != 0
984 0 0 if ($endExtn)
986 0 0 if ($endX1 == $endX2) { }
0 0 elsif ($endY1 == $endY2) { }
988 0 0 if ($endY1 < $endY2) { }
991 0 0 if $pathType != 0
996 0 0 if $pathType != 0
1001 0 0 if ($endX1 < $endX2) { }
1004 0 0 if $pathType != 0
1009 0 0 if $pathType != 0
1044 0 2 unless defined $layer
1046 2 0 unless defined $dataType
1051 0 2 unless (defined $xy or defined $xyInt)
1055 0 2 if (defined $xyInt)
1063 0 2 if (my $numPoints = $#$xy + 1 < 6)
1069 16 0 if ($$xy[$i] >= 0) { }
1073 2 0 if ($$xy[0] != $$xy[$#$xy - 1] or $$xy[1] != $$xy[$#$xy])
1075 2 0 if ($$xy[0] >= 0) { }
1077 2 0 if ($$xy[1] >= 0) { }
1114 0 2 unless (defined $sname)
1121 0 2 unless (defined $xy or defined $xyInt)
1125 0 2 if (defined $xyInt)
1133 2 0 if (not defined $reflect or $reflect <= 0) { }
1143 2 0 if (not defined $mag or $mag <= 0) { }
1153 2 0 if (not defined $angle) { }
1162 0 2 if ($useSTRANS)
1166 0 0 if $mag
1167 0 0 if $angle >= 0
1172 4 0 if ($$xy[$i] >= 0) { }
1212 0 2 unless (defined $sname)
1219 0 2 unless (defined $xy or defined $xyInt)
1223 0 2 if (defined $xyInt)
1231 2 0 if (not defined $reflect or $reflect <= 0) { }
1241 2 0 if (not defined $mag or $mag <= 0) { }
1251 2 0 if (not defined $angle) { }
1260 0 2 if ($useSTRANS)
1264 0 0 if $mag
1265 0 0 if $angle >= 0
1268 0 2 if (not defined $columns or $columns <= 0) { }
1277 0 2 if (not defined $rows or $rows <= 0) { }
1289 8 0 if ($$xy[$i] >= 0) { }
1333 0 0 unless (defined $string)
1343 0 0 if (defined $xyInt)
1348 0 0 if (defined $xy)
1355 0 0 if (defined $x2)
1359 0 0 unless (defined $x)
1363 0 0 if ($x >= 0) { }
1367 0 0 if (defined $y2)
1371 0 0 unless (defined $y)
1375 0 0 if ($y >= 0) { }
1379 0 0 unless defined $layer
1381 0 0 unless defined $textType
1383 0 0 if (not defined $reflect or $reflect <= 0) { }
1394 0 0 if (not defined $font or $font < 0 or $font > 3)
1404 0 0 if (defined $top) { }
0 0 elsif (defined $bottom) { }
1411 0 0 if (defined $left) { }
0 0 elsif (defined $right) { }
1418 0 0 if (not defined $mag or $mag <= 0) { }
1427 0 0 if (not defined $angle) { }
1438 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
1439 0 0 if ($useSTRANS)
1444 0 0 if $mag
1445 0 0 if $angle >= 0
1485 0 0 if (not defined $type) { }
1499 0 0 if defined $dataString and (defined $data[0] and $data[0] ne '')
1502 0 0 if ($type eq 'RECORD') { }
1512 0 0 unless (defined $scale)
1516 0 0 if ($scale <= 0)
1522 0 0 if (not defined $snap) { }
1530 0 0 if ($snap < 1)
1535 0 0 if (defined $data[0] and $data[0] ne '')
1539 0 0 if ($numDataElements) { }
1550 0 0 if (defined $dataString)
1554 0 0 unless $dataString =~ /'/
1557 0 0 if ($recordDataType == 1 or $recordDataType == 6) { }
1566 0 0 if ($recordDataType == 3)
1571 0 0 if ($data[$i] >= 0) { }
1580 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) { }
1610 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) { }
1626 0 0 if $scale != 1
1627 0 0 if $snap != 1
1637 0 0 if ($num < 0)
1650 0 0 if ($real != 0)
1659 0 0 if ($negative) { }
1665 0 0 if ($real >= 0) { }
1719 0 317 if (not defined $type) { }
1729 0 255 if defined $dataString and (defined $data[0] and $data[0] ne '')
1736 277 40 unless defined $data[0]
1738 0 317 if ($type eq 'RECORD') { }
1740 0 0 if ($isLittleEndian) { }
1756 0 0 if ($recordLength > 4)
1761 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) { }
1828 317 0 unless (defined $scale)
1832 0 317 if ($scale <= 0)
1838 317 0 if (not defined $snap) { }
1846 0 317 if ($snap < 1)
1851 40 277 if (defined $data[0] and $data[0] ne '')
1855 18 22 if ($numDataElements) { }
1867 255 62 if (defined $dataString)
1871 225 30 unless $dataString =~ /'/
1874 57 198 if ($recordDataType == 1 or $recordDataType == 6) { }
1883 33 165 if ($recordDataType == 3)
1888 126 39 if ($data[$i] >= 0) { }
1897 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) { }
1919 317 0 if ($isLittleEndian) { }
1931 317 0 if $isLittleEndian
1935 317 0 if $isLittleEndian
1938 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) { }
1950 287 0 if $isLittleEndian
1959 0 211 if $scale != 1
1960 0 211 if $snap != 1
1962 211 0 if $isLittleEndian
1973 0 31 if ($num < 0)
1986 31 0 if ($real != 0)
1994 0 31 if ($negative) { }
1997 31 0 if $isLittleEndian
2002 217 0 if ($real >= 0) { }
2005 217 0 if $isLittleEndian
2033 0 0 unless (defined $record)
2038 0 0 if (defined $type)
2070 2 170 if $$self{'EOLIB'}
2098 24 232 if not $$self{'INDATA'} and $$self{'INHEADER'} != -1
2103 1 255 if $$self{'EOLIB'}
2106 0 255 unless read $$self{'FileHandle'}, $buffer, 4
2111 255 0 if $isLittleEndian
2120 255 0 if $isLittleEndian
2123 3 252 if $$self{'RecordType'} == 4
2125 252 3 if ($$self{'UsingPrettyPrint'})
2127 9 243 if $$self{'RecordType'} == 7
2128 9 243 if $$self{'RecordType'} == 5
2130 9 222 if $$self{'RecordType'} == 12 or $$self{'RecordType'} == 9 or $$self{'RecordType'} == 8 or $$self{'RecordType'} == 10 or $$self{'RecordType'} == 11
2133 30 222 if ($$self{'RecordType'} == 17)
2139 9 243 if $$self{'RecordType'} == 12
2140 9 243 if $$self{'RecordType'} == 8
2141 12 240 if ($$self{'RecordType'} == 2 or $$self{'RecordType'} == 6)
2146 12 240 if $$self{'RecordType'} == 1 or $$self{'RecordType'} == 5
2153 255 0 if $isLittleEndian
2181 0 255 if $$self{'INHEADER'} != 1
2182 72 183 if $$self{'DataType'} == 0
2190 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) { }
2194 27 0 if $isLittleEndian
2207 201 0 if $isLittleEndian
2227 165 0 if $isLittleEndian
2253 0 27 if ($negative) { }
2273 0 27 if $negative
2274 6 21 if ($RecordTypeStrings[$$self{'RecordType'}] eq 'UNITS') { }
2276 3 3 if ($$self{'UUnits'} == -1) { }
3 0 elsif ($$self{'DBUnits'} == -1) { }
2288 21 0 if $$self{'UUnits'} != 0
2366 170 85 unless defined $compact
2372 170 85 unless ($compact)
2374 164 6 if $$self{'RecordType'} != 5
2375 150 6 unless $$self{'RecordType'} == 8 or $$self{'RecordType'} == 9 or $$self{'RecordType'} == 12 or $$self{'RecordType'} == 10 or $$self{'RecordType'} == 11
2384 85 170 if ($compact) { }
2395 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) { }
2398 27 0 if ($isLittleEndian)
2403 9 18 if ($compact) { }
2405 2 7 if $bitString =~ /^1/
2406 3 6 if ($inText and $$self{'RecordType'} != 26)
2409 3 0 if $bitString =~ /00....$/
2410 0 3 if $bitString =~ /01....$/
2411 0 3 if $bitString =~ /10....$/
2412 0 3 if $bitString =~ /11....$/
2413 0 3 if $bitString =~ /00..$/
2414 0 3 if $bitString =~ /01..$/
2415 3 0 if $bitString =~ /10..$/
2416 2 1 if $bitString =~ /00$/
2417 0 3 if $bitString =~ /01$/
2418 1 2 if $bitString =~ /10$/
2428 67 134 if ($compact) { }
2430 48 19 if ($dateFld) { }
2433 8 40 if ($dateFld =~ /^[17]$/)
2435 4 4 if ($dateFld eq '1') { }
4 0 elsif ($dateFld eq '7') { }
2437 1 3 if ($recordType eq 'BGNLIB') { }
2448 1 3 if ($recordType eq 'BGNLIB') { }
2457 8 0 if $num < 1900
2460 16 32 if $dateFld =~ /^[2389]/
2461 8 40 if $dateFld =~ /^[56]/
2462 8 40 if $dateFld =~ /^1[12]/
2463 8 40 if $dateFld eq '4' or $dateFld eq '10'
2468 8 11 unless $string =~ / (a|m|pt|dt|tt)$/i
2477 0 201 if ($recordType eq 'UNITS')
2485 55 110 if ($compact) { }
2487 44 11 if $i
2494 10 45 if ($compact and $i and $i == $#{$$self{'RecordData'};})
2496 3 7 if $inBoundary
2502 9 18 if ($compact) { }
2504 2 7 unless $string =~ / (a|m|pt|dt|tt)$/i
2511 3 24 if ($num =~ /e/i) { }
2520 6 21 if ($recordType eq 'UNITS')
2528 20 10 unless $compact
2532 144 572 if $dateFld
2535 85 170 if ($compact)
2538 20 65 if ($G_gdtString =~ /}$/ or $G_gdtString =~ /^(gds2|lib|m).*\d$/ or $G_gdtString =~ /^cell.*'$/) { }
2577 0 0 unless defined $asInteger
2579 0 0 unless defined $withClosure
2581 0 0 if ($self->isXy)
2585 0 0 if ($withClosure) { }
2587 0 0 if $asInteger
2596 0 0 if ($asInteger) { }
2631 0 0 unless defined $gds2File
2634 0 0 unless defined $PGR
2638 0 0 if $$self{'RecordType'} != 5
2639 0 0 unless $$self{'RecordType'} == 12 or $$self{'RecordType'} == 9 or $$self{'RecordType'} == 8 or $$self{'RecordType'} == 10 or $$self{'RecordType'} == 11
2646 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) { }
2664 0 0 if ($maxi >= 1)
2667 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) { }
2670 0 0 if ($isLittleEndian)
2693 0 0 if ($i < $maxi)
2696 0 0 if ($maxi >= 1)
2721 0 0 if (defined $angle) { }
2729 0 0 if $angle >= 0
2744 0 0 unless (defined $string)
2763 0 0 unless (defined $num)
2768 0 0 if ($num >= 0) { }
2787 0 0 if (not defined $isoDate) { }
0 0 elsif ($isoDate != 0) { }
2797 0 0 if $isoDate
2827 0 0 unless (defined $num)
2846 0 0 if (not defined $columns or $columns <= 0) { }
2855 0 0 if (not defined $rows or $rows <= 0) { }
2878 0 0 unless defined $dataType
2901 0 0 unless (defined $num)
2931 0 0 unless (defined $num)
2936 0 0 if ($num >= 0) { }
2986 0 0 unless (defined $string)
2998 0 0 unless (defined $num)
3026 0 0 unless (defined $rev)
3047 0 0 unless defined $layer
3070 0 0 unless (defined $libName)
3089 0 0 unless (defined $num)
3101 0 0 unless (defined $num)
3122 0 0 unless defined $pathType
3123 0 0 if $pathType
3140 0 0 if not defined $mag or $mag <= 0
3142 0 0 if $mag
3150 0 0 unless (defined $string)
3178 0 0 unless (defined $num)
3190 0 0 unless (defined $num)
3216 0 0 if (not defined $font or $font < 0 or $font > 3)
3226 0 0 if (defined $top) { }
0 0 elsif (defined $bottom) { }
3233 0 0 if (defined $left) { }
0 0 elsif (defined $right) { }
3254 0 0 unless (defined $num)
3273 0 0 unless (defined $string)
3285 0 0 unless (defined $string)
3297 0 0 unless (defined $num)
3316 0 0 unless (defined $string)
3349 0 0 if (not defined $reflect or $reflect <= 0) { }
3380 0 0 unless (defined $string)
3399 0 0 unless (defined $strName)
3418 0 0 unless (defined $string)
3430 0 0 unless (defined $num)
3442 0 0 unless (defined $num)
3468 0 0 unless (defined $num)
3472 0 0 if $num < 0
3497 0 0 if (not defined $uUnit) { }
3508 0 0 unless (defined $dbUnit)
3537 0 0 if (not defined $width or $width <= 0)
3541 0 0 if $width
3563 0 0 unless (defined $xy or defined $xyInt)
3567 0 0 if (defined $xyInt)
3575 0 0 if ($$xy[$i] >= 0) { }
3619 0 0 if ($self->isBgnextn) { }
3635 0 0 if ($self->isDatatype) { }
3650 0 0 if ($self->isEndextn) { }
3667 0 0 if ($self->isLayer) { }
3682 0 0 if ($self->isPathtype) { }
3697 0 0 if ($self->isPropattr) { }
3711 0 0 if ($self->isPropvalue) { }
3723 0 0 if ($self->isSname) { }
3735 0 0 if ($self->isString) { }
3747 0 0 if ($self->isStrname) { }
3763 0 0 if ($self->isTexttype) { }
3778 0 0 if ($self->isWidth) { }
3798 0 0 if ($$self{'RecordType'} == 11) { }
3810 0 0 if ($$self{'RecordType'} == 1) { }
3822 0 0 if ($$self{'RecordType'} == 5) { }
3834 0 0 if ($$self{'RecordType'} == 8) { }
3846 0 0 if ($$self{'RecordType'} == 14) { }
3858 0 0 if ($$self{'RecordType'} == 4) { }
3870 0 0 if ($$self{'RecordType'} == 17) { }
3882 0 0 if ($$self{'RecordType'} == 7) { }
3895 0 0 if ($$self{'RecordType'} == 0) { }
3907 0 0 if ($$self{'RecordType'} == 2) { }
3919 0 0 if ($$self{'RecordType'} == 9) { }
3931 0 0 if ($$self{'RecordType'} == 10) { }
3943 0 0 if ($$self{'RecordType'} == 58) { }
3955 0 0 if ($$self{'RecordType'} == 12) { }
3967 0 0 if ($$self{'RecordType'} == 3) { }
3979 0 0 if ($$self{'RecordType'} == 13) { }
3991 0 0 if ($$self{'RecordType'} == 6) { }
4003 0 0 if ($$self{'RecordType'} == 15) { }
4015 0 0 if ($$self{'RecordType'} == 16) { }
4027 0 0 if ($$self{'RecordType'} == 18) { }
4039 0 0 if ($$self{'RecordType'} == 19) { }
4051 0 0 if ($$self{'RecordType'} == 20) { }
4063 0 0 if ($$self{'RecordType'} == 21) { }
4075 0 0 if ($$self{'RecordType'} == 22) { }
4087 0 0 if ($$self{'RecordType'} == 23) { }
4099 0 0 if ($$self{'RecordType'} == 24) { }
4111 0 0 if ($$self{'RecordType'} == 25) { }
4123 0 0 if ($$self{'RecordType'} == 26) { }
4135 0 0 if ($$self{'RecordType'} == 27) { }
4147 0 0 if ($$self{'RecordType'} == 28) { }
4159 0 0 if ($$self{'RecordType'} == 29) { }
4171 0 0 if ($$self{'RecordType'} == 30) { }
4183 0 0 if ($$self{'RecordType'} == 31) { }
4195 0 0 if ($$self{'RecordType'} == 32) { }
4207 0 0 if ($$self{'RecordType'} == 33) { }
4219 0 0 if ($$self{'RecordType'} == 34) { }
4231 0 0 if ($$self{'RecordType'} == 35) { }
4243 0 0 if ($$self{'RecordType'} == 36) { }
4255 0 0 if ($$self{'RecordType'} == 37) { }
4267 0 0 if ($$self{'RecordType'} == 38) { }
4279 0 0 if ($$self{'RecordType'} == 39) { }
4291 0 0 if ($$self{'RecordType'} == 40) { }
4303 0 0 if ($$self{'RecordType'} == 41) { }
4315 0 0 if ($$self{'RecordType'} == 42) { }
4327 0 0 if ($$self{'RecordType'} == 43) { }
4339 0 0 if ($$self{'RecordType'} == 44) { }
4351 0 0 if ($$self{'RecordType'} == 45) { }
4363 0 0 if ($$self{'RecordType'} == 46) { }
4375 0 0 if ($$self{'RecordType'} == 47) { }
4387 0 0 if ($$self{'RecordType'} == 48) { }
4399 0 0 if ($$self{'RecordType'} == 49) { }
4411 0 0 if ($$self{'RecordType'} == 50) { }
4423 0 0 if ($$self{'RecordType'} == 51) { }
4435 0 0 if ($$self{'RecordType'} == 52) { }
4447 0 0 if ($$self{'RecordType'} == 53) { }
4459 0 0 if ($$self{'RecordType'} == 54) { }
4471 0 0 if ($$self{'RecordType'} == 55) { }
4483 0 0 if ($$self{'RecordType'} == 56) { }
4495 0 0 if ($$self{'RecordType'} == 57) { }
4507 0 0 if ($$self{'RecordType'} == 59) { }
4519 0 0 if ($dt == 0) { }
0 0 elsif ($dt == 2 or $dt == 3 or $dt == 5) { }
0 0 elsif ($dt == 6) { }
4552 0 24 if $$self{'INHEADER'} != 1
4566 0 0 if ($$self{'RecordType'} == 16) { }
4590 0 0 unless $num =~ /^-?\d+/
4592 0 0 if $num =~ /\./
4600 0 0 unless $num =~ /^-?\d+$/
4604 0 0 if $num < 0
4607 0 0 if ($num < 0)
4613 0 0 if ($bigPart =~ /^[-]?$/) { }
4688 0 0 if ($self->isUnits) { }