[gobject-introspection] Add two tests in Everything regarding multiple output arguments



commit f88185674fbac1cea33855e7e7760021e51eecab
Author: Simon van der Linden <svdlinden src gnome org>
Date:   Wed Jun 24 17:01:21 2009 +0200

    Add two tests in Everything regarding multiple output arguments
    
    Add test_utf8_out_out and test_utf8_out_nonconst_return in Everything to
    test the return of more than one value in a tuple in dynamic bindings.
    
    http://bugzilla.gnome.org/show_bug.cgi?id=585368

 gir/everything.c |   29 +++++++++++++++++++++++++++++
 gir/everything.h |    4 ++++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/gir/everything.c b/gir/everything.c
index 5e5bed8..674a0c2 100644
--- a/gir/everything.c
+++ b/gir/everything.c
@@ -257,6 +257,35 @@ GSList *test_filename_return (void)
   return filenames;
 }
 
+
+/* multiple output arguments */
+
+/**
+ * test_utf8_out_out:
+ * @out0: (out) (transfer full): a copy of "first"
+ * @out1: (out) (transfer full): a copy of "second"
+ */
+void
+test_utf8_out_out (char **out0, char **out1)
+{
+  *out0 = g_strdup ("first");
+  *out1 = g_strdup ("second");
+}
+
+/**
+ * test_utf8_out_nonconst_return:
+ * @out: (out) (transfer full): a copy of "second"
+ *
+ * Returns: (transfer full): a copy of "first"
+ */
+char *
+test_utf8_out_nonconst_return (char **out)
+{
+  *out = g_strdup ("second");
+  return g_strdup ("first");
+}
+
+
 /* non-basic-types */
 
 static const char *test_sequence[] = {"1", "2", "3"};
diff --git a/gir/everything.h b/gir/everything.h
index 88f91f2..a7d2322 100644
--- a/gir/everything.h
+++ b/gir/everything.h
@@ -36,6 +36,10 @@ void test_utf8_out (char **out);
 void test_utf8_inout (char **inout);
 GSList *test_filename_return (void);
 
+/* multiple output arguments */
+void test_utf8_out_out (char **out0, char **out1);
+char *test_utf8_out_nonconst_return (char **out);
+
 /* non-basic-types */
 /* array */
 gboolean test_strv_in (char **arr);



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