test-manifest.py: separate out test for double-free after copy()
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 25 Mar 2015 14:21:34 -0700
changeset 24465 bb8e2b1a0803
parent 24464 30ddc3cf76df
child 24466 f310ca66a704
test-manifest.py: separate out test for double-free after copy() The test that we don't double-free anything after creating a copy is currently mixed with the __setitem__ test. Let's separate them.
tests/test-manifest.py
--- a/tests/test-manifest.py	Wed Mar 25 22:20:44 2015 -0400
+++ b/tests/test-manifest.py	Wed Mar 25 14:21:34 2015 -0700
@@ -69,6 +69,10 @@
         self.assertEqual(want, m['a'])
         self.assertEqual('a\0' + HASH_1 + '\n' + A_SHORT_MANIFEST,
                          m.text())
+
+    def testCopy(self):
+        m = manifestmod._lazymanifest(A_SHORT_MANIFEST)
+        m['a'] =  binascii.unhexlify(HASH_1), ''
         m2 = m.copy()
         del m
         del m2 # make sure we don't double free() anything