[gobject-introspection] Add tests for GType of GValue



commit 3042d49de04a4c8ad514cdf098630311f1b28256
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Feb 11 16:02:40 2012 +0100

    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

 tests/gimarshallingtests.c |   11 +++++++++++
 tests/gimarshallingtests.h |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 56d4838..7afe543 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 782e61c..0c88920 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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]