diff options
author | Giovanni Campagna <gcampagna@src.gnome.org> | 2012-02-11 16:02:40 +0100 |
---|---|---|
committer | Giovanni Campagna <gcampagna@src.gnome.org> | 2012-02-13 18:02:03 +0100 |
commit | 3042d49de04a4c8ad514cdf098630311f1b28256 (patch) | |
tree | c90c48a7f468f6c3a1eeaed22fd8579241085d42 /tests | |
parent | c58b33abfa936296c76b182dee75dc947c931389 (diff) | |
download | gobject-introspection-3042d49de04a4c8ad514cdf098630311f1b28256.tar.gz |
Add tests for GType of GValue
Some language bindings (like gjs) attempt to automatically infer the
GType from a native object when creating a GValue. This checks that
indeed the GValue has the right GType.
https://bugzilla.gnome.org/show_bug.cgi?id=669848
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gimarshallingtests.c | 11 | ||||
-rw-r--r-- | tests/gimarshallingtests.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 56d48388..7afe543a 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -2900,6 +2900,17 @@ gi_marshalling_tests_gvalue_in (GValue *value) } /** + * gi_marshalling_tests_gvalue_in_with_type: + * @value: (transfer none): + * @type: + */ +void +gi_marshalling_tests_gvalue_in_with_type (GValue *value, GType type) +{ + g_assert(g_type_is_a(G_VALUE_TYPE(value), type)); +} + +/** * gi_marshalling_tests_gvalue_in_enum: * @value: (transfer none): */ diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h index 782e61c5..0c889209 100644 --- a/tests/gimarshallingtests.h +++ b/tests/gimarshallingtests.h @@ -526,6 +526,7 @@ void gi_marshalling_tests_ghashtable_utf8_full_inout (GHashTable **hash_table); GValue *gi_marshalling_tests_gvalue_return (void); void gi_marshalling_tests_gvalue_in (GValue *value); +void gi_marshalling_tests_gvalue_in_with_type (GValue *value, GType type); void gi_marshalling_tests_gvalue_in_enum (GValue *value); |