From 99db7d7fb3dbb9f4da416a21282aadf351eb3471 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Thu, 1 Aug 2019 13:37:47 -0700 Subject: regress: Add regression test for signal with GError param This exercises the little-used code path where a signal is emitted with a nullable GError as a parameter. It's modeled after GstPbutils.Discoverer's 'discovered' signal. See GNOME/gjs#262. --- .../Regress.TestObj-sig-with-gerror.page | 34 ++ .../Regress.TestObj.emit_sig_with_error.page | 38 ++ .../Regress.TestObj.emit_sig_with_null_error.page | 38 ++ .../Regress.TestObj-sig-with-gerror.page | 34 ++ .../Regress.TestObj.emit_sig_with_error.page | 26 + .../Regress.TestObj.emit_sig_with_null_error.page | 26 + .../Regress.TestObj-sig-with-gerror.page | 40 ++ .../Regress.TestObj.emit_sig_with_error.page | 37 ++ .../Regress.TestObj.emit_sig_with_null_error.page | 37 ++ tests/scanner/Regress-1.0-expected.gir | 622 +++++++++++---------- tests/scanner/Regress-1.0-sections-expected.txt | 2 + tests/scanner/regress.c | 44 ++ tests/scanner/regress.h | 6 + 13 files changed, 701 insertions(+), 283 deletions(-) create mode 100644 tests/scanner/Regress-1.0-C-expected/Regress.TestObj-sig-with-gerror.page create mode 100644 tests/scanner/Regress-1.0-C-expected/Regress.TestObj.emit_sig_with_error.page create mode 100644 tests/scanner/Regress-1.0-C-expected/Regress.TestObj.emit_sig_with_null_error.page create mode 100644 tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-sig-with-gerror.page create mode 100644 tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.emit_sig_with_error.page create mode 100644 tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.emit_sig_with_null_error.page create mode 100644 tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-sig-with-gerror.page create mode 100644 tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.emit_sig_with_error.page create mode 100644 tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.emit_sig_with_null_error.page (limited to 'tests') diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.TestObj-sig-with-gerror.page b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj-sig-with-gerror.page new file mode 100644 index 00000000..b511ced1 --- /dev/null +++ b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj-sig-with-gerror.page @@ -0,0 +1,34 @@ + + + + + sig-with-gerror + + Regress.TestObj::sig-with-gerror + +void sig-with-gerror (GError error); + +

This signal is modeled after #GstDiscoverer::discovered, and is added to +exercise the path of a GLib.Error being marshalled as a boxed type instead of +an exception in the introspected language.

Use via and +, or emit via the introspected +language.

+ + + +<code>error</code> +

A GLib.Error if something went wrong + internally in @self. You must not free this GLib.Error.

+
+ +<code>Returns</code> + + +
+ +
diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.TestObj.emit_sig_with_error.page b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj.emit_sig_with_error.page new file mode 100644 index 00000000..a2acb8ca --- /dev/null +++ b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj.emit_sig_with_error.page @@ -0,0 +1,38 @@ + + + + + + + void + + regress_test_obj_emit_sig_with_error + + RegressTestObj* + self + + + + regress_test_obj_emit_sig_with_error + +void regress_test_obj_emit_sig_with_error (RegressTestObj* self); + + + + + +<code>self</code> +

The object to emit the signal.

+
+ +<code>Returns</code> + + +
+ +
diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.TestObj.emit_sig_with_null_error.page b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj.emit_sig_with_null_error.page new file mode 100644 index 00000000..11e38be4 --- /dev/null +++ b/tests/scanner/Regress-1.0-C-expected/Regress.TestObj.emit_sig_with_null_error.page @@ -0,0 +1,38 @@ + + + + + + + void + + regress_test_obj_emit_sig_with_null_error + + RegressTestObj* + self + + + + regress_test_obj_emit_sig_with_null_error + +void regress_test_obj_emit_sig_with_null_error (RegressTestObj* self); + + + + + +<code>self</code> +

The object to emit the signal.

+
+ +<code>Returns</code> + + +
+ +
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-sig-with-gerror.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-sig-with-gerror.page new file mode 100644 index 00000000..5a2c10f1 --- /dev/null +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj-sig-with-gerror.page @@ -0,0 +1,34 @@ + + + + + sig-with-gerror + + Regress.TestObj::sig-with-gerror + +connect('sig-with-gerror', function (testObj, error: GLib.Error, ): void); + +

This signal is modeled after #GstDiscoverer::discovered, and is added to +exercise the path of a GLib.Error being marshalled as a boxed type instead of +an exception in the introspected language.

Use via and +, or emit via the introspected +language.

+ + + +<code>testObj</code> +

instance of that is emitting the signal

+
+ +<code>error</code> +

A GLib.Error if something went wrong + internally in @self. You must not free this GLib.Error.

+
+
+ +
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.emit_sig_with_error.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.emit_sig_with_error.page new file mode 100644 index 00000000..1d0128eb --- /dev/null +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.emit_sig_with_error.page @@ -0,0 +1,26 @@ + + + + + + + void + + regress_test_obj_emit_sig_with_error + + + Regress.TestObj.prototype.emit_sig_with_error + +function emit_sig_with_error(): void { + // Gjs wrapper for regress_test_obj_emit_sig_with_error() +} + + + + + diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.emit_sig_with_null_error.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.emit_sig_with_null_error.page new file mode 100644 index 00000000..84ff3771 --- /dev/null +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.TestObj.emit_sig_with_null_error.page @@ -0,0 +1,26 @@ + + + + + + + void + + regress_test_obj_emit_sig_with_null_error + + + Regress.TestObj.prototype.emit_sig_with_null_error + +function emit_sig_with_null_error(): void { + // Gjs wrapper for regress_test_obj_emit_sig_with_null_error() +} + + + + + diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-sig-with-gerror.page b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-sig-with-gerror.page new file mode 100644 index 00000000..9e0cd6e4 --- /dev/null +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj-sig-with-gerror.page @@ -0,0 +1,40 @@ + + + + + sig-with-gerror + + Regress.TestObj::sig-with-gerror + +def callback(test_obj, error, user_param1, ...) + +

This signal is modeled after #GstDiscoverer::discovered, and is added to +exercise the path of a GLib.Error being marshalled as a boxed type instead of +an exception in the introspected language.

Use via and +, or emit via the introspected +language.

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

instance of that is emitting the signal

+
+ +<code>error</code> +

A GLib.Error if something went wrong + internally in @self. You must not free this GLib.Error.

+
+<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-Python-expected/Regress.TestObj.emit_sig_with_error.page b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.emit_sig_with_error.page new file mode 100644 index 00000000..de973b13 --- /dev/null +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.emit_sig_with_error.page @@ -0,0 +1,37 @@ + + + + + + + none + + regress_test_obj_emit_sig_with_error + + Regress.TestObj + self + + + + Regress.TestObj.emit_sig_with_error + +@accepts(Regress.TestObj) +@returns(none) +def emit_sig_with_error(self): + # Python wrapper for regress_test_obj_emit_sig_with_error() + + + + + +<code>self</code> +

The object to emit the signal.

+
+
+ +
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.emit_sig_with_null_error.page b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.emit_sig_with_null_error.page new file mode 100644 index 00000000..4ced2eb6 --- /dev/null +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.TestObj.emit_sig_with_null_error.page @@ -0,0 +1,37 @@ + + + + + + + none + + regress_test_obj_emit_sig_with_null_error + + Regress.TestObj + self + + + + Regress.TestObj.emit_sig_with_null_error + +@accepts(Regress.TestObj) +@returns(none) +def emit_sig_with_null_error(self): + # Python wrapper for regress_test_obj_emit_sig_with_null_error() + + + + + +<code>self</code> +

The object to emit the signal.

+
+
+ +
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir index a5e3665d..949df37b 100644 --- a/tests/scanner/Regress-1.0-expected.gir +++ b/tests/scanner/Regress-1.0-expected.gir @@ -18,8 +18,8 @@ and/or use gtk-doc annotations. --> Typedef TestBoxed to test caller-allocates correctness - + line="1381">Typedef TestBoxed to test caller-allocates correctness + @@ -33,15 +33,15 @@ and/or use gtk-doc annotations. --> Compatibility typedef, like telepathy-glib's TpIntSet - + line="1351">Compatibility typedef, like telepathy-glib's TpIntSet + Typedef'd GPtrArray for some reason - + line="1359">Typedef'd GPtrArray for some reason + @@ -51,8 +51,8 @@ and/or use gtk-doc annotations. --> Typedef'd va_list for additional reasons - + line="1370">Typedef'd va_list for additional reasons + - + - + - + - + - + @@ -2582,13 +2582,13 @@ exposed to language bindings. - + - + Like telepathy-glib's TpIntset. - + line="1343">Like telepathy-glib's TpIntset. + - + - + @@ -2641,7 +2641,7 @@ exposed to language bindings. - + @@ -2649,7 +2649,7 @@ exposed to language bindings. - + @@ -2666,13 +2666,13 @@ exposed to language bindings. - + - + introspectable="0"> This should be skipped, and moreover, all function which + line="1325">This should be skipped, and moreover, all function which use it should be. - + @@ -2711,7 +2711,7 @@ use it should be. - + @@ -2720,7 +2720,7 @@ use it should be. - + @@ -2729,7 +2729,7 @@ use it should be. - + @@ -2738,7 +2738,7 @@ use it should be. - + @@ -2747,7 +2747,7 @@ use it should be. - + @@ -2756,7 +2756,7 @@ use it should be. - + @@ -2765,7 +2765,7 @@ use it should be. - + @@ -2774,7 +2774,7 @@ use it should be. - + @@ -2783,7 +2783,7 @@ use it should be. - + @@ -2792,7 +2792,7 @@ use it should be. - + @@ -2801,7 +2801,7 @@ use it should be. - + @@ -2810,7 +2810,7 @@ use it should be. - + @@ -2819,7 +2819,7 @@ use it should be. - + @@ -2837,7 +2837,7 @@ use it should be. - + @@ -2846,7 +2846,7 @@ use it should be. - + @@ -2873,7 +2873,7 @@ use it should be. - + @@ -2882,7 +2882,7 @@ use it should be. - + @@ -2891,7 +2891,7 @@ use it should be. - + @@ -2900,7 +2900,7 @@ use it should be. - + @@ -2909,7 +2909,7 @@ use it should be. - + @@ -3157,13 +3157,13 @@ use it should be. - + - + @@ -3188,7 +3188,7 @@ use it should be. - + @@ -3210,7 +3210,7 @@ use it should be. - + @@ -3218,25 +3218,25 @@ use it should be. the investment rate + line="1096">the investment rate how much money + line="1097">how much money Path to file + line="1098">Path to file - + @@ -3248,7 +3248,7 @@ use it should be. - + @@ -3256,7 +3256,7 @@ use it should be. a hash table; will be modified + line="1085">a hash table; will be modified @@ -3266,7 +3266,7 @@ use it should be. - + @@ -3274,20 +3274,20 @@ use it should be. GError instance; must be freed by the callback + line="1091">GError instance; must be freed by the callback - + - + @@ -3456,13 +3456,13 @@ use it should be. glib:type-name="RegressTestFloating" glib:get-type="regress_test_floating_get_type" glib:type-struct="TestFloatingClass"> - + - + A new floating #RegressTestFloating + line="4267">A new floating #RegressTestFloating @@ -3473,7 +3473,7 @@ use it should be. - + @@ -3491,9 +3491,9 @@ use it should be. glib:unref-func="regress_test_fundamental_object_unref" glib:set-value-func="regress_test_value_set_fundamental_object" glib:get-value-func="regress_test_value_get_fundamental_object"> - + - + @@ -3506,7 +3506,7 @@ use it should be. - + @@ -3518,11 +3518,11 @@ use it should be. - + A new #RegressTestFundamentalObject + line="3384">A new #RegressTestFundamentalObject @@ -3536,7 +3536,7 @@ use it should be. - + @@ -3561,7 +3561,7 @@ use it should be. - + @@ -3576,7 +3576,7 @@ use it should be. - + @@ -3590,7 +3590,7 @@ use it should be. - + @@ -3609,10 +3609,10 @@ use it should be. glib:get-type="regress_test_fundamental_sub_object_get_type" glib:type-struct="TestFundamentalSubObjectClass" glib:fundamental="1"> - + - + @@ -3634,7 +3634,7 @@ use it should be. - + @@ -3758,10 +3758,10 @@ use it should be. glib:type-name="RegressTestInterface" glib:get-type="regress_test_interface_get_type" glib:type-struct="TestInterfaceIface"> - + - + @@ -3769,7 +3769,7 @@ use it should be. the object to emit the signal + line="4126">the object to emit the signal @@ -3788,7 +3788,7 @@ use it should be. the code must look up the signal with + line="4107">the code must look up the signal with g_interface_info_find_signal() in order to get this to work. @@ -3798,13 +3798,13 @@ use it should be. - + - + @@ -3832,14 +3832,14 @@ use it should be. A #RegressTestObj + line="2791">A #RegressTestObj - + @@ -3877,7 +3877,7 @@ use it should be. - + @@ -3890,14 +3890,14 @@ use it should be. allow-none="1"> A #RegressTestObj + line="3203">A #RegressTestObj - + @@ -3909,7 +3909,7 @@ use it should be. - + @@ -3960,7 +3960,7 @@ use it should be. This method is virtual. Notably its name differs from the virtual + line="3177">This method is virtual. Notably its name differs from the virtual slot name, which makes it useful for testing bindings handle this case. @@ -3971,13 +3971,13 @@ case. A #RegressTestObj + line="3179">A #RegressTestObj Meaningless string + line="3180">Meaningless string @@ -3985,10 +3985,10 @@ case. This method is virtual. Notably its name differs from the virtual + line="3177">This method is virtual. Notably its name differs from the virtual slot name, which makes it useful for testing bindings handle this case. - + @@ -3996,13 +3996,13 @@ case. A #RegressTestObj + line="3179">A #RegressTestObj Meaningless string + line="3180">Meaningless string @@ -4019,6 +4019,21 @@ case. + + + + + + + + The object to emit the signal. + + + + @@ -4035,7 +4050,7 @@ case. c:identifier="regress_test_obj_emit_sig_with_inout_int"> The signal handler must increment the inout parameter by 1. + line="2882">The signal handler must increment the inout parameter by 1. @@ -4044,7 +4059,7 @@ case. The object to emit the signal. + line="2884">The object to emit the signal. @@ -4061,6 +4076,21 @@ case. + + + + + + + + The object to emit the signal. + + + + @@ -4086,7 +4116,7 @@ case. - + @@ -4094,14 +4124,14 @@ case. A #RegressTestObj + line="2944">A #RegressTestObj - + @@ -4113,7 +4143,7 @@ case. - + @@ -4132,7 +4162,7 @@ case. - + @@ -4144,7 +4174,7 @@ case. - + @@ -4152,14 +4182,14 @@ case. A #RegressTestObj + line="3247">A #RegressTestObj - + @@ -4167,13 +4197,13 @@ case. A #RegressTestObj + line="3234">A #RegressTestObj some uint8 array + line="3235">some uint8 array @@ -4181,14 +4211,14 @@ case. length of @input + line="3236">length of @input - + @@ -4196,13 +4226,13 @@ case. A #RegressTestObj + line="3223">A #RegressTestObj some #GObject + line="3224">some #GObject @@ -4229,25 +4259,25 @@ case. throws="1"> Check that the out value is skipped - + line="3141">Check that the out value is skipped + %TRUE if the call succeeds, %FALSE if @error is set. + line="3155">%TRUE if the call succeeds, %FALSE if @error is set. A #RegressTestObj. + line="3143">A #RegressTestObj. Parameter. + line="3144">Parameter. transfer-ownership="full"> Return value. + line="3145">Return value. Other parameter. + line="3146">Other parameter. skip="1"> Will be incremented. + line="3147">Will be incremented. transfer-ownership="full"> Return value. + line="3148">Return value. Number. + line="3149">Number. Number. + line="3150">Number. @@ -4303,25 +4333,25 @@ case. throws="1"> Check that the out value is skipped - + line="3105">Check that the out value is skipped + %TRUE if the call succeeds, %FALSE if @error is set. + line="3119">%TRUE if the call succeeds, %FALSE if @error is set. A #RegressTestObj. + line="3107">A #RegressTestObj. Parameter. + line="3108">Parameter. skip="1"> Return value. + line="3109">Return value. Other parameter. + line="3110">Other parameter. transfer-ownership="full"> Will be incremented. + line="3111">Will be incremented. transfer-ownership="full"> Return value. + line="3112">Return value. Number. + line="3113">Number. Number. + line="3114">Number. @@ -4377,25 +4407,25 @@ case. throws="1"> Check that a parameter is skipped - + line="3069">Check that a parameter is skipped + %TRUE if the call succeeds, %FALSE if @error is set. + line="3083">%TRUE if the call succeeds, %FALSE if @error is set. A #RegressTestObj. + line="3071">A #RegressTestObj. Parameter. + line="3072">Parameter. transfer-ownership="full"> Return value. + line="3073">Return value. Other parameter. + line="3074">Other parameter. transfer-ownership="full"> Will be incremented. + line="3075">Will be incremented. transfer-ownership="full"> Return value. + line="3076">Return value. Number. + line="3077">Number. Number. + line="3078">Number. @@ -4450,25 +4480,25 @@ case. throws="1"> Check that the return value is skipped - + line="3009">Check that the return value is skipped + %TRUE if the call succeeds, %FALSE if @error is set. + line="3023">%TRUE if the call succeeds, %FALSE if @error is set. a #RegressTestObj + line="3011">a #RegressTestObj Parameter. + line="3012">Parameter. transfer-ownership="full"> A return value. + line="3013">A return value. Other parameter. + line="3014">Other parameter. transfer-ownership="full"> Will be incremented. + line="3015">Will be incremented. transfer-ownership="full"> Return value. + line="3016">Return value. Number. + line="3017">Number. Number. + line="3018">Number. @@ -4523,33 +4553,33 @@ case. throws="1"> Check that the return value is skipped. Succeed if a is nonzero, otherwise + line="3045">Check that the return value is skipped. Succeed if a is nonzero, otherwise raise an error. - + %TRUE if the call succeeds, %FALSE if @error is set. + line="3054">%TRUE if the call succeeds, %FALSE if @error is set. a #RegressTestObj + line="3047">a #RegressTestObj Parameter. + line="3048">Parameter. - + @@ -4557,7 +4587,7 @@ raise an error. A #RegressTestObj + line="2954">A #RegressTestObj @@ -4594,8 +4624,8 @@ raise an error. throws="1"> This function throws an error if m is odd. - + line="2977">This function throws an error if m is odd. + @@ -4603,7 +4633,7 @@ raise an error. A #RegressTestObj + line="2979">A #RegressTestObj @@ -4779,7 +4809,7 @@ raise an error. This test signal similar to GSettings::change-event. + line="2361">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. @@ -4792,7 +4822,7 @@ raise from the introspection client language. allow-none="1"> numbers, or %NULL + line="2364">numbers, or %NULL @@ -4800,7 +4830,7 @@ raise from the introspection client language. length of @arr, or 0 + line="2365">length of @arr, or 0 @@ -4808,7 +4838,7 @@ raise from the introspection client language. This test signal is like TelepathyGlib's + line="2341">This test signal is like TelepathyGlib's TpChannel:: group-members-changed-detailed: @@ -4817,7 +4847,7 @@ raise from the introspection client language. numbers + line="2344">numbers @@ -4832,15 +4862,41 @@ raise from the introspection client language. A cairo context. + line="2447">A cairo context. + + This signal is modeled after #GstDiscoverer::discovered, and is added to +exercise the path of a #GError being marshalled as a boxed type instead of +an exception in the introspected language. + +Use via regress_test_obj_emit_sig_with_error() and +regress_test_obj_emit_sig_with_null_error(), or emit via the introspected +language. + + + + + + A #GError if something went wrong + internally in @self. You must not free this #GError. + + + + This test signal is like TelepathyGlib's + line="2384">This test signal is like TelepathyGlib's TpAccount::status-changed @@ -4857,7 +4913,7 @@ raise from the introspection client language. This signal is modeled after GtkEditable::insert-text. + line="2554">This signal is modeled after GtkEditable::insert-text. @@ -4868,7 +4924,7 @@ raise from the introspection client language. transfer-ownership="full"> The position, in characters, at which to + line="2557">The position, in characters, at which to insert the new text. This is an in-out paramter. After the signal emission is finished, it should point after the newly inserted text. @@ -4878,7 +4934,7 @@ raise from the introspection client language. You can use this with regress_test_obj_emit_sig_with_int64, or raise from + line="2495">You can use this with regress_test_obj_emit_sig_with_int64, or raise from the introspection client langage. @@ -4887,7 +4943,7 @@ the introspection client langage. an integer + line="2498">an integer @@ -4902,7 +4958,7 @@ the introspection client langage. an integer + line="2538">an integer @@ -4910,7 +4966,7 @@ the introspection client langage. Test transfer none GObject as a param (tests refcounting). + line="2423">Test transfer none GObject as a param (tests refcounting). Use with regress_test_obj_emit_sig_with_obj @@ -4919,7 +4975,7 @@ Use with regress_test_obj_emit_sig_with_obj A newly created RegressTestObj + line="2426">A newly created RegressTestObj @@ -4927,7 +4983,7 @@ Use with regress_test_obj_emit_sig_with_obj Test GStrv as a param. + line="2404">Test GStrv as a param. @@ -4935,7 +4991,7 @@ Use with regress_test_obj_emit_sig_with_obj strings + line="2407">strings @@ -4945,7 +5001,7 @@ Use with regress_test_obj_emit_sig_with_obj You can use this with regress_test_obj_emit_sig_with_uint64, or raise from + line="2515">You can use this with regress_test_obj_emit_sig_with_uint64, or raise from the introspection client langage. @@ -4954,7 +5010,7 @@ the introspection client langage. an integer + line="2518">an integer @@ -4995,13 +5051,13 @@ the introspection client langage. A #RegressTestObj + line="3179">A #RegressTestObj Meaningless string + line="3180">Meaningless string @@ -5084,7 +5140,7 @@ the introspection client langage. - + @@ -5095,7 +5151,7 @@ the introspection client langage. - + @@ -5107,7 +5163,7 @@ the introspection client langage. - + @@ -5207,7 +5263,7 @@ the introspection client langage. - + @@ -5414,7 +5470,7 @@ the introspection client langage. - + @@ -5424,7 +5480,7 @@ the introspection client langage. - + @@ -5443,17 +5499,17 @@ the introspection client langage. glib:type-name="RegressTestSubObj" glib:get-type="regress_test_sub_obj_get_type" glib:type-struct="TestSubObjClass"> - + - + - + @@ -5464,7 +5520,7 @@ the introspection client langage. - + @@ -5493,7 +5549,7 @@ the introspection client langage. - + @@ -5505,16 +5561,16 @@ the introspection client langage. glib:type-name="RegressTestWi8021x" glib:get-type="regress_test_wi_802_1x_get_type" glib:type-struct="TestWi8021xClass"> - + - + - + @@ -5526,7 +5582,7 @@ the introspection client langage. - + @@ -5538,7 +5594,7 @@ the introspection client langage. - + @@ -5564,7 +5620,7 @@ the introspection client langage. - + @@ -5572,12 +5628,12 @@ the introspection client langage. - + - + @@ -6234,7 +6290,7 @@ exposed to language bindings. - + @@ -6245,14 +6301,14 @@ exposed to language bindings. allow-none="1"> A #RegressTestObj + line="3194">A #RegressTestObj - + @@ -6263,17 +6319,17 @@ exposed to language bindings. allow-none="1"> A #RegressTestObj + line="3214">A #RegressTestObj - + A new variant + line="4543">A new variant @@ -6299,9 +6355,9 @@ exposed to language bindings. c:identifier="regress_has_parameter_named_attrs"> This test case mirrors GnomeKeyringPasswordSchema from + line="4503">This test case mirrors GnomeKeyringPasswordSchema from libgnome-keyring. - + @@ -6309,13 +6365,13 @@ libgnome-keyring. some int + line="4505">some int list of attributes + line="4506">list of attributes @@ -6324,7 +6380,7 @@ libgnome-keyring. - + @@ -6337,7 +6393,7 @@ libgnome-keyring. - + @@ -6350,7 +6406,7 @@ libgnome-keyring. - + @@ -6387,7 +6443,7 @@ libgnome-keyring. - + @@ -6399,7 +6455,7 @@ libgnome-keyring. - + @@ -6410,7 +6466,7 @@ libgnome-keyring. transfer-ownership="full"> An array of #RegressTestObj + line="3256">An array of #RegressTestObj @@ -6574,7 +6630,7 @@ libgnome-keyring. - + @@ -6764,12 +6820,12 @@ libgnome-keyring. c:identifier="regress_test_array_struct_in_full"> Test flat array input with transfer full. + line="4635">Test flat array input with transfer full. Similar to: - gsf_property_settings_free() with structs but they contain pointers - g_byte_array_new_take() with guint8s - + @@ -6777,7 +6833,7 @@ Similar to: An array + line="4637">An array @@ -6785,7 +6841,7 @@ Similar to: Length of @arr + line="4638">Length of @arr @@ -6794,10 +6850,10 @@ Similar to: c:identifier="regress_test_array_struct_in_none"> Test flat array input with transfer none. + line="4655">Test flat array input with transfer none. Similar to g_main_context_check() or gtk_target_list_new(). - + @@ -6805,7 +6861,7 @@ Similar to g_main_context_check() or gtk_target_list_new(). An array. + line="4657">An array. @@ -6813,7 +6869,7 @@ Similar to g_main_context_check() or gtk_target_list_new(). Length of @arr + line="4658">Length of @arr @@ -6848,10 +6904,10 @@ Similar to g_main_context_check() or gtk_target_list_new(). c:identifier="regress_test_array_struct_out_caller_alloc"> Test flat caller-allocated array output. + line="4614">Test flat caller-allocated array output. Similar to g_main_context_query(). - + @@ -6862,7 +6918,7 @@ Similar to g_main_context_query(). transfer-ownership="none"> An array + line="4616">An array @@ -6873,7 +6929,7 @@ Similar to g_main_context_query(). transfer-ownership="full"> Length of @arr + line="4617">Length of @arr @@ -6882,10 +6938,10 @@ Similar to g_main_context_query(). c:identifier="regress_test_array_struct_out_container"> Test flat array output with transfer container. + line="4576">Test flat array output with transfer container. Similar to pango_layout_get_log_attrs(). - + @@ -6896,7 +6952,7 @@ Similar to pango_layout_get_log_attrs(). transfer-ownership="container"> An array + line="4578">An array @@ -6907,7 +6963,7 @@ Similar to pango_layout_get_log_attrs(). transfer-ownership="full"> Length of @arr + line="4579">Length of @arr @@ -6916,8 +6972,8 @@ Similar to pango_layout_get_log_attrs(). c:identifier="regress_test_array_struct_out_full_fixed"> Test flat fixed-size array output with transfer full. - + line="4598">Test flat fixed-size array output with transfer full. + @@ -6928,7 +6984,7 @@ Similar to pango_layout_get_log_attrs(). transfer-ownership="full"> An array + line="4600">An array @@ -6941,13 +6997,13 @@ Similar to pango_layout_get_log_attrs(). c:identifier="regress_test_array_struct_out_none"> Test flat array output with transfer none. + line="4551">Test flat array output with transfer none. Similar to: - mm_modem_peek_ports() with structs - gdk_query_visual_types() with enums - gdk_event_get_axes() with doubles - + @@ -6958,7 +7014,7 @@ Similar to: transfer-ownership="none"> An array + line="4553">An array @@ -6969,14 +7025,14 @@ Similar to: transfer-ownership="full"> Length of @arr + line="4554">Length of @arr - + @@ -7105,7 +7161,7 @@ Similar to: - + @@ -7121,7 +7177,7 @@ Similar to: - + @@ -7145,9 +7201,9 @@ Similar to: c:identifier="regress_test_callback_destroy_notify"> Notified - callback persists until a DestroyNotify delegate + line="3857">Notified - callback persists until a DestroyNotify delegate is invoked. - + @@ -7175,9 +7231,9 @@ is invoked. c:identifier="regress_test_callback_destroy_notify_no_user_data"> Adds a scope notified callback with no user data. This can invoke an error + line="3884">Adds a scope notified callback with no user data. This can invoke an error condition in bindings which needs to be tested. - + @@ -7196,7 +7252,7 @@ condition in bindings which needs to be tested. - + @@ -7209,7 +7265,7 @@ condition in bindings which needs to be tested. - + @@ -7218,14 +7274,14 @@ condition in bindings which needs to be tested. c:identifier="regress_test_callback_thaw_notifications"> Invokes all callbacks installed by #test_callback_destroy_notify(), + line="3898">Invokes all callbacks installed by #test_callback_destroy_notify(), adding up their return values, and removes them, invoking the corresponding destroy notfications. - + Sum of the return values of the invoked callbacks. + line="3905">Sum of the return values of the invoked callbacks. @@ -7233,9 +7289,9 @@ corresponding destroy notfications. c:identifier="regress_test_callback_user_data"> Call - callback parameter persists for the duration of the method + line="3826">Call - callback parameter persists for the duration of the method call and can be released on return. - + @@ -7307,7 +7363,7 @@ call and can be released on return. - + @@ -7315,7 +7371,7 @@ call and can be released on return. - + @@ -7400,7 +7456,7 @@ call and can be released on return. - + @@ -7863,7 +7919,7 @@ element-type annotation. - + @@ -7871,7 +7927,7 @@ element-type annotation. GHashTable that gets passed to callback + line="4029">GHashTable that gets passed to callback @@ -7981,7 +8037,7 @@ element-type annotation. - + @@ -8023,14 +8079,14 @@ element-type annotation. c:identifier="regress_test_multiline_doc_comments"> This is a function. + line="4411">This is a function. It has multiple lines in the documentation. The sky is blue. You will give me your credit card number. - + @@ -8039,7 +8095,7 @@ You will give me your credit card number. c:identifier="regress_test_nested_parameter"> <informaltable> + line="4427"><informaltable> <tgroup cols="3"> <thead> <row> @@ -8067,7 +8123,7 @@ rgb(20%, 30%, 0%)</literallayout></entry> </informaltable> What we're testing here is that the scanner ignores the @a nested inside XML. - + @@ -8075,14 +8131,14 @@ What we're testing here is that the scanner ignores the @a nested inside XML. An integer + line="4429">An integer - + @@ -8098,7 +8154,7 @@ What we're testing here is that the scanner ignores the @a nested inside XML. - + @@ -8110,14 +8166,14 @@ What we're testing here is that the scanner ignores the @a nested inside XML. - + - + @@ -8163,7 +8219,7 @@ What we're testing here is that the scanner ignores the @a nested inside XML. - + @@ -8193,9 +8249,9 @@ What we're testing here is that the scanner ignores the @a nested inside XML. Should not emit a warning: + line="4079">Should not emit a warning: https://bugzilla.gnome.org/show_bug.cgi?id=685399 - + @@ -8203,7 +8259,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 No annotation here + line="4081">No annotation here @@ -8259,7 +8315,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - + @@ -8318,7 +8374,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - + @@ -8357,8 +8413,8 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 throws="1"> This function throws an error if m is odd. - + line="4299">This function throws an error if m is odd. + @@ -8394,7 +8450,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - + @@ -8695,7 +8751,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - + @@ -8727,7 +8783,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - + diff --git a/tests/scanner/Regress-1.0-sections-expected.txt b/tests/scanner/Regress-1.0-sections-expected.txt index ba180b4d..0a0bf082 100644 --- a/tests/scanner/Regress-1.0-sections-expected.txt +++ b/tests/scanner/Regress-1.0-sections-expected.txt @@ -346,9 +346,11 @@ RegressTestObj RegressTestObjClass regress_test_obj_do_matrix regress_test_obj_emit_sig_with_array_len_prop +regress_test_obj_emit_sig_with_error regress_test_obj_emit_sig_with_foreign_struct regress_test_obj_emit_sig_with_inout_int regress_test_obj_emit_sig_with_int64 +regress_test_obj_emit_sig_with_null_error regress_test_obj_emit_sig_with_obj regress_test_obj_emit_sig_with_uint64 regress_forced_method diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c index eca7cdd4..bc04079c 100644 --- a/tests/scanner/regress.c +++ b/tests/scanner/regress.c @@ -2300,6 +2300,7 @@ enum { REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_UINT64_PROP, REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_INTARRAY_RET, REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_INOUT_INT, + REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_GERROR, N_REGRESS_TEST_OBJ_SIGNALS }; @@ -2571,6 +2572,26 @@ regress_test_obj_class_init (RegressTestObjClass *klass) 1, G_TYPE_POINTER); + /** + * RegressTestObj::sig-with-gerror: + * @self: The object that emitted the signal + * @error: (nullable) (type GLib.Error): A #GError if something went wrong + * internally in @self. You must not free this #GError. + * + * This signal is modeled after #GstDiscoverer::discovered, and is added to + * exercise the path of a #GError being marshalled as a boxed type instead of + * an exception in the introspected language. + * + * Use via regress_test_obj_emit_sig_with_error() and + * regress_test_obj_emit_sig_with_null_error(), or emit via the introspected + * language. + */ + regress_test_obj_signals[REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_GERROR] = + g_signal_new ("sig-with-gerror", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, 0, NULL, NULL, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, + G_TYPE_ERROR | G_SIGNAL_TYPE_STATIC_SCOPE); + 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; @@ -2872,6 +2893,29 @@ regress_test_obj_emit_sig_with_inout_int (RegressTestObj *obj) g_assert_cmpint (inout, ==, 43); } +/** + * regress_test_obj_emit_sig_with_error: + * @self: The object to emit the signal. + */ +void +regress_test_obj_emit_sig_with_error (RegressTestObj *self) +{ + GError *err = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, + "Something failed"); + g_signal_emit_by_name (self, "sig-with-gerror", err); + g_error_free (err); +} + +/** + * regress_test_obj_emit_sig_with_null_error: + * @self: The object to emit the signal. + */ +void +regress_test_obj_emit_sig_with_null_error (RegressTestObj *self) +{ + g_signal_emit_by_name (self, "sig-with-gerror", NULL); +} + int regress_test_obj_instance_method (RegressTestObj *obj G_GNUC_UNUSED) { diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h index 82fd6b55..cf5302e4 100644 --- a/tests/scanner/regress.h +++ b/tests/scanner/regress.h @@ -845,6 +845,12 @@ void regress_test_obj_emit_sig_with_array_len_prop (RegressTestObj *obj); _GI_TEST_EXTERN void regress_test_obj_emit_sig_with_inout_int (RegressTestObj *obj); +_GI_TEST_EXTERN +void regress_test_obj_emit_sig_with_error (RegressTestObj *self); + +_GI_TEST_EXTERN +void regress_test_obj_emit_sig_with_null_error (RegressTestObj *self); + _GI_TEST_EXTERN int regress_test_obj_instance_method (RegressTestObj *obj); -- cgit v1.2.1