[gobject-introspection] Add tests for nullable string as input/return value



commit a023c679746696de021a4740874f6866cc120692
Author: Simon van der Linden <svdlinden src gnome org>
Date:   Thu Jul 23 11:15:48 2009 +0200

    Add tests for nullable string as input/return value
    
    Add test_utf8_null_return and test_utf8_null_in in Everything.

 gir/Everything-1.0-expected.gir |   16 ++++++++++++++++
 gir/everything.c                |   18 ++++++++++++++++++
 gir/everything.h                |    2 ++
 3 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/gir/Everything-1.0-expected.gir b/gir/Everything-1.0-expected.gir
index 4dbc0f2..7eb0319 100644
--- a/gir/Everything-1.0-expected.gir
+++ b/gir/Everything-1.0-expected.gir
@@ -1435,6 +1435,22 @@ call and can be released on return.">
         <type name="utf8" c:type="char*"/>
       </return-value>
     </function>
+    <function name="test_utf8_null_in" c:identifier="test_utf8_null_in">
+      <return-value transfer-ownership="none">
+        <type name="none" c:type="void"/>
+      </return-value>
+      <parameters>
+        <parameter name="in" transfer-ownership="full">
+          <type name="utf8" c:type="char*"/>
+        </parameter>
+      </parameters>
+    </function>
+    <function name="test_utf8_null_return"
+              c:identifier="test_utf8_null_return">
+      <return-value transfer-ownership="full">
+        <type name="utf8" c:type="char*"/>
+      </return-value>
+    </function>
     <function name="test_utf8_out" c:identifier="test_utf8_out">
       <return-value transfer-ownership="none">
         <type name="none" c:type="void"/>
diff --git a/gir/everything.c b/gir/everything.c
index 9153560..16c3edb 100644
--- a/gir/everything.c
+++ b/gir/everything.c
@@ -209,6 +209,15 @@ char *test_utf8_nonconst_return (void)
   return g_strdup (utf8_nonconst);
 }
 
+/**
+ * test_utf8_null_return:
+ * Return value: (null-ok): NULL
+ */
+char *test_utf8_null_return (void)
+{
+  return NULL;
+}
+
 void test_utf8_nonconst_in (char *in)
 {
   /* transfer mode full */
@@ -223,6 +232,15 @@ void test_utf8_const_in (const char *in)
 }
 
 /**
+ * test_utf8_null_in:
+ * @in: (null-ok): NULL
+ */
+void test_utf8_null_in (char *in)
+{
+  g_assert (in == NULL);
+}
+
+/**
  * test_utf8_out:
  * @out: (out) (transfer full):
  */
diff --git a/gir/everything.h b/gir/everything.h
index 436c74c..b7dbca0 100644
--- a/gir/everything.h
+++ b/gir/everything.h
@@ -30,8 +30,10 @@ GType test_gtype (GType in);
 /* utf8 */
 G_CONST_RETURN char *test_utf8_const_return (void);
 char *test_utf8_nonconst_return (void);
+char *test_utf8_null_return (void);
 void test_utf8_nonconst_in (char *in);
 void test_utf8_const_in (const char *in);
+void test_utf8_null_in (char *in);
 void test_utf8_out (char **out);
 void test_utf8_inout (char **inout);
 GSList *test_filename_return (void);



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