Condition Coverage

blib/lib/Image/ExifTool/WriteXMP.pl
Criterion Covered Total %
condition 233 367 63.4


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 1294 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 1798 2008 98 $tagInfo->{'Writable'} and $tagInfo->{'Writable'} eq "lang-alt"
336 95 0 3 $tagInfo->{'List'} and $tagInfo->{'List'} ne 1
343 3491 0 413 $listType and $listType ne 1
346 110 119 23 $parentID && ($tagTablePtr->{$parentID} && $tagTablePtr->{$parentID}{'NoSubStruct'} || length $parentID > 500)
3652 23 229 $strTable and not $parentID && ($tagTablePtr->{$parentID} && $tagTablePtr->{$parentID}{'NoSubStruct'} || length $parentID > 500)
381 0 0 1148 defined $val and @$propList > 2
382 1 0 1147 $propList->[0] =~ /^x:x[ma]pmeta$/ and $propList->[1] eq "rdf:RDF"
1 0 1147 $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
572 0 0 0 $dataPt and $$dataPt
767 24 73 24 not defined $dirLen and $dataPt
798 16 0 55 $success and not $et->{'XMP_ERROR'}
813 0 0 0 $success and $success eq 1
834 36 35 0 $xmpFile and $et->GetNewValue("ForceWrite")
850 0 35 0 $tagInfo and $et->{'NEW_VALUE'}{$tagInfo}
853 0 0 0 defined $newVal and length $newVal
865 107 14 0 %{$et->{'DEL_GROUP'};} and grep(/^XMP-.+$/, keys %{$$et{'DEL_GROUP'};}) || grep(m[^http://ns.exiftool.(?:ca|org)/], values %nsUsed)
878 0 63 78 $nsUsed{$ns} and @g = $nsUsed{$ns} =~ m[^http://ns.exiftool.(?:ca|org)/(.*?)/(.*?)/]
883 0 13 7 $del->{'XML-*'} and not $$del{"-$ucg"}
886 18 0 18 $$del{$g[0]} and not $$del{"-$grp"}
891 10 9 27 $del->{'XMP-*'} and not $$del{"-$ucg"}
917 4211 16 0 $writeGroup and $writeGroup ne $et->{'NEW_VALUE'}{$tagInfo}{'WriteGroup'}
956 0 2105 9950 ref $info eq "HASH" and $info->{'Struct'}
2105 7016 2934 ref $info eq "HASH" and $info->{'Struct'} and !@fixInfo || $fixInfo[0] ne $info
962 1954 1947 194 @fixInfo and $isStruct
1002 6 0 1 $ok2 and $#matchProps > $#fixProps
1009 5 2 0 $capture{$fixed} and $match ne $fixed
1026 4 0 1 $ok2 and not $match =~ /^$ok2$/
1045 51 102 8 $delLangPath and $delLangPath eq $path
1071 190 2 2 $existed and $nvHash->{'CreateOnly'}
1093 24 14 22 $langPathPat and $path =~ /^$langPathPat$/
1112 19 18 13 $oldLang eq "x-default" and not $tagInfo->{'LangCode'}
6 0 31 $tagInfo->{'LangCode'} and not $delLang
1165 82 61 0 $path =~ m[^(.*)/] and $capture{"$1/rdf:type"}
1184 0 0 7 $writable eq "lang-alt" and %langsHere
1221 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'
1254 0 1623 2324 not $cap and $isCreating
1349 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
1353 0 0 0 $dataPt and defined $$dataPt
1376 70 2 33 $maxDataLen and @pathList
1479 0 299 5 @ns and $nsCur{$ns[0]} =~ m[^http://ns.exiftool.(?:ca|org)/]
1499 0 616 134 $prop ne $rdfDesc and !($propList[$n + 1] =~ /^rdf:/) || $propList[$n + 1] eq 'rdf:type' && $n + 1 == $#propList
1523 1783 34 0 $val eq "" and $prop2 =~ /:~dummy~$/
1527 1798 0 19 defined $resFlag[$#curPropList] and not %$attrs
1798 0 19 defined $resFlag[$#curPropList] and not %$attrs and not $val =~ /
1574 0 0 0 $dirInfo->{'InPlace'} == 2 && $len > $dirLen
104 0 0 $dirInfo->{'InPlace'} and not $dirInfo->{'InPlace'} == 2 && $len > $dirLen
1599 105 0 0 $debug > 1 and $long[-2]

or 2 conditions

line l !l condition
112 0 0 $et->{'XmpValidateLangAlt'} || ($et->{'XmpValidateLangAlt'} = {})
399 621 518 $attrs || {}
580 0 0 $dirInfo->{'DirStart'} || 0
790 1 0 $et->GetNewValue($et->{'NEW_VALUE'}{$tagInfo}) || ''
799 0 16 $et->{'XMP_ERROR'} || 'Error parsing XMP'
829 14 56 $et->{'XmpAbout'} || ''
1040 2383 1842 $tagInfo->{'Writable'} || ''
1044 25 136 $tagInfo->{'LangCode'} || 'x-default'
1091 60 0 $attrs->{'xml:lang'} || 'x-default'
1124 3 0 $tagInfo->{'Writable'} || ''
1263 16 55 $tagInfo->{'LangCode'} || 'x-default'
1353 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 1089 3 1324 not $format or $format eq "string"
1092 206 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 2296 1670 0 $structPtr || $tagTablePtr
325 38 3866 0 $tagInfo->{'Namespace'} || $table->{'NAMESPACE'}
357 488 7 2296 $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 9968 13578 not defined $ns or $nsUsed->{$ns}
763 35 33 53 $xmpFile || $et->{'PreferredGroup'} && $et->{'PreferredGroup'} eq 'XMP'
793 35 36 50 $xmpFile or $dirLen
804 0 0 16 $success or not $raf->Seek(0, 2)
0 0 16 $success or not $raf->Seek(0, 2) or $raf->Tell
865 12 0 2 grep(/^XMP-.+$/, keys %{$$et{'DEL_GROUP'};}) || grep(m[^http://ns.exiftool.(?:ca|org)/], values %nsUsed)
883 0 7 13 $del->{$ucg} or $del->{'XML-*'} and not $$del{"-$ucg"}
886 22 36 0 $del->{$grp} or $$del{$g[0]} and not $$del{"-$grp"}
891 17 37 9 $del->{$ucg} or $del->{'XMP-*'} and not $$del{"-$ucg"}
933 1 1 4225 $path eq "rdf:about" or $path eq "x:xmptk"
949 194 1947 1954 $isStruct or defined $tagInfo->{'Flat'}
956 2141 2105 5704 !@fixInfo || $fixInfo[0] ne $info
1005 6 9 4 $matchProps[$i] =~ / \d+$/ or $matchProps[$i] eq $fixProps[$i]
1009 0 0 7 $fixed{$fixed} or $capture{$fixed} and $match ne $fixed
1029 2 2 0 $capture{$path} || $capture{$fixed[0]}
1070 2 143 49 $deleted or $added
145 49 0 $deleted or $added or $et->IsOverwriting($nvHash)
1149 120 17 6 $writable ne "lang-alt" or $oldLang eq $newLang
1171 118 3 5 @delPaths or $tagInfo->{'List'}
3 4 1 @delPaths or $tagInfo->{'List'} or $addLang
1182 3 4 0 $tagInfo->{'List'} or $oldLang
1221 1 1 6 !$tagInfo->{'LangCode'} || $tagInfo->{'LangCode'} eq 'x-default'
1250 766 1822 1632 $nvHash->{'IsCreating'} || ($isStruct || $preferred && !$tagInfo->{'Avoid'} && !defined($nvHash->{'Shift'})) && !$nvHash->{'EditOnly'}
1254 120 153 3947 $deleted or defined $added
273 2324 1623 $deleted or defined $added or not $cap and $isCreating
1349 105 0 16 $changed or $maxDataLen and $dataPt and defined $$dataPt and length $$dataPt > $maxDataLen
1387 0 14 266 $extendedRes{$lastProp} or $extendedRes{$lastNS}
14 0 266 $extendedRes{$lastProp} or $extendedRes{$lastNS} or $propSize > $newDescThresh
1426 0 0 0 not $xmpErr or $err ne $xmpErr
1453 1 11 0 $nsUsed{$ns2} || $Image::ExifTool::XMP::nsURI{$ns2}
1499 130 4 616 !($propList[$n + 1] =~ /^rdf:/) || $propList[$n + 1] eq 'rdf:type' && $n + 1 == $#propList
1523 3 0 1817 $dummy or $val eq "" and $prop2 =~ /:~dummy~$/
1574 34 6 64 $compact{'NoPadding'} || $xmpFile || $dirInfo->{'ReadOnly'}
1594 101 0 4 %capture or $xmpFile
101 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
674 0 0 0 0 $i xor $start >= $extStart