summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2012-02-11 16:02:40 +0100
committerGiovanni Campagna <gcampagna@src.gnome.org>2012-02-13 18:02:03 +0100
commit3042d49de04a4c8ad514cdf098630311f1b28256 (patch)
treec90c48a7f468f6c3a1eeaed22fd8579241085d42 /tests
parentc58b33abfa936296c76b182dee75dc947c931389 (diff)
downloadgobject-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.c11
-rw-r--r--tests/gimarshallingtests.h1
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);