Add test to improve code coverage.

This commit is contained in:
Kevin Backhouse
2021-08-23 09:28:54 +01:00
parent b35cc5ffa6
commit 5703dbc6a4
2 changed files with 29 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<!DOCTYPE foo [
<!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM "file:///dev/random" >]>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
<foo>
</foo>
</x:xmpmeta>
<?xpacket end="w"?>
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors
class coverage_xmp_doctype(metaclass=CaseMeta):
"""
Test added to improve code coverage in xmpsidecar.cpp after
Codecov complained about a lack of code coverage in this PR:
https://github.com/Exiv2/exiv2/pull/1878
"""
filename = path("$data_path/coverage_xmp_doctype.exv")
commands = ["$exiv2 $filename"]
stderr = ["""Error: XMP Toolkit error 201: Error in XMLValidator
Warning: Failed to decode XMP metadata.
$filename: No Exif data found in the file
"""]
retval = [253]
compare_stdout = check_no_ASAN_UBSAN_errors