summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/gsignal-connect.c88
-rw-r--r--tests/gsignal.head.c14
2 files changed, 102 insertions, 0 deletions
diff --git a/tests/gsignal-connect.c b/tests/gsignal-connect.c
index 6d34bd6..f60520a 100644
--- a/tests/gsignal-connect.c
+++ b/tests/gsignal-connect.c
@@ -196,3 +196,91 @@
g_signal_connect (settings, "changed",
(GCallback) settings_changed_const_cb, NULL);
}
+
+/*
+ * No error
+ */
+{
+ GSettings *settings = g_malloc (5); // only checking the type
+ g_signal_connect_swapped (settings, "changed",
+ (GCallback) settings_changed_swapped_cb,
+ NULL);
+}
+
+/*
+ * No error
+ */
+{
+ GSettings *settings = g_malloc (5); // only checking the type
+ gint some_thing[] = { 0, 1, 2 }; // subtype of gpointer, so valid
+ g_signal_connect_swapped (settings, "changed",
+ (GCallback) settings_changed_swapped_cb,
+ some_thing);
+}
+
+/*
+ * No error
+ */
+{
+ GSettings *settings = g_malloc (5); // only checking the type
+ gint some_thing[] = { 0, 1, 2 }; // subtype of gpointer, so valid
+ g_signal_connect_swapped (settings, "changed",
+ (GCallback) settings_changed_swapped_cb,
+ some_thing);
+}
+
+/*
+ * No error
+ */
+{
+ GSettings *settings = g_malloc (5); // only checking the type
+ gint some_thing[] = { 0, 1, 2 }; // not a GInputStream; FIXME: might be marked as invalid in future
+ g_signal_connect_swapped (settings, "changed",
+ (GCallback) settings_changed_swapped_stream_cb,
+ some_thing);
+}
+
+/*
+ * No error
+ */
+{
+ GSettings *settings = g_malloc (5); // only checking the type
+ GFilterInputStream *stream = g_malloc (5); // GInputStream subtype; valid
+ g_signal_connect_swapped (settings, "changed",
+ (GCallback) settings_changed_swapped_stream_cb,
+ stream);
+}
+
+/*
+ * No error
+ */
+{
+ GSettings *settings = g_malloc (5); // only checking the type
+ GObject *stream = g_malloc (5); // GInputStream supertype; FIXME: might be marked as invalid in future
+ g_signal_connect_swapped (settings, "changed",
+ (GCallback) settings_changed_swapped_stream_cb,
+ stream);
+}
+
+/*
+ * No error
+ */
+{
+ GSettings *settings = g_malloc (5); // only checking the type
+ gint some_thing[] = { 0, 1, 2 }; // subtype of gpointer, so valid
+ g_signal_connect_data (settings, "changed",
+ (GCallback) settings_changed_swapped_cb,
+ some_thing, NULL, G_CONNECT_SWAPPED);
+}
+
+/*
+ * No error
+ */
+{
+ GSettings *settings = g_malloc (5); // only checking the type
+ gint some_thing[] = { 0, 1, 2 }; // subtype of gpointer, so valid
+ g_signal_connect_data (settings, "changed",
+ (GCallback) settings_changed_swapped_cb,
+ some_thing, NULL,
+ G_CONNECT_SWAPPED | G_CONNECT_AFTER);
+}
diff --git a/tests/gsignal.head.c b/tests/gsignal.head.c
index e4f3026..f651e4f 100644
--- a/tests/gsignal.head.c
+++ b/tests/gsignal.head.c
@@ -90,6 +90,20 @@ settings_changed_const_cb (GSettings *settings, const gchar *key,
/* Something */
}
+static void
+settings_changed_swapped_cb (gpointer user_data, const gchar *key,
+ GSettings *settings)
+{
+ /* Something */
+}
+
+static void
+settings_changed_swapped_stream_cb (GInputStream *stream, const gchar *key,
+ GSettings *settings)
+{
+ /* Something */
+}
+
int
main (void)
{