Condition Coverage

blib/lib/Image/ExifTool/WriteXMP.pl
Criterion Covered Total %
condition 237 370 64.0


and 3 conditions

line !l l&&!r l&&r condition
99 0 0 0 $et->{'XmpValidate'} and @$propList > 2
100 0 0 0 $propList->[0] =~ /^x:x[ma]pmeta$/ and $propList->[1] eq "rdf:RDF"
0 0 0 $propList->[0] =~ /^x:x[ma]pmeta$/ and $propList->[1] eq "rdf:RDF" and $propList->[2] =~ /rdf:Description( |$)/
108 0 0 0 $propList->[-2] eq "rdf:Alt" and $attr
110 0 0 0 $lang and @$propList >= 5
220 1325 0 0 &FixUTF8($valPtr) and not $et->{'WarnBadUTF8'}
229 8 0 9 $format eq "rational" and $$valPtr eq 'inf' || $$valPtr eq 'undef' || &Image::ExifTool::IsRational($$valPtr)
331 1836 2041 102 $tagInfo->{'Writable'} and $tagInfo->{'Writable'} eq "lang-alt"
336 99 0 3 $tagInfo->{'List'} and $tagInfo->{'List'} ne 1
343 3561 0 418 $listType and $listType ne 1
346 111 120 23 $parentID && ($tagTablePtr->{$parentID} && $tagTablePtr->{$parentID}{'NoSubStruct'} || length $parentID > 500)
3725 23 231 $strTable and not $parentID && ($tagTablePtr->{$parentID} && $tagTablePtr->{$parentID}{'NoSubStruct'} || length $parentID > 500)
381 0 0 1149 defined $val and @$propList > 2
382 1 0 1148 $propList->[0] =~ /^x:x[ma]pmeta$/ and $propList->[1] eq "rdf:RDF"
1 0 1148 $propList->[0] =~ /^x:x[ma]pmeta$/ and $propList->[1] eq "rdf:RDF" and $propList->[2] =~ /$rdfDesc( |$)/
0 0 1 $propList->[0] eq "rdf:RDF" and $propList->[1] =~ /$rdfDesc( |$)/
443 0 4 26 defined $post and length $post
0 4 0 defined $val and length $val
586 0 0 0 $dataPt and $$dataPt
781 24 74 26 not defined $dirLen and $dataPt
812 16 0 56 $success and not $et->{'XMP_ERROR'}
827 0 0 0 $success and $success eq 1
848 37 35 0 $xmpFile and $et->GetNewValue("ForceWrite")
864 0 35 0 $tagInfo and $et->{'NEW_VALUE'}{$tagInfo}
867 0 0 0 defined $newVal and length $newVal
879 110 14 0 %{$et->{'DEL_GROUP'};} and grep(/^XMP-.+$/, keys %{$$et{'DEL_GROUP'};}) || grep(m[^http://ns.exiftool.(?:ca|org)/], values %nsUsed)
892 0 63 78 $nsUsed{$ns} and @g = $nsUsed{$ns} =~ m[^http://ns.exiftool.(?:ca|org)/(.*?)/(.*?)/]
897 0 13 7 $del->{'XML-*'} and not $$del{"-$ucg"}
900 18 0 18 $$del{$g[0]} and not $$del{"-$grp"}
905 10 9 27 $del->{'XMP-*'} and not $$del{"-$ucg"}
931 4295 16 0 $writeGroup and $writeGroup ne $et->{'NEW_VALUE'}{$tagInfo}{'WriteGroup'}
970 0 2135 10036 ref $info eq "HASH" and $info->{'Struct'}
2135 7086 2950 ref $info eq "HASH" and $info->{'Struct'} and !@fixInfo || $fixInfo[0] ne $info
976 2006 1977 196 @fixInfo and $isStruct
1016 6 0 1 $ok2 and $#matchProps > $#fixProps
1023 5 2 0 $capture{$fixed} and $match ne $fixed
1040 4 0 1 $ok2 and not $match =~ /^$ok2$/
1059 53 109 7 $delLangPath and $delLangPath eq $path
1085 192 2 2 $existed and $nvHash->{'CreateOnly'}
1107 24 14 22 $langPathPat and $path =~ /^$langPathPat$/
1126 19 18 13 $oldLang eq "x-default" and not $tagInfo->{'LangCode'}
6 0 31 $tagInfo->{'LangCode'} and not $delLang
1179 82 61 0 $path =~ m[^(.*)/] and $capture{"$1/rdf:type"}
1198 0 0 7 $writable eq "lang-alt" and %langsHere
1235 3 0 8 $overwrite and $writable eq "lang-alt"
3 6 2 $overwrite and $writable eq "lang-alt" and !$tagInfo->{'LangCode'} || $tagInfo->{'LangCode'} eq 'x-default'
1268 0 1644 2385 not $cap and $isCreating
1363 13 0 3 $maxDataLen and $dataPt
13 0 3 $maxDataLen and $dataPt and defined $$dataPt
0 3 0 $maxDataLen and $dataPt and defined $$dataPt and length $$dataPt > $maxDataLen
1367 0 0 0 $dataPt and defined $$dataPt
1390 72 2 34 $maxDataLen and @pathList
1493 302 0 5 $et->{'XMP_NO_XMPMETA'} and @ns
302 1 4 $et->{'XMP_NO_XMPMETA'} and @ns and $nsCur{$ns[0]} =~ m[^http://ns.exiftool.(?:ca|org)/]
1513 0 628 134 $prop ne $rdfDesc and !($propList[$n + 1] =~ /^rdf:/) || $propList[$n + 1] eq 'rdf:type' && $n + 1 == $#propList
1537 1801 34 0 $val eq "" and $prop2 =~ /:~dummy~$/
1541 1816 0 19 defined $resFlag[$#curPropList] and not %$attrs
1816 0 19 defined $resFlag[$#curPropList] and not %$attrs and not $val =~ /
1588 0 0 0 $dirInfo->{'InPlace'} == 2 && $len > $dirLen
107 0 0 $dirInfo->{'InPlace'} and not $dirInfo->{'InPlace'} == 2 && $len > $dirLen
1613 108 0 0 $debug > 1 and $long[-2]

or 2 conditions

line l !l condition
112 0 0 $et->{'XmpValidateLangAlt'} || ($et->{'XmpValidateLangAlt'} = {})
399 622 518 $attrs || {}
594 0 0 $dirInfo->{'DirStart'} || 0
804 1 0 $et->GetNewValue($et->{'NEW_VALUE'}{$tagInfo}) || ''
813 0 16 $et->{'XMP_ERROR'} || 'Error parsing XMP'
843 14 57 $et->{'XmpAbout'} || ''
1054 2424 1885 $tagInfo->{'Writable'} || ''
1058 25 144 $tagInfo->{'LangCode'} || 'x-default'
1105 60 0 $attrs->{'xml:lang'} || 'x-default'
1138 3 0 $tagInfo->{'Writable'} || ''
1277 16 57 $tagInfo->{'LangCode'} || 'x-default'
1367 0 0 &Write($dirInfo->{'OutFile'}, $$dataPt) or return -1

or 3 conditions

line l !l&&r !l&&!r condition
100 0 0 0 $propList->[0] ne "rdf:RDF" or not $propList->[1] =~ /rdf:Description( |$)/
209 1112 3 1332 not $format or $format eq "string"
1115 214 1118 not $format or $format eq "string" or $format eq "lang-alt"
227 269 97 752 $format eq "rational" or $format eq "real"
229 0 9 0 $$valPtr eq 'inf' || $$valPtr eq 'undef' || &Image::ExifTool::IsRational($$valPtr)
349 9 8 &Image::ExifTool::IsFloat($$valPtr) or $format eq "rational" and $$valPtr eq 'inf' || $$valPtr eq 'undef' || &Image::ExifTool::IsRational($$valPtr)
254 0 43 25 not $$valPtr or $$valPtr =~ /false/i
43 0 25 not $$valPtr or $$valPtr =~ /false/i or $$valPtr =~ /^no$/i
25 0 0 $$valPtr ne "true" or not $convType
25 0 0 $$valPtr ne "true" or not $convType or $convType eq "PrintConv"
255 0 43 0 not $$valPtr or $$valPtr ne "false"
43 0 0 not $$valPtr or $$valPtr ne "false" or not $convType
43 0 0 not $$valPtr or $$valPtr ne "false" or not $convType or $convType eq "PrintConv"
290 2327 1715 0 $structPtr || $tagTablePtr
325 39 3940 0 $tagInfo->{'Namespace'} || $table->{'NAMESPACE'}
357 492 7 2327 $Image::ExifTool::XMP::specialStruct{$tag} or $strTable->{$tag}{'LangCode'}
443 26 0 4 defined $post and length $post or defined $val and length $val
511 0 10124 13786 not defined $ns or $nsUsed->{$ns}
777 35 31 58 $xmpFile || $et->{'PreferredGroup'} && $et->{'PreferredGroup'} eq 'XMP'
807 35 37 52 $xmpFile or $dirLen
818 0 0 16 $success or not $raf->Seek(0, 2)
0 0 16 $success or not $raf->Seek(0, 2) or $raf->Tell
879 12 0 2 grep(/^XMP-.+$/, keys %{$$et{'DEL_GROUP'};}) || grep(m[^http://ns.exiftool.(?:ca|org)/], values %nsUsed)
897 0 7 13 $del->{$ucg} or $del->{'XML-*'} and not $$del{"-$ucg"}
900 22 33 3 $del->{$grp} or $$del{$g[0]} and not $$del{"-$grp"}
905 17 27 19 $del->{$ucg} or $del->{'XMP-*'} and not $$del{"-$ucg"}
947 1 1 4309 $path eq "rdf:about" or $path eq "x:xmptk"
963 196 1977 2006 $isStruct or defined $tagInfo->{'Flat'}
970 2173 2113 5750 !@fixInfo || $fixInfo[0] ne $info
1019 6 9 4 $matchProps[$i] =~ / \d+$/ or $matchProps[$i] eq $fixProps[$i]
1023 0 0 7 $fixed{$fixed} or $capture{$fixed} and $match ne $fixed
1043 2 2 0 $capture{$path} || $capture{$fixed[0]}
1084 2 145 49 $deleted or $added
147 49 0 $deleted or $added or $et->IsOverwriting($nvHash)
1163 120 17 6 $writable ne "lang-alt" or $oldLang eq $newLang
1185 118 3 5 @delPaths or $tagInfo->{'List'}
3 4 1 @delPaths or $tagInfo->{'List'} or $addLang
1196 3 4 0 $tagInfo->{'List'} or $oldLang
1235 1 1 6 !$tagInfo->{'LangCode'} || $tagInfo->{'LangCode'} eq 'x-default'
1264 780 1871 1653 $nvHash->{'IsCreating'} || ($isStruct || $preferred && !$tagInfo->{'Avoid'} && !defined($nvHash->{'Shift'})) && !$nvHash->{'EditOnly'}
1268 120 155 4029 $deleted or defined $added
275 2385 1644 $deleted or defined $added or not $cap and $isCreating
1363 108 0 16 $changed or $maxDataLen and $dataPt and defined $$dataPt and length $$dataPt > $maxDataLen
1401 0 14 270 $extendedRes{$lastProp} or $extendedRes{$lastNS}
14 0 270 $extendedRes{$lastProp} or $extendedRes{$lastNS} or $propSize > $newDescThresh
1440 0 0 0 not $xmpErr or $err ne $xmpErr
1467 1 11 0 $nsUsed{$ns2} || $Image::ExifTool::XMP::nsURI{$ns2}
1513 130 4 628 !($propList[$n + 1] =~ /^rdf:/) || $propList[$n + 1] eq 'rdf:type' && $n + 1 == $#propList
1537 3 0 1835 $dummy or $val eq "" and $prop2 =~ /:~dummy~$/
1588 34 6 67 $compact{'NoPadding'} || $xmpFile || $dirInfo->{'ReadOnly'}
1608 104 0 4 %capture or $xmpFile
104 0 4 %capture or $xmpFile or $dirInfo->{'InPlace'}
0 1 3 %capture or $xmpFile or $dirInfo->{'InPlace'} or $dirInfo->{'NoDelete'}

xor 4 conditions

line l&&r l&&!r !l&&r !l&&!r condition
688 0 0 0 0 $i xor $start >= $extStart