[gobject-introspection] regress: Add a test for (nullable)



commit 175942eb307e552e17d3f55174fb508ff42f880d
Author: Colin Walters <walters verbum org>
Date:   Thu Sep 3 10:30:44 2015 -0400

    regress: Add a test for (nullable)
    
    Related to: https://bugzilla.gnome.org/719966

 .../Regress.func_obj_nullable_in.page              |   38 ++++++++++++++++++++
 .../Regress.func_obj_nullable_in.page              |   36 ++++++++++++++++++
 .../Regress.func_obj_nullable_in.page              |   37 +++++++++++++++++++
 tests/scanner/Regress-1.0-expected.gir             |   15 ++++++++
 tests/scanner/Regress-1.0-sections-expected.txt    |    1 +
 tests/scanner/regress.c                            |    9 +++++
 tests/scanner/regress.h                            |    2 +
 7 files changed, 138 insertions(+), 0 deletions(-)
---
diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.func_obj_nullable_in.page 
b/tests/scanner/Regress-1.0-C-expected/Regress.func_obj_nullable_in.page
new file mode 100644
index 0000000..6294367
--- /dev/null
+++ b/tests/scanner/Regress-1.0-C-expected/Regress.func_obj_nullable_in.page
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<page id="Regress.func_obj_nullable_in"
+      type="topic"
+      style="function"
+      xmlns="http://projectmallard.org/1.0/";
+      xmlns:api="http://projectmallard.org/experimental/api/";
+      xmlns:ui="http://projectmallard.org/1.0/ui/";>
+  <info>
+    <link xref="index" group="function" type="guide"/>
+    <api:function>
+      <api:returns>
+        <api:type>void</api:type>
+      </api:returns>
+      <api:name>regress_func_obj_nullable_in</api:name>
+      <api:arg>
+        <api:type>RegressTestObj*</api:type>
+        <api:name>obj</api:name>
+      </api:arg>
+    </api:function>
+  </info>
+  <title>regress_func_obj_nullable_in</title>
+  <synopsis><code mime="text/x-csrc">
+void regress_func_obj_nullable_in (RegressTestObj* obj);
+  </code></synopsis>
+
+
+<terms>
+<item>
+<title><code>obj</code></title>
+  <p>A <link xref="Regress.TestObj"/></p>
+</item>
+<item>
+<title><code>Returns</code></title>
+
+</item>
+</terms>
+
+</page>
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.func_obj_nullable_in.page 
b/tests/scanner/Regress-1.0-Gjs-expected/Regress.func_obj_nullable_in.page
new file mode 100644
index 0000000..cee2cb8
--- /dev/null
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.func_obj_nullable_in.page
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<page id="Regress.func_obj_nullable_in"
+      type="topic"
+      style="function"
+      xmlns="http://projectmallard.org/1.0/";
+      xmlns:api="http://projectmallard.org/experimental/api/";
+      xmlns:ui="http://projectmallard.org/1.0/ui/";>
+  <info>
+    <link xref="index" group="function" type="guide"/>
+    <api:function>
+      <api:returns>
+        <api:type>void</api:type>
+      </api:returns>
+      <api:name>regress_func_obj_nullable_in</api:name>
+      <api:arg>
+        <api:type>Regress.TestObj</api:type>
+        <api:name>obj</api:name>
+      </api:arg>
+    </api:function>
+  </info>
+  <title>Regress.func_obj_nullable_in</title>
+  <synopsis><code mime="text/x-gjs">
+function func_obj_nullable_in(obj: <link xref="Regress.TestObj">Regress.TestObj</link>): void {
+    // Gjs wrapper for regress_func_obj_nullable_in()
+}
+  </code></synopsis>
+
+
+<terms>
+<item>
+<title><code>obj</code></title>
+  <p>A <link xref="Regress.TestObj"/></p>
+</item>
+</terms>
+
+</page>
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.func_obj_nullable_in.page 
b/tests/scanner/Regress-1.0-Python-expected/Regress.func_obj_nullable_in.page
new file mode 100644
index 0000000..e60459c
--- /dev/null
+++ b/tests/scanner/Regress-1.0-Python-expected/Regress.func_obj_nullable_in.page
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<page id="Regress.func_obj_nullable_in"
+      type="topic"
+      style="function"
+      xmlns="http://projectmallard.org/1.0/";
+      xmlns:api="http://projectmallard.org/experimental/api/";
+      xmlns:ui="http://projectmallard.org/1.0/ui/";>
+  <info>
+    <link xref="index" group="function" type="guide"/>
+    <api:function>
+      <api:returns>
+        <api:type>none</api:type>
+      </api:returns>
+      <api:name>regress_func_obj_nullable_in</api:name>
+      <api:arg>
+        <api:type>Regress.TestObj</api:type>
+        <api:name>obj</api:name>
+      </api:arg>
+    </api:function>
+  </info>
+  <title>Regress.func_obj_nullable_in</title>
+  <synopsis><code mime="text/x-python">
+ accepts(Regress.TestObj)
+ returns(none)
+def func_obj_nullable_in(obj):
+    # Python wrapper for regress_func_obj_nullable_in()
+  </code></synopsis>
+
+
+<terms>
+<item>
+<title><code>obj</code></title>
+  <p>A <link xref="Regress.TestObj"/></p>
+</item>
+</terms>
+
+</page>
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index e8e497a..aeb3fdb 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -4761,6 +4761,21 @@ exposed to language bindings.</doc>
         </parameter>
       </parameters>
     </function>
+    <function name="func_obj_nullable_in"
+              c:identifier="regress_func_obj_nullable_in">
+      <return-value transfer-ownership="none">
+        <type name="none" c:type="void"/>
+      </return-value>
+      <parameters>
+        <parameter name="obj"
+                   transfer-ownership="none"
+                   nullable="1"
+                   allow-none="1">
+          <doc xml:space="preserve">A #RegressTestObj</doc>
+          <type name="TestObj" c:type="RegressTestObj*"/>
+        </parameter>
+      </parameters>
+    </function>
     <function name="global_get_flags_out"
               c:identifier="regress_global_get_flags_out">
       <return-value transfer-ownership="none">
diff --git a/tests/scanner/Regress-1.0-sections-expected.txt b/tests/scanner/Regress-1.0-sections-expected.txt
index f2286e3..665c7be 100644
--- a/tests/scanner/Regress-1.0-sections-expected.txt
+++ b/tests/scanner/Regress-1.0-sections-expected.txt
@@ -46,6 +46,7 @@ regress_foo_test_varargs_callback
 regress_foo_test_varargs_callback2
 regress_foo_test_varargs_callback3
 regress_func_obj_null_in
+regress_func_obj_nullable_in
 regress_global_get_flags_out
 regress_has_parameter_named_attrs
 regress_introspectable_via_alias
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index 021a17a..626b132 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -3002,6 +3002,15 @@ regress_test_obj_null_out (RegressTestObj **obj)
 }
 
 /**
+ * regress_func_obj_nullable_in:
+ * @obj: (nullable): A #RegressTestObj
+ */
+void
+regress_func_obj_nullable_in (RegressTestObj *obj)
+{
+}
+
+/**
  * regress_test_array_fixed_out_objects:
  * @objs: (out) (array fixed-size=2) (transfer full): An array of #RegressTestObj
  */
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index 9df558b..a06a236 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -918,6 +918,8 @@ void regress_func_obj_null_in (RegressTestObj *obj);
 _GI_TEST_EXTERN
 void regress_test_obj_null_out (RegressTestObj **obj);
 
+void regress_func_obj_nullable_in (RegressTestObj *obj);
+
 /* inheritance */
 #define REGRESS_TEST_TYPE_SUB_OBJ           (regress_test_sub_obj_get_type ())
 #define REGRESS_TEST_SUB_OBJECT(object)     (G_TYPE_CHECK_INSTANCE_CAST ((object), 
REGRESS_TEST_TYPE_SUB_OBJ, RegressTestSubObj))


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