From 2af5386d6cc1deba21f03c398c6368a9de6ed4ba Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 27 Feb 2013 12:14:16 +0100 Subject: Add test case for signal with a C array and length argument By-product of https://bugzilla.gnome.org/show_bug.cgi?id=662241. --- .../Regress.TestObj-sig-with-array-len-prop.page | 44 +++++++++++++++++++ .../Regress.TestObj-sig-with-array-len-prop.page | 39 +++++++++++++++++ .../Regress.TestObj-sig-with-array-len-prop.page | 49 ++++++++++++++++++++++ tests/scanner/Regress-1.0-expected.gir | 18 ++++++++ tests/scanner/regress.c | 22 ++++++++++ 5 files changed, 172 insertions(+) create mode 100644 tests/scanner/Regress-1.0-C-expected/Regress.TestObj-sig-with-array-len-prop.page create mode 100644 tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-sig-with-array-len-prop.page create mode 100644 tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-sig-with-array-len-prop.page (limited to 'tests/scanner') diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.TestObj-sig-with-array-len-prop.page b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj-sig-with-array-len-prop.page new file mode 100644 index 00000000..9ec983b1 --- /dev/null +++ b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj-sig-with-array-len-prop.page @@ -0,0 +1,44 @@ + + + + + + sig-with-array-len-prop + + + Regress.TestObj::sig-with-array-len-prop + + +void sig-with-array-len-prop (guint* arr, + gint len); + + + +

This test signal similar to GSettings::change-event

+ + + + + + +<code>arr</code> +

numbers, or NULL

+
+ +<code>len</code> +

length of arr, or 0

+
+ +<code>Returns</code> + + +
+ + + +
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-sig-with-array-len-prop.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-sig-with-array-len-prop.page new file mode 100644 index 00000000..c359b137 --- /dev/null +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-sig-with-array-len-prop.page @@ -0,0 +1,39 @@ + + + + + + sig-with-array-len-prop + + + Regress.TestObj::sig-with-array-len-prop + + +function callback(test_obj, arr:[Number], ):void; + + + +

This test signal similar to GSettings::change-event

+ + + + + + +<code>test_obj</code> +

instance of that is emitting the signal

+
+ +<code>arr</code> +

numbers, or null

+
+
+ + + +
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-sig-with-array-len-prop.page b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-sig-with-array-len-prop.page new file mode 100644 index 00000000..a228de1f --- /dev/null +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-sig-with-array-len-prop.page @@ -0,0 +1,49 @@ + + + + + + sig-with-array-len-prop + + + Regress.TestObj::sig-with-array-len-prop + + +def callback(test_obj, arr, len, user_param1, ...) + + + +

This test signal similar to GSettings::change-event

+ + + + + + +<code>test_obj</code> +

instance of that is emitting the signal

+
+ +<code>arr</code> +

numbers, or None

+
+ +<code>len</code> +

length of arr, or 0

+
+<code>user_param1</code> +

first user parameter (if any) specified with the connect() method

+ +<code>...</code> +

additional user parameters (if any)

+
+
+ + + +
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir index 35c7c694..53773cae 100644 --- a/tests/scanner/Regress-1.0-expected.gir +++ b/tests/scanner/Regress-1.0-expected.gir @@ -3331,6 +3331,24 @@ raise an error. + + This test signal similar to GSettings::change-event + + + + + + numbers, or %NULL + + + + + + length of @arr, or 0 + + + + This test signal is like TelepathyGlib's TpChannel:: group-members-changed-detailed: diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c index b5fc8585..f54c2f91 100644 --- a/tests/scanner/regress.c +++ b/tests/scanner/regress.c @@ -2173,6 +2173,7 @@ regress_test_obj_default_matrix (RegressTestObj *obj, const char *somestr) enum { REGRESS_TEST_OBJ_SIGNAL_SIG_NEW_WITH_ARRAY_PROP, + REGRESS_TEST_OBJ_SIGNAL_SIG_NEW_WITH_ARRAY_LEN_PROP, REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_HASH_PROP, REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_STRV, REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_OBJ, @@ -2240,6 +2241,27 @@ regress_test_obj_class_init (RegressTestObjClass *klass) 1, G_TYPE_ARRAY); + /** + * RegressTestObj::sig-with-array-len-prop: + * @self: an object + * @arr: (array length=len) (element-type uint) (allow-none): numbers, or %NULL + * @len: length of @arr, or 0 + * + * This test signal similar to GSettings::change-event + */ + regress_test_obj_signals[REGRESS_TEST_OBJ_SIGNAL_SIG_NEW_WITH_ARRAY_LEN_PROP] = + g_signal_new ("sig-with-array-len-prop", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 2, + G_TYPE_POINTER, + G_TYPE_INT); + /** * RegressTestObj::sig-with-hash-prop: * @self: an object -- cgit v1.2.1