From 19bb57ff251a83f30e36f2b158652fcb831eeb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Fri, 31 Aug 2018 00:33:37 +0200 Subject: [PATCH] Add reproducer for #262 to the test suite --- test/data/7-printIFD-divbyzero-1 | Bin 0 -> 24 bytes tests/bugfixes/github/test_issue_262.py | 25 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/data/7-printIFD-divbyzero-1 create mode 100644 tests/bugfixes/github/test_issue_262.py diff --git a/test/data/7-printIFD-divbyzero-1 b/test/data/7-printIFD-divbyzero-1 new file mode 100644 index 0000000000000000000000000000000000000000..3a095024df6a14fd21814c3766ab17f5005a1f91 GIT binary patch literal 24 ScmebD)MnsdU;twv1*ZWLkpR{J literal 0 HcmV?d00001 diff --git a/tests/bugfixes/github/test_issue_262.py b/tests/bugfixes/github/test_issue_262.py new file mode 100644 index 00000000..eadfd91c --- /dev/null +++ b/tests/bugfixes/github/test_issue_262.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +import system_tests + + +class DivByZeroInPrintIFD(metaclass=system_tests.CaseMeta): + + url = "https://github.com/Exiv2/exiv2/issues/262" + + filename = system_tests.path( + "$data_path/7-printIFD-divbyzero-1" + ) + commands = ["$exiv2 -pX $filename"] + stdout = [ + """STRUCTURE OF BIGTIFF FILE $filename + address | tag | type | count | offset | value + 10 | 0x0008 FlashSetting | unknown | 0 | | +""" + ] + stderr = [ + """$exiv2_exception_message $filename: +$kerCorruptedMetadata +""" + ] + retval = [1]