summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2008-11-17 22:07:26 +0000
committerDan Winship <danw@src.gnome.org>2008-11-17 22:07:26 +0000
commit37b60d07bd7ca7861a0758d47ad386730f8509fa (patch)
tree2dfd43f97c2fb9a3ce80e0c6eefa0ad960b755cf /tests
parente123aa13f6478ff7486c610e49a9c2f5efab194b (diff)
downloadgobject-introspection-37b60d07bd7ca7861a0758d47ad386730f8509fa.tar.gz
fix spelling of GHashTable. #561135
* giscanner/glibtransformer.py (GLibTransformer.__init__): fix spelling of GHashTable. #561135 * tests/scanner/annotation.c (annotation_object_get_hash): * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: add a test of GHashTable annotations svn path=/trunk/; revision=940
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/annotation-1.0-expected.gir8
-rw-r--r--tests/scanner/annotation-1.0-expected.tgir8
-rw-r--r--tests/scanner/annotation.c18
-rw-r--r--tests/scanner/annotation.h1
4 files changed, 35 insertions, 0 deletions
diff --git a/tests/scanner/annotation-1.0-expected.gir b/tests/scanner/annotation-1.0-expected.gir
index 5f8102e3..286759c1 100644
--- a/tests/scanner/annotation-1.0-expected.gir
+++ b/tests/scanner/annotation-1.0-expected.gir
@@ -149,6 +149,14 @@
</type>
</return-value>
</method>
+ <method name="get_hash" c:identifier="annotation_object_get_hash">
+ <return-value transfer-ownership="full">
+ <type name="GLib.HashTable" c:type="GHashTable*">
+ <type name="utf8"/>
+ <type name="GObject.Object"/>
+ </type>
+ </return-value>
+ </method>
<method name="get_objects" c:identifier="annotation_object_get_objects">
<return-value transfer-ownership="container">
<type name="GLib.SList" c:type="GSList*">
diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir
index 4728f8df..251d0bc9 100644
--- a/tests/scanner/annotation-1.0-expected.tgir
+++ b/tests/scanner/annotation-1.0-expected.tgir
@@ -140,6 +140,14 @@
</type>
</return-value>
</method>
+ <method name="get_hash" c:identifier="annotation_object_get_hash">
+ <return-value transfer-ownership="full">
+ <type name="GLib.HashTable">
+ <type name="utf8"/>
+ <type name="GObject.Object"/>
+ </type>
+ </return-value>
+ </method>
<method name="get_objects" c:identifier="annotation_object_get_objects">
<return-value transfer-ownership="container">
<type name="GLib.SList">
diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c
index 3a67a01a..fafb2a43 100644
--- a/tests/scanner/annotation.c
+++ b/tests/scanner/annotation.c
@@ -161,6 +161,24 @@ annotation_object_get_strings (AnnotationObject *object)
return list;
}
+/**
+ * annotation_object_get_hash:
+ * @object: a #GObject
+ *
+ * This is a test for returning a hash table mapping strings to
+ * objects.
+ *
+ * Return value: (element-type utf8 GObject): hash table
+ */
+GHashTable*
+annotation_object_get_hash (AnnotationObject *object)
+{
+ GHashTable *hash = g_hash_table_new_full (g_str_hash, g_str_equal,
+ g_free, g_object_unref);
+ g_hash_table_insert (hash, g_strdup ("one"), g_object_ref (object));
+ g_hash_table_insert (hash, g_strdup ("two"), g_object_ref (object));
+ return hash;
+}
/**
* annotation_object_with_voidp
diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h
index 116b881d..d79c309d 100644
--- a/tests/scanner/annotation.h
+++ b/tests/scanner/annotation.h
@@ -55,6 +55,7 @@ gint annotation_object_calleesowns (AnnotationObject *object,
GObject **toown1,
GObject **toown2);
GList* annotation_object_get_strings (AnnotationObject *object);
+GHashTable*annotation_object_get_hash (AnnotationObject *object);
GSList* annotation_object_get_objects (AnnotationObject *object);
void annotation_object_use_buffer (AnnotationObject *object,