diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-08-24 19:47:36 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-08-24 19:47:36 +0200 |
commit | 986c01a1dffaf1e5f1e38620fc0e0556b74d2da0 (patch) | |
tree | 08ba59fab94d3878a0c620905ebb84e5c2dc9777 /test | |
parent | 2a010332df401e2f09dcd51f73ff0b3aa89bdf64 (diff) | |
download | pyexiv2-986c01a1dffaf1e5f1e38620fc0e0556b74d2da0.tar.gz |
Sanity check when setting the parent image of a tag:
if it’s already the same parent, don’t do anything.
Diffstat (limited to 'test')
-rw-r--r-- | test/metadata.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/metadata.py b/test/metadata.py index 1b098b1..7816277 100644 --- a/test/metadata.py +++ b/test/metadata.py @@ -530,6 +530,17 @@ class TestImageMetadata(unittest.TestCase): for key in keys: self.failUnlessRaises(KeyError, self.metadata.__delitem__, key) + def test_replace_tag_by_itself(self): + # Test that replacing an existing tag by itself + # doesn’t result in an ugly segmentation fault + # (see https://bugs.launchpad.net/pyexiv2/+bug/622739). + self.metadata.read() + keys = self.metadata.exif_keys + \ + self.metadata.iptc_keys + \ + self.metadata.xmp_keys + for key in keys: + self.metadata[key] = self.metadata[key] + ########################## # Test the image comment # ########################## |