summaryrefslogtreecommitdiff
path: root/tests/scanner/regress.c
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2018-05-09 23:36:50 -0700
committerPhilip Chimento <philip.chimento@gmail.com>2018-06-20 18:33:32 -0700
commit4fa6c29987ac23ff1e1f094a3d0ef4c4bcdacf4f (patch)
treeb72a945dd77648afbf10d8023d214ce990e75c7c /tests/scanner/regress.c
parent7043bb4b6842ba5572a4cf289a720b4044aeab5f (diff)
downloadgobject-introspection-4fa6c29987ac23ff1e1f094a3d0ef4c4bcdacf4f.tar.gz
regress: Add test for interface signal
It includes a pointer parameter; for some reason, the pointer parameter breaks g_object_info_find_signal() but a parameter-less signal doesn't. See gjs#147.
Diffstat (limited to 'tests/scanner/regress.c')
-rw-r--r--tests/scanner/regress.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index 3c186238..2cf4cddb 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -3908,6 +3908,31 @@ G_DEFINE_INTERFACE (RegressTestInterface, regress_test_interface, G_TYPE_OBJECT)
static void
regress_test_interface_default_init(RegressTestInterfaceIface *iface)
{
+ static gboolean initialized = FALSE;
+ if (initialized)
+ return;
+
+ /**
+ * RegressTestInterface::interface-signal:
+ * @self: the object which emitted the signal
+ * @ptr: (type int): the code must look up the signal with
+ * g_interface_info_find_signal() in order to get this to work.
+ */
+ g_signal_new ("interface-signal", REGRESS_TEST_TYPE_INTERFACE,
+ G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
+ G_TYPE_NONE, 1, G_TYPE_POINTER);
+
+ initialized = TRUE;
+}
+
+/**
+ * regress_test_interface_emit_signal:
+ * @self: the object to emit the signal
+ */
+void
+regress_test_interface_emit_signal (RegressTestInterface *self)
+{
+ g_signal_emit_by_name (self, "interface-signal", NULL);
}
/* gobject with non-standard prefix */