[pygobject] Add test for GPtrArray with transfer full
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Add test for GPtrArray with transfer full
- Date: Thu, 16 Feb 2012 15:45:11 +0000 (UTC)
commit 0739c39f6282d95fc17ee406fa1151d074b0450d
Author: Martin Pitt <martin pitt ubuntu com>
Date: Thu Feb 16 16:42:53 2012 +0100
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.
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 f4f4bf9..05fce88 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()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]