summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-06-23 17:51:15 -0400
committerColin Walters <walters@verbum.org>2009-06-23 17:58:38 -0400
commit8ef942ed56236380cbc9acc445926bfa534cc58a (patch)
tree69ac42a0e9f5b8e33926dc98505cd2fedea91d08 /tests
parentfeee5b3fa9f79b3085388e181d5f6473749d84b8 (diff)
downloadgobject-introspection-8ef942ed56236380cbc9acc445926bfa534cc58a.tar.gz
Bug 579008 - Don't override element-type for arrays
Annotation parser patch from: Tim Horton <hortont424@gmail.com> If an explicit element type is specified, don't override it with guint8.
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/annotation-1.0-expected.gir16
-rw-r--r--tests/scanner/annotation-1.0-expected.tgir15
-rw-r--r--tests/scanner/annotation.c10
-rw-r--r--tests/scanner/annotation.h2
4 files changed, 43 insertions, 0 deletions
diff --git a/tests/scanner/annotation-1.0-expected.gir b/tests/scanner/annotation-1.0-expected.gir
index 46a30065..3715edca 100644
--- a/tests/scanner/annotation-1.0-expected.gir
+++ b/tests/scanner/annotation-1.0-expected.gir
@@ -607,6 +607,22 @@ detection, and fixing it via annotations.">
</parameter>
</parameters>
</function>
+ <function name="string_array_length"
+ c:identifier="annotation_string_array_length">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="n_properties" transfer-ownership="none">
+ <type name="uint" c:type="guint"/>
+ </parameter>
+ <parameter name="properties" transfer-ownership="none">
+ <array length="0" c:type="gchar*">
+ <type name="utf8"/>
+ </array>
+ </parameter>
+ </parameters>
+ </function>
<function name="string_zero_terminated"
c:identifier="annotation_string_zero_terminated">
<return-value transfer-ownership="full" doc="The return value">
diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir
index 9e6fe160..76a20edb 100644
--- a/tests/scanner/annotation-1.0-expected.tgir
+++ b/tests/scanner/annotation-1.0-expected.tgir
@@ -452,6 +452,21 @@
</parameter>
</parameters>
</function>
+ <function name="string_array_length" c:identifier="annotation_string_array_length">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="n_properties" transfer-ownership="none">
+ <type name="uint"/>
+ </parameter>
+ <parameter name="properties" transfer-ownership="none">
+ <array length="0">
+ <type name="utf8"/>
+ </array>
+ </parameter>
+ </parameters>
+ </function>
<function name="string_zero_terminated" c:identifier="annotation_string_zero_terminated">
<return-value transfer-ownership="full">
<array zero-terminated="1">
diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c
index 5c5d46d4..058d508a 100644
--- a/tests/scanner/annotation.c
+++ b/tests/scanner/annotation.c
@@ -601,6 +601,16 @@ annotation_versioned (void)
}
/**
+ * annotation_string_array_length:
+ * @n_properties:
+ * @properties: (array length=n_properties) (element-type utf8):
+ */
+void
+annotation_string_array_length (guint n_properties, const gchar * const properties[])
+{
+}
+
+/**
* annotation_object_extra_annos:
*
* Attributes: (org.foobar testvalue)
diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h
index 745a94b6..798594b1 100644
--- a/tests/scanner/annotation.h
+++ b/tests/scanner/annotation.h
@@ -129,6 +129,8 @@ void annotation_versioned (void);
char ** annotation_string_zero_terminated (void);
void annotation_string_zero_terminated_out (char ***out);
+void annotation_string_array_length (guint n_properties, const gchar * const properties[]);
+
void annotation_object_extra_annos (AnnotationObject *object);
void annotation_custom_destroy (AnnotationCallback callback,