diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2012-09-11 16:07:11 -0400 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2012-09-12 06:28:50 +0200 |
commit | 5959c29c7bfe046989674e9413355e79896f0e0d (patch) | |
tree | 0dfce7ec2a5522639697d20db2adb90534264c44 /tests/scanner/regress.c | |
parent | 29ef1a98018ed5e1999498310fd96106cf106f9b (diff) | |
download | gobject-introspection-5959c29c7bfe046989674e9413355e79896f0e0d.tar.gz |
regress: Add API to test signals with (u)int64 params
https://bugzilla.gnome.org/show_bug.cgi?id=683596
Co-Authored-By: Martin Pitt <martinpitt@gnome.org>
Diffstat (limited to 'tests/scanner/regress.c')
-rw-r--r-- | tests/scanner/regress.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c index e72c5aa7..2fba9fd5 100644 --- a/tests/scanner/regress.c +++ b/tests/scanner/regress.c @@ -2132,6 +2132,8 @@ enum { REGRESS_TEST_OBJ_SIGNAL_FIRST, REGRESS_TEST_OBJ_SIGNAL_CLEANUP, REGRESS_TEST_OBJ_SIGNAL_ALL, + REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_INT64_PROP, + REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_UINT64_PROP, N_REGRESS_TEST_OBJ_SIGNALS }; @@ -2298,6 +2300,46 @@ regress_test_obj_class_init (RegressTestObjClass *klass) G_TYPE_NONE, 0); + /** + * RegressTestObj::sig-with-int64-prop: + * @self: an object + * @i: an integer + * + * You can use this with regress_test_obj_emit_sig_with_int64, or raise from + * the introspection client langage. + */ + regress_test_obj_signals[REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_INT64_PROP] = + g_signal_new ("sig-with-int64-prop", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_INT64, + 1, + G_TYPE_INT64); + + /** + * RegressTestObj::sig-with-uint64-prop: + * @self: an object + * @i: an integer + * + * You can use this with regress_test_obj_emit_sig_with_uint64, or raise from + * the introspection client langage. + */ + regress_test_obj_signals[REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_UINT64_PROP] = + g_signal_new ("sig-with-uint64-prop", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_UINT64, + 1, + G_TYPE_UINT64); + gobject_class->set_property = regress_test_obj_set_property; gobject_class->get_property = regress_test_obj_get_property; gobject_class->dispose = regress_test_obj_dispose; @@ -2519,6 +2561,26 @@ regress_test_obj_emit_sig_with_foreign_struct (RegressTestObj *obj) cairo_destroy (cr); } +void +regress_test_obj_emit_sig_with_int64 (RegressTestObj *obj) +{ + gint64 ret = 0; + RegressTestObj *obj_param = regress_constructor (); + g_signal_emit_by_name (obj, "sig-with-int64-prop", G_MAXINT64, &ret); + g_object_unref (obj_param); + g_assert (ret == G_MAXINT64); +} + +void +regress_test_obj_emit_sig_with_uint64 (RegressTestObj *obj) +{ + guint64 ret = 0; + RegressTestObj *obj_param = regress_constructor (); + g_signal_emit_by_name (obj, "sig-with-uint64-prop", G_MAXUINT64, &ret); + g_object_unref (obj_param); + g_assert (ret == G_MAXUINT64); +} + int regress_test_obj_instance_method (RegressTestObj *obj) { |