From 827f31ad8dc856b14decfd1d77253f7c3d94943a Mon Sep 17 00:00:00 2001 From: postscript-dev Date: Thu, 23 Sep 2021 11:43:56 +0100 Subject: [PATCH] Add test for SonyMisc(2b|3c) Groups in TIFF files --- tests/bugfixes/github/test_pr_1792.py | 18 ++++++++++++------ tests/bugfixes/github/test_pr_1800.py | 21 +++++++++++++++++---- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/tests/bugfixes/github/test_pr_1792.py b/tests/bugfixes/github/test_pr_1792.py index b2643faf..def5d8f9 100644 --- a/tests/bugfixes/github/test_pr_1792.py +++ b/tests/bugfixes/github/test_pr_1792.py @@ -4,17 +4,24 @@ from system_tests import CaseMeta, path class SonyMisc2bTestSupported(metaclass=CaseMeta): - filename = path("$data_path/test_issue_1464.exv") - commands = ["$exiv2 -pa --grep SonyMisc2b $filename"] +# Check that JPEG and TIFF based formats work + filenames = [path("$data_path/test_issue_1464.exv"), # JPEG + path("$data_path/exiv2-bug1153Aa.exv")] # TIFF + commands = ["$exiv2 -pa --grep SonyMisc2b {!s}".format(fname) for fname in filenames] stdout = ["""Exif.SonyMisc2b.ExposureProgram Byte 1 Shutter speed priority AE Exif.SonyMisc2b.IntelligentAuto Byte 1 Off Exif.SonyMisc2b.LensZoomPosition Short 1 100% Exif.SonyMisc2b.FocusPosition2 Byte 1 0 +""", +"""Exif.SonyMisc2b.ExposureProgram Byte 1 Aperture-priority AE +Exif.SonyMisc2b.IntelligentAuto Byte 1 Off +Exif.SonyMisc2b.LensZoomPosition Short 1 0% +Exif.SonyMisc2b.FocusPosition2 Byte 1 0 """ ] - stderr = [""] - retval = [0] + stderr = [""] *2 + retval = [0] *2 # An example of a Sony camera model that does NOT support SonyMisc2b class SonyMisc2bTestUnsupported(metaclass=CaseMeta): @@ -22,7 +29,6 @@ class SonyMisc2bTestUnsupported(metaclass=CaseMeta): filename = path("$data_path/exiv2-pr906.exv") commands = ["$exiv2 -pa --grep SonyMisc2b $filename"] - stdout = ["""""" - ] + stdout = [""] stderr = [""] retval = [1] diff --git a/tests/bugfixes/github/test_pr_1800.py b/tests/bugfixes/github/test_pr_1800.py index 7c46bc46..70bf7f20 100644 --- a/tests/bugfixes/github/test_pr_1800.py +++ b/tests/bugfixes/github/test_pr_1800.py @@ -5,8 +5,10 @@ from system_tests import CaseMeta, path #Full support for SonyMisc3c tags using this model class SonyMisc3cSupportedTest(metaclass=CaseMeta): - filename = path("$data_path/exiv2-SonyDSC-HX60V.exv") - commands = ["$exiv2 -pa --grep SonyMisc3c $filename"] +# Check that JPEG and TIFF based formats work + filenames = [path("$data_path/exiv2-SonyDSC-HX60V.exv"), # JPEG + path("$data_path/exiv2-bug1153Aa.exv")] # TIFF + commands = ["$exiv2 -pa --grep SonyMisc3c {!s}".format(fname) for fname in filenames] stdout = ["""Exif.SonyMisc3c.ReleaseMode2 Byte 1 Normal Exif.SonyMisc3c.ShotNumberSincePowerUp Long 1 4 @@ -18,10 +20,21 @@ Exif.SonyMisc3c.CameraOrientation Byte 1 Horizontal (normal) Exif.SonyMisc3c.Quality2 Byte 1 JPEG Exif.SonyMisc3c.SonyImageHeight Short 1 3888 Exif.SonyMisc3c.ModelReleaseYear Byte 1 2014 +""", +"""Exif.SonyMisc3c.ReleaseMode2 Byte 1 Normal +Exif.SonyMisc3c.ShotNumberSincePowerUp Long 1 2 +Exif.SonyMisc3c.SequenceImageNumber Long 1 1 +Exif.SonyMisc3c.SequenceLength1 Byte 1 1 shot +Exif.SonyMisc3c.SequenceFileNumber Long 1 1 +Exif.SonyMisc3c.SequenceLength2 Byte 1 1 file +Exif.SonyMisc3c.CameraOrientation Byte 1 Horizontal (normal) +Exif.SonyMisc3c.Quality2 Byte 1 Raw + JPEG +Exif.SonyMisc3c.SonyImageHeight Short 1 4000 +Exif.SonyMisc3c.ModelReleaseYear Byte 1 2014 """ ] - stderr = [""] - retval = [0] + stderr = [""] *2 + retval = [0] *2 #Partial support for SonyMisc3c tags using this model class SonyMisc3cPartiallySupportedTest(metaclass=CaseMeta):