diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2012-02-16 16:42:53 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2012-02-16 16:42:53 +0100 |
commit | 0739c39f6282d95fc17ee406fa1151d074b0450d (patch) | |
tree | 7d5ab39988b9b680a26c09dda3dd7fbfde95757e | |
parent | 087a104f66793a981a0c02f1c7ab9cc1cf659da3 (diff) | |
download | pygobject-0739c39f6282d95fc17ee406fa1151d074b0450d.tar.gz |
Add test for GPtrArray with transfer full
This complements the already existing test for a "transfer container" return
array. We can't verify the internal refcount as these arrays get marshalled
internally, but at least we can verify that it does not crash due to
double-free.
-rw-r--r-- | tests/test_everything.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_everything.py b/tests/test_everything.py index f4f4bf98..05fce887 100644 --- a/tests/test_everything.py +++ b/tests/test_everything.py @@ -160,7 +160,15 @@ class TestEverything(unittest.TestCase): self.assertEqual(len(attr_list), len(set(attr_list))) def test_ptrarray(self): - self.assertEquals (Everything.test_garray_container_return(), ['regress']) + # transfer container + result = Everything.test_garray_container_return() + self.assertEquals (result, ['regress']) + result = None + + # transfer full + result = Everything.test_garray_full_return() + self.assertEquals (result, ['regress']) + result = None def test_struct_gpointer(self): l1 = GLib.List() |