summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2012-02-03 13:20:00 -0500
committerColin Walters <walters@verbum.org>2012-02-03 13:20:57 -0500
commit39a70b7b108ed1a262de0b9dc3ffca944d9eee0f (patch)
treea3ef3ed0fdd5893f4672aceed9c267193919f534 /tests
parent79dcd9cd97b36b92a8f0dd0b94f40055fddbf7d4 (diff)
downloadgobject-introspection-39a70b7b108ed1a262de0b9dc3ffca944d9eee0f.tar.gz
girepository: Add GI_VFUNC_THROWS
Virtual functions can definitely throw an error. Right now the scanner omits the GError parameter for them and adds throws="1", but g-ir-compiler ignores this. https://bugzilla.gnome.org/show_bug.cgi?id=669332
Diffstat (limited to 'tests')
-rw-r--r--tests/gimarshallingtests.c12
-rw-r--r--tests/gimarshallingtests.h7
2 files changed, 18 insertions, 1 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 66a6dad1..8734a903 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -3946,6 +3946,17 @@ gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters (GIMa
return return_value;
}
+gboolean
+gi_marshalling_tests_object_vfunc_meth_with_error (GIMarshallingTestsObject *self,
+ gint x,
+ GError **error)
+{
+ gulong local = 0x12345678;
+ gboolean ret = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_meth_with_err (self, x, error);
+ g_assert_cmpint(local, ==, 0x12345678);
+ return ret;
+}
+
G_DEFINE_TYPE (GIMarshallingTestsSubObject, gi_marshalling_tests_sub_object, GI_MARSHALLING_TESTS_TYPE_OBJECT);
static void
@@ -4280,7 +4291,6 @@ gi_marshalling_tests_overrides_object_method (GIMarshallingTestsOverridesObject
return 42;
}
-
/**
* gi_marshalling_tests_overrides_object_returnv:
*
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index e4f5cb9b..1d66991f 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -737,6 +737,12 @@ struct _GIMarshallingTestsObjectClass
*/
glong (* vfunc_return_value_and_multiple_out_parameters) (GIMarshallingTestsObject *self, glong *a, glong *b);
+ /**
+ * GIMarshallingTestsObjectClass::vfunc_meth_with_err:
+ * @x:
+ * @error: A #GError
+ */
+ gboolean (*vfunc_meth_with_err) (GIMarshallingTestsObject *object, gint x, GError **error);
};
struct _GIMarshallingTestsObject
@@ -766,6 +772,7 @@ void gi_marshalling_tests_object_vfunc_one_out_parameter (GIMarshallingTestsObje
void gi_marshalling_tests_object_vfunc_multiple_out_parameters (GIMarshallingTestsObject *self, gfloat *a, gfloat *b);
glong gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter (GIMarshallingTestsObject *self, glong *a);
glong gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters (GIMarshallingTestsObject *self, glong *a, glong *b);
+gboolean gi_marshalling_tests_object_vfunc_meth_with_error (GIMarshallingTestsObject *object, gint x, GError **error);
GIMarshallingTestsObject *gi_marshalling_tests_object_none_return (void);
GIMarshallingTestsObject *gi_marshalling_tests_object_full_return (void);