summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2012-10-27 13:54:44 -0400
committerColin Walters <walters@verbum.org>2012-10-27 13:54:44 -0400
commit6fc366a66c58039aec345cc531c329729b6bce18 (patch)
treedf4885f68c34e8b349ccca0e9cbfc705c3fcf232 /tests
parent13f9d941f5a03c899be2c4c08455f30b8ced9ce2 (diff)
downloadgobject-introspection-6fc366a66c58039aec345cc531c329729b6bce18.tar.gz
regress: Add a test case for skipping a function with an unannotated callback
https://bugzilla.gnome.org/show_bug.cgi?id=685399
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/Regress-1.0-expected.gir15
-rw-r--r--tests/scanner/regress.c12
-rw-r--r--tests/scanner/regress.h2
3 files changed, 29 insertions, 0 deletions
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 8d123f7a..125a1ea3 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -3125,6 +3125,21 @@ What we're testing here is that the scanner ignores the @a nested inside XML.</d
</parameter>
</parameters>
</function>
+ <function name="test_skip_unannotated_callback"
+ c:identifier="regress_test_skip_unannotated_callback"
+ introspectable="0">
+ <doc xml:whitespace="preserve">Should not emit a warning:
+https://bugzilla.gnome.org/show_bug.cgi?id=685399</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="callback" transfer-ownership="none">
+ <doc xml:whitespace="preserve">No annotation here</doc>
+ <type name="TestCallback" c:type="RegressTestCallback"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="test_ssize" c:identifier="regress_test_ssize">
<return-value transfer-ownership="none">
<type name="gssize" c:type="gssize"/>
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index c6ca6b74..bdc1dc3c 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -3514,6 +3514,18 @@ regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback)
callback (error);
}
+/**
+ * regress_test_skip_unannotated_callback: (skip)
+ * @callback: No annotation here
+ *
+ * Should not emit a warning:
+ * https://bugzilla.gnome.org/show_bug.cgi?id=685399
+ */
+void
+regress_test_skip_unannotated_callback (RegressTestCallback callback)
+{
+}
+
/* interface */
static void
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index b55c463b..b1a82868 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -696,6 +696,8 @@ void regress_test_gerror_callback (RegressTestCallbackGError callback);
void regress_test_null_gerror_callback (RegressTestCallbackGError callback);
void regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback);
+void regress_test_skip_unannotated_callback (RegressTestCallback callback);
+
typedef struct _RegressTestInterface RegressTestInterface;
/* interface */