summaryrefslogtreecommitdiff
path: root/tests/scanner
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>2008-12-16 04:20:50 +0000
committerOwen Taylor <otaylor@src.gnome.org>2008-12-16 04:20:50 +0000
commitaa8bf8d82c96d7151017c8b7e721fb4454645597 (patch)
tree0e0214a1cc0a8832cd8afd8696a934f405328fdb /tests/scanner
parent6ae11e8edbd5ca6783fb6166b2b921fac06ebdc3 (diff)
downloadgobject-introspection-aa8bf8d82c96d7151017c8b7e721fb4454645597.tar.gz
Disable array auto-detection for out-annotated parameters
If we have a parameter annotated as (out), then having a ctype of 'char **' (or similar) doesn't necessarily indicate an array. * giscanner/transformer.py: Skip array-detection logic for (out)-annotated parameters. * tests/scanner/annotation.h tests/scanner/annotation.c tests/scanner/annotation-1.0-expected.gir tests/scanner/annotation-1.0-expected.tgir: Add a test for an (out) string parameter. http://bugzilla.gnome.org/show_bug.cgi?id=563934 svn path=/trunk/; revision=994
Diffstat (limited to 'tests/scanner')
-rw-r--r--tests/scanner/annotation-1.0-expected.gir10
-rw-r--r--tests/scanner/annotation-1.0-expected.tgir10
-rw-r--r--tests/scanner/annotation.c16
-rw-r--r--tests/scanner/annotation.h2
4 files changed, 38 insertions, 0 deletions
diff --git a/tests/scanner/annotation-1.0-expected.gir b/tests/scanner/annotation-1.0-expected.gir
index 745bbc3f..88dcdc6a 100644
--- a/tests/scanner/annotation-1.0-expected.gir
+++ b/tests/scanner/annotation-1.0-expected.gir
@@ -235,6 +235,16 @@
</parameter>
</parameters>
</method>
+ <method name="string_out" c:identifier="annotation_object_string_out">
+ <return-value transfer-ownership="none">
+ <type name="boolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="str_out" direction="out" transfer-ownership="full">
+ <type name="utf8" c:type="char**"/>
+ </parameter>
+ </parameters>
+ </method>
<method name="do_not_use"
c:identifier="annotation_object_do_not_use"
deprecated="Use annotation_object_create_object() instead."
diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir
index 53df582e..4fe10bd6 100644
--- a/tests/scanner/annotation-1.0-expected.tgir
+++ b/tests/scanner/annotation-1.0-expected.tgir
@@ -224,6 +224,16 @@
</parameter>
</parameters>
</method>
+ <method name="string_out" c:identifier="annotation_object_string_out">
+ <return-value transfer-ownership="none">
+ <type name="boolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="str_out" transfer-ownership="full" direction="out">
+ <type name="utf8"/>
+ </parameter>
+ </parameters>
+ </method>
<method name="do_not_use" c:identifier="annotation_object_do_not_use" deprecated="1">
<return-value transfer-ownership="full">
<type name="GObject.Object"/>
diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c
index 420a927c..cbb69b72 100644
--- a/tests/scanner/annotation.c
+++ b/tests/scanner/annotation.c
@@ -292,6 +292,22 @@ annotation_object_parse_args(AnnotationObject *object,
}
/**
+ * annotation_object_string_out:
+ * @object: a #AnnotationObject
+ * @str_out: (out) (transfer full): string return value
+ *
+ * Test returning a string as an out parameter
+ *
+ * Returns: some boolean
+ **/
+gboolean
+annotation_object_string_out(AnnotationObject *object,
+ char **str_out)
+{
+
+}
+
+/**
* annotation_object_allow_none:
* @object: a #GObject
* @somearg: (allow-none):
diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h
index d6d60916..1e83ca23 100644
--- a/tests/scanner/annotation.h
+++ b/tests/scanner/annotation.h
@@ -73,6 +73,8 @@ void annotation_object_compute_sum_nz(AnnotationObject *object,
void annotation_object_parse_args (AnnotationObject *object,
int *argc,
char ***argv);
+gboolean annotation_object_string_out (AnnotationObject *object,
+ char **str_out);
GObject* annotation_object_do_not_use (AnnotationObject *object);