summaryrefslogtreecommitdiff
path: root/tests/testhelpermodule.c
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-09-11 09:43:14 +0200
committerMartin Pitt <martinpitt@gnome.org>2012-09-11 09:43:14 +0200
commit4559247553b792db956f69c9674c12344d719c82 (patch)
tree95b64da48744eaca4989c57a2c27f645170ef802 /tests/testhelpermodule.c
parentfddb01b0b71b68d154d130cf40fd5f38647b1a4d (diff)
downloadpygobject-4559247553b792db956f69c9674c12344d719c82.tar.gz
Add test cases for GValue signal arguments
These cover various types, (u)int(64) and string. Keep the test case for implicit int64 GValues disabled, as this currently does not work and it is not clear whether it should: https://bugzilla.gnome.org/show_bug.cgi?id=683775
Diffstat (limited to 'tests/testhelpermodule.c')
-rw-r--r--tests/testhelpermodule.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c
index fa957525..608b8b12 100644
--- a/tests/testhelpermodule.c
+++ b/tests/testhelpermodule.c
@@ -358,6 +358,19 @@ test_paramspec_callback (GObject *object)
}
static GValue *
+test_gvalue_callback (GObject *object, const GValue *v)
+{
+ GValue *ret = g_malloc0 (sizeof (GValue));
+
+ g_return_val_if_fail (G_IS_OBJECT (object), NULL);
+ g_return_val_if_fail (G_IS_VALUE (v), NULL);
+
+ g_value_init (ret, G_VALUE_TYPE (v));
+ g_value_copy (v, ret);
+ return ret;
+}
+
+static GValue *
test_gvalue_ret_callback (GObject *object, GType type)
{
GValue *ret = g_malloc0 (sizeof (GValue));
@@ -440,6 +453,10 @@ connectcallbacks (GObject *object)
G_CALLBACK (test_paramspec_callback),
NULL);
g_signal_connect (G_OBJECT (object),
+ "test_gvalue",
+ G_CALLBACK (test_gvalue_callback),
+ NULL);
+ g_signal_connect (G_OBJECT (object),
"test_gvalue_ret",
G_CALLBACK (test_gvalue_ret_callback),
NULL);