summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2014-01-24 05:17:06 -0600
committerMike Gorse <mgorse@suse.com>2014-01-27 17:20:03 -0600
commite79d2acc54c1e3b052835de5de20feb0b7069476 (patch)
tree672a6149a3b45ff0f74ac80b673d55249dd6e942
parentb12ceed8cc5fa398cea2061813aac6a5ba100b6f (diff)
downloadpygobject-e79d2acc54c1e3b052835de5de20feb0b7069476.tar.gz
tests: Add test for an owned boxed struct passed in a callback
https://bugzilla.gnome.org/show_bug.cgi?id=722899
-rw-r--r--tests/test_gi.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_gi.py b/tests/test_gi.py
index 3af086d8..8bd40270 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -2266,6 +2266,17 @@ class TestPythonGObject(unittest.TestCase):
obj = self.ErrorObject()
self.assertEqual(obj.vfunc_return_value_only(), 0)
+ def test_callback_owned_box(self):
+ def callback(box, data):
+ self.box = box
+
+ def nop_callback(box, data):
+ pass
+
+ GIMarshallingTests.callback_owned_boxed(callback, None)
+ GIMarshallingTests.callback_owned_boxed(nop_callback, None)
+ self.assertEqual(self.box.long_, 1)
+
class TestMultiOutputArgs(unittest.TestCase):