diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2007-07-07 12:09:52 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2007-07-07 12:09:52 +0000 |
commit | fe3966c22cbf5e198164b088b4f46f280bc33126 (patch) | |
tree | 28011f1aa7ac20608923459f40edec802d11318a /tests/testhelpermodule.c | |
parent | 73b8042c42ede774597b5bc235a70f8f13643b91 (diff) | |
download | pygobject-fe3966c22cbf5e198164b088b4f46f280bc33126.tar.gz pygobject-fe3966c22cbf5e198164b088b4f46f280bc33126.tar.xz pygobject-fe3966c22cbf5e198164b088b4f46f280bc33126.zip |
Bug 351072 – Cannot handle signals with parameter type G_TYPE_VALUE (marshal/unmarshal for GValue-wrapped GValue)
svn path=/trunk/; revision=680
Diffstat (limited to 'tests/testhelpermodule.c')
-rw-r--r-- | tests/testhelpermodule.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c index 8d9419e..d78cf55 100644 --- a/tests/testhelpermodule.c +++ b/tests/testhelpermodule.c @@ -451,6 +451,24 @@ _wrap_connectcallbacks(PyObject * self, PyObject *args) } static PyObject * +_wrap_test_value(PyObject *self, PyObject *args) +{ + GValue tvalue = {0,}, *value = &tvalue; + PyObject *obj; + + if (!PyArg_ParseTuple(args, "O", &obj)) + return NULL; + + g_value_init(value, G_TYPE_VALUE); + if (pyg_value_from_pyobject(value, obj)) { + PyErr_SetString(PyExc_TypeError, "Could not convert to GValue"); + return NULL; + } + + return pyg_value_as_pyobject(value, FALSE); +} + +static PyObject * _wrap_test_value_array(PyObject *self, PyObject *args) { GValue tvalue = {0,}, *value = &tvalue; @@ -500,6 +518,7 @@ static PyMethodDef testhelper_functions[] = { { "create_test_type", (PyCFunction)_wrap_create_test_type, METH_NOARGS }, { "test_g_object_new", (PyCFunction)_wrap_test_g_object_new, METH_NOARGS }, { "connectcallbacks", (PyCFunction)_wrap_connectcallbacks, METH_VARARGS }, + { "test_value", (PyCFunction)_wrap_test_value, METH_VARARGS }, { "test_value_array", (PyCFunction)_wrap_test_value_array, METH_VARARGS }, { "test_gerror_exception", (PyCFunction)_wrap_test_gerror_exception, METH_VARARGS }, { NULL, NULL } |