Submitter | Martin von Zweigbergk |
---|---|
Date | March 26, 2015, 5:30 p.m. |
Message ID | <48c5eec1c7caddf2c8ca.1427391058@martinvonz.mtv.corp.google.com> |
Download | mbox | patch |
Permalink | /patch/8294/ |
State | Superseded |
Headers | show |
Comments
Other than the one nitpick about non-20-byte-nodeids I made on patch 3, I'm happy with this series, FYI. On Thu, Mar 26, 2015 at 1:30 PM, Martin von Zweigbergk < martinvonz@google.com> wrote: > # HG changeset patch > # User Martin von Zweigbergk <martinvonz@google.com> > # Date 1427318494 25200 > # Wed Mar 25 14:21:34 2015 -0700 > # Node ID 48c5eec1c7caddf2c8ca84541443126dcd551f73 > # Parent 98042b0e19f9a04be3270cecb07915eac3a515cf > 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. > > diff -r 98042b0e19f9 -r 48c5eec1c7ca tests/test-manifest.py > --- a/tests/test-manifest.py Wed Mar 25 14:16:10 2015 -0500 > +++ 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 >
Patch
diff -r 98042b0e19f9 -r 48c5eec1c7ca tests/test-manifest.py --- a/tests/test-manifest.py Wed Mar 25 14:16:10 2015 -0500 +++ 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