summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaolo Borelli <pborelli@gnome.org>2012-02-05 18:54:43 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2012-02-06 09:38:25 +0100
commitb9bd2026f0772bde2739cff86ab5cfb462d43f26 (patch)
tree33a228a15b53e82f4432059a88cbca5a6efae818 /tests
parent553d0bd26af9ff732739f3da8be0c887fe2a490d (diff)
downloadgobject-introspection-b9bd2026f0772bde2739cff86ab5cfb462d43f26.tar.gz
Add regress_test_null_gerror_callback
It models the case where a callback that return a gerror succeds and set the error to NULL. https://bugzilla.gnome.org/show_bug.cgi?id=669415
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/Regress-1.0-expected.gir11
-rw-r--r--tests/scanner/regress.c10
-rw-r--r--tests/scanner/regress.h1
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index fd798ffc..481259c9 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -2660,6 +2660,17 @@ What we're testing here is that the scanner ignores the @a nested inside XML.</d
</parameter>
</parameters>
</function>
+ <function name="test_null_gerror_callback"
+ c:identifier="regress_test_null_gerror_callback">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="callback" transfer-ownership="none" scope="call">
+ <type name="TestCallbackGError" c:type="RegressTestCallbackGError"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="test_owned_gerror_callback"
c:identifier="regress_test_owned_gerror_callback">
<return-value transfer-ownership="none">
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index 8fd210e8..bda27bef 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -3084,6 +3084,16 @@ regress_test_gerror_callback (RegressTestCallbackGError callback)
}
/**
+ * regress_test_null_gerror_callback:
+ * @callback: (scope call):
+ **/
+void
+regress_test_null_gerror_callback (RegressTestCallbackGError callback)
+{
+ callback (NULL);
+}
+
+/**
* regress_test_owned_gerror_callback:
* @callback: (scope call):
**/
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index 9cefb05c..bebfdacb 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -573,6 +573,7 @@ RegressTestObj *regress_test_obj_new_callback (RegressTestCallbackUserData callb
GDestroyNotify notify);
void regress_test_hash_table_callback (GHashTable *data, RegressTestCallbackHashtable callback);
void regress_test_gerror_callback (RegressTestCallbackGError callback);
+void regress_test_null_gerror_callback (RegressTestCallbackGError callback);
void regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback);
typedef struct _RegressTestInterface RegressTestInterface;