From 38022b54852a1d5a1344f66cc45e7898b75cc7f3 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Mon, 23 Aug 2021 09:28:54 +0100 Subject: [PATCH] Add test to improve code coverage. --- test/data/coverage_xmp_doctype.exv | 9 +++++++++ .../github/test_coverage_xmp_doctype.py | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 test/data/coverage_xmp_doctype.exv create mode 100644 tests/bugfixes/github/test_coverage_xmp_doctype.py diff --git a/test/data/coverage_xmp_doctype.exv b/test/data/coverage_xmp_doctype.exv new file mode 100644 index 0000000000..c2d5347ef4 --- /dev/null +++ b/test/data/coverage_xmp_doctype.exv @@ -0,0 +1,9 @@ + + + ]> + + + + + \ No newline at end of file diff --git a/tests/bugfixes/github/test_coverage_xmp_doctype.py b/tests/bugfixes/github/test_coverage_xmp_doctype.py new file mode 100644 index 0000000000..f7c9a989e8 --- /dev/null +++ b/tests/bugfixes/github/test_coverage_xmp_doctype.py @@ -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