+static TestEnum
+on_generic_marshaller_enum_return_signed_1 (Test *obj)
+{
+ return TEST_ENUM_NEGATIVE;
+}
+
+static TestEnum
+on_generic_marshaller_enum_return_signed_2 (Test *obj)
+{
+ return TEST_ENUM_BAR;
+}
+
+static void
+test_generic_marshaller_signal_enum_return_signed (void)
+{
+ Test *test;
+ guint id;
+ TestEnum retval = 0;
+
+ test = g_object_new (test_get_type (), NULL);
+
+ /* Test return value NEGATIVE */
+ id = g_signal_connect (test,
+ "generic-marshaller-enum-return-signed",
+ G_CALLBACK (on_generic_marshaller_enum_return_signed_1),
+ NULL);
+ g_signal_emit_by_name (test, "generic-marshaller-enum-return-signed", &retval);
+ g_assert_cmpint (retval, ==, TEST_ENUM_NEGATIVE);
+ g_signal_handler_disconnect (test, id);
+
+ /* Test return value BAR */
+ retval = 0;
+ id = g_signal_connect (test,
+ "generic-marshaller-enum-return-signed",
+ G_CALLBACK (on_generic_marshaller_enum_return_signed_2),
+ NULL);
+ g_signal_emit_by_name (test, "generic-marshaller-enum-return-signed", &retval);
+ g_assert_cmpint (retval, ==, TEST_ENUM_BAR);
+ g_signal_handler_disconnect (test, id);
+
+ g_object_unref (test);
+}
+
+static TestUnsignedEnum
+on_generic_marshaller_enum_return_unsigned_1 (Test *obj)
+{
+ return TEST_UNSIGNED_ENUM_FOO;
+}
+
+static TestUnsignedEnum
+on_generic_marshaller_enum_return_unsigned_2 (Test *obj)
+{
+ return TEST_UNSIGNED_ENUM_BAR;
+}
+
+static void
+test_generic_marshaller_signal_enum_return_unsigned (void)
+{
+ Test *test;
+ guint id;
+ TestUnsignedEnum retval = 0;
+
+ test = g_object_new (test_get_type (), NULL);
+
+ /* Test return value FOO */
+ id = g_signal_connect (test,
+ "generic-marshaller-enum-return-unsigned",
+ G_CALLBACK (on_generic_marshaller_enum_return_unsigned_1),
+ NULL);
+ g_signal_emit_by_name (test, "generic-marshaller-enum-return-unsigned", &retval);
+ g_assert_cmpint (retval, ==, TEST_UNSIGNED_ENUM_FOO);
+ g_signal_handler_disconnect (test, id);
+
+ /* Test return value BAR */
+ retval = 0;
+ id = g_signal_connect (test,
+ "generic-marshaller-enum-return-unsigned",
+ G_CALLBACK (on_generic_marshaller_enum_return_unsigned_2),
+ NULL);
+ g_signal_emit_by_name (test, "generic-marshaller-enum-return-unsigned", &retval);
+ g_assert_cmpint (retval, ==, TEST_UNSIGNED_ENUM_BAR);
+ g_signal_handler_disconnect (test, id);
+
+ g_object_unref (test);
+}
+