[gobject-introspection] Add regress_test_null_gerror_callback



commit b9bd2026f0772bde2739cff86ab5cfb462d43f26
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Feb 5 18:54:43 2012 +0100

    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

 tests/scanner/Regress-1.0-expected.gir |   11 +++++++++++
 tests/scanner/regress.c                |   10 ++++++++++
 tests/scanner/regress.h                |    1 +
 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 fd798ff..481259c 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 8fd210e..bda27be 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 9cefb05..bebfdac 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]