Added some example test cases to the new test suite

v0.27.3
Dan Čermák 8 years ago
parent 2e745b0b26
commit 085c9715fc

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
import system_tests
class CVE_2017_14680(system_tests.Case):
bug_no = "73"
url = "https://github.com/Exiv2/exiv2/issues/73"
filename = "{data_path}/003-heap-buffer-over"
commands = ["{exiv2} " + filename]
stdout = [""]
stderr = ["""{exiv2_exception_msg} """ + filename + """:
{error_58_message}
"""]
retval = [1]

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
import system_tests
class CVE_2017_14857(system_tests.Case):
filename = "{data_path}/010_bad_free"
commands = ["{exiv2} " + filename]
retval = [1]
stdout = [""]
stderr = [
"""{exiv2_exception_msg} """ + filename + """:
{error_57_message}
"""]

@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
import system_tests
class TamronSupport(system_tests.Case):
description = "Added support for 'Tamron SP 15-30mm f/2.8 Di VC USD A012' and 'Tamron SP 90mm f/2.8 Di VC USD MACRO1:1'"
files = [
"exiv2-g20.exv",
"CanonEF100mmF2.8LMacroISUSM.exv",
"TamronSP15-30mmF2.8DiVCUSDA012.exv",
"TamronSP90mmF2.8DiVCUSDMacroF004.exv",
"TamronSP90mmF2.8DiVCUSDMacroF017.exv"
]
commands = ["{exiv2} -pa --grep lens/i ../../../test/data/" + files[0]] \
+ list(map(
lambda fname: "{exiv2} -pa --grep lenstype/i ../../../test/data/" + fname,
files[1:]
))
retval = [0] * len(files)
stdout = [
# exiv2-g20.exv
"""Exif.CanonCs.LensType Short 1 Tamron SP 90mm f/2.8 Di VC USD Macro 1:1
Exif.CanonCs.Lens Short 3 90.0 mm
Exif.Canon.LensModel Ascii 70 TAMRON SP 90mm F/2.8 Di VC USD MACRO1:1 F017
Exif.Photo.LensSpecification Rational 4 90/1 90/1 0/0 0/0
Exif.Photo.LensModel Ascii 70 TAMRON SP 90mm F/2.8 Di VC USD MACRO1:1 F017
Exif.Photo.LensSerialNumber Ascii 12 0000000000
""",
# CanonEF100mmF2.8LMacroISUSM.exv
"""Exif.CanonCs.LensType Short 1 Canon EF 100mm f/2.8L Macro IS USM
""",
# TamronSP15-30mmF2.8DiVCUSDA012.exv"
"""Exif.CanonCs.LensType Short 1 Tamron SP 15-30mm f/2.8 Di VC USD A012
""",
# TamronSP90mmF2.8DiVCUSDMacroF004.exv
"""Exif.CanonCs.LensType Short 1 Tamron SP 90mm f/2.8 Di VC USD Macro 1:1
""",
# TamronSP90mmF2.8DiVCUSDMacroF017.exv
"""Exif.CanonCs.LensType Short 1 Tamron SP 90mm f/2.8 Di VC USD Macro 1:1
"""
""]
stderr = [""] * len(files)

@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
import system_tests
class Issue1305Test(system_tests.Case):
err_msg_dir_img = """Warning: Directory Image, entry 0x3030 has unknown Exif (TIFF) type 12336; setting type size 1.
Error: Directory Image, entry 0x3030 has invalid size 808464432*1; skipping entry.
"""
err_msg_dir_ph = """Warning: Directory Photo, entry 0x3030 has unknown Exif (TIFF) type 12336; setting type size 1.
Error: Directory Photo, entry 0x3030 has invalid size 808464432*1; skipping entry.
"""
err_msg_dir_pentax = """Warning: Directory Pentax, entry 0x3030 has unknown Exif (TIFF) type 12336; setting type size 1.
Error: Directory Pentax, entry 0x3030 has invalid size 808464432*1; skipping entry.
"""
name = "regression test for issue 1305"
url = "http://dev.exiv2.org/issues/1305"
filename = "{data_path}/IMGP0006-min.jpg"
commands = ["{exiv2} " + filename]
stdout = ["""File name : """ + filename + """
File size : 12341 Bytes
MIME type : image/jpeg
Image size : 0 x 0
Camera make : PENTAX000000000000000000000000000000000000000000
Camera model :
Image timestamp :
Image number :
Exposure time :
Aperture :
Exposure bias :
Flash :
Flash bias :
Focal length :
Subject distance:
ISO speed :
Exposure mode :
Metering mode :
Macro mode :
Image quality :
Exif Resolution :
White balance :
Thumbnail : None
Copyright :
Exif comment :
"""]
stderr = [
"""Error: Directory Image: Next pointer is out of bounds; ignored.
"""
+ 8 * err_msg_dir_img
+ """Warning: Directory Photo has an unexpected next pointer; ignored.
"""
+ 13 * err_msg_dir_ph
+ """Warning: Directory Photo, entry 0x927c has unknown Exif (TIFF) type 12336; setting type size 1.
Warning: Directory Pentax has an unexpected next pointer; ignored.
"""
+ 6 * err_msg_dir_pentax
+ """Warning: Directory Pentax, entry 0x0006 has unknown Exif (TIFF) type 12336; setting type size 1.
Warning: Directory Pentax, entry 0x0007 has unknown Exif (TIFF) type 12336; setting type size 1.
"""
+ 39 * err_msg_dir_pentax
+ 23 * err_msg_dir_ph
+ """Warning: Directory Photo, entry 0x3030 has unknown Exif (TIFF) type 48; setting type size 1.
Error: Directory Photo, entry 0x3030 has invalid size 808464432*1; skipping entry.
"""
+ 5 * err_msg_dir_ph
+ """Warning: Directory Photo, entry 0x3030 has unknown Exif (TIFF) type 12336; setting type size 1.
Error: Directory Photo, entry 0x3030 has invalid size 808452102*1; skipping entry.
Warning: Directory Photo, entry 0x3030 has unknown Exif (TIFF) type 12336; setting type size 1.
Error: Directory Photo, entry 0x3030 has invalid size 808452103*1; skipping entry.
"""
+ 3 * err_msg_dir_ph
+ err_msg_dir_img
+ """Warning: Directory Image, entry 0x3030 has unknown Exif (TIFF) type 12336; setting type size 1.
Error: Directory Image, entry 0x3030 has invalid size 1414415696*1; skipping entry.
"""
+ 36 * err_msg_dir_img
+ """Warning: JPEG format error, rc = 5
"""]
retval = [0]
Loading…
Cancel
Save