diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2016-02-06 20:31:27 -0800 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2016-02-08 22:21:27 -0800 |
commit | cd355e86a28bfed7744ac567f06ab18a12d1ad1d (patch) | |
tree | f7a5e2d6e30f111325c5412a8f95c5794a5ea642 /tests/scanner/regress.c | |
parent | cbd238445f23eff22e61d2f973c45339f089a4d8 (diff) | |
download | gobject-introspection-cd355e86a28bfed7744ac567f06ab18a12d1ad1d.tar.gz |
tests: Add regression test for signal w. array+len
This is a regression test for marshalling callback arguments from signals
with an array parameter and separate length parameter into closures in
the introspected language.
https://bugzilla.gnome.org/show_bug.cgi?id=761659
Diffstat (limited to 'tests/scanner/regress.c')
-rw-r--r-- | tests/scanner/regress.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c index 6eac6f7b..c317682a 100644 --- a/tests/scanner/regress.c +++ b/tests/scanner/regress.c @@ -2329,7 +2329,9 @@ regress_test_obj_class_init (RegressTestObjClass *klass) * @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 + * This test signal similar to GSettings::change-event. + * You can use this with regress_test_obj_emit_sig_with_array_len_prop(), or + * raise from the introspection client language. */ regress_test_obj_signals[REGRESS_TEST_OBJ_SIGNAL_SIG_NEW_WITH_ARRAY_LEN_PROP] = g_signal_new ("sig-with-array-len-prop", @@ -2756,6 +2758,16 @@ regress_test_obj_emit_sig_with_uint64 (RegressTestObj *obj) g_assert (ret == G_MAXUINT64); } +/** + * regress_test_obj_emit_sig_with_array_len_prop: + */ +void +regress_test_obj_emit_sig_with_array_len_prop (RegressTestObj *obj) +{ + int arr[] = { 0, 1, 2, 3, 4 }; + g_signal_emit_by_name (obj, "sig-with-array-len-prop", &arr, 5); +} + int regress_test_obj_instance_method (RegressTestObj *obj) { |