comparison tests/test-manifest.py @ 24465:bb8e2b1a0803

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.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 25 Mar 2015 14:21:34 -0700
parents 49cd847fd69a
children f310ca66a704
comparison
equal deleted inserted replaced
24464:30ddc3cf76df 24465:bb8e2b1a0803
67 m = manifestmod._lazymanifest(A_SHORT_MANIFEST) 67 m = manifestmod._lazymanifest(A_SHORT_MANIFEST)
68 m['a'] = want 68 m['a'] = want
69 self.assertEqual(want, m['a']) 69 self.assertEqual(want, m['a'])
70 self.assertEqual('a\0' + HASH_1 + '\n' + A_SHORT_MANIFEST, 70 self.assertEqual('a\0' + HASH_1 + '\n' + A_SHORT_MANIFEST,
71 m.text()) 71 m.text())
72
73 def testCopy(self):
74 m = manifestmod._lazymanifest(A_SHORT_MANIFEST)
75 m['a'] = binascii.unhexlify(HASH_1), ''
72 m2 = m.copy() 76 m2 = m.copy()
73 del m 77 del m
74 del m2 # make sure we don't double free() anything 78 del m2 # make sure we don't double free() anything
75 79
76 def testCompaction(self): 80 def testCompaction(self):