Commit 5cd18c9b authored by Mathieu Duponchelle's avatar Mathieu Duponchelle Committed by Martin Pitt
Browse files

Implement marshalling for GParamSpec

https://bugzilla.gnome.org/show_bug.cgi?id=681565

Co-Authored-By: default avatarMartin Pitt <martinpitt@gnome.org>
parent 16462de3
......@@ -879,10 +879,18 @@ _pygi_marshal_to_py_interface_object (PyGIInvokeState *state,
return py_obj;
}
py_obj = pygobject_new (arg->v_pointer);
if (arg_cache->transfer == GI_TRANSFER_EVERYTHING)
g_object_unref (arg->v_pointer);
if (G_IS_PARAM_SPEC(arg->v_pointer))
{
py_obj = pyg_param_spec_new (arg->v_pointer);
if (arg_cache->transfer == GI_TRANSFER_EVERYTHING)
g_param_spec_unref (arg->v_pointer);
}
else
{
py_obj = pygobject_new (arg->v_pointer);
if (arg_cache->transfer == GI_TRANSFER_EVERYTHING)
g_object_unref (arg->v_pointer);
}
return py_obj;
}
......
......@@ -2067,6 +2067,20 @@ class TestGErrorReturn(unittest.TestCase):
self.assertEqual(error.message, GIMarshallingTests.CONSTANT_GERROR_MESSAGE)
class TestParamSpec(unittest.TestCase):
def test_param_spec_return(self):
obj = GIMarshallingTests.param_spec_return()
self.assertEqual(obj.name, 'test-param')
self.assertEqual(obj.nick, 'test')
self.assertEqual(obj.value_type, GObject.TYPE_STRING)
def test_param_spec_out(self):
obj = GIMarshallingTests.param_spec_out()
self.assertEqual(obj.name, 'test-param')
self.assertEqual(obj.nick, 'test')
self.assertEqual(obj.value_type, GObject.TYPE_STRING)
class TestKeywordArgs(unittest.TestCase):
def test_calling(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment