[gobject-introspection] Add a test_strv_out which is unannotated, rename current to test_strv_out_container



commit 4a5c6543195963d9a09843d9b015dd9db3107798
Author: Colin Walters <walters verbum org>
Date:   Thu Jun 4 12:40:41 2009 -0400

    Add a test_strv_out which is unannotated, rename current to test_strv_out_container
    
    We need a test case for a plain unannotated char ** return value, which
    should be an array.
    
    Keep the old annotated test as a test case for the container transfer.
---
 gir/everything.c |   20 ++++++++++++++++++--
 gir/everything.h |    1 +
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/gir/everything.c b/gir/everything.c
index e592399..341f849 100644
--- a/gir/everything.c
+++ b/gir/everything.c
@@ -377,13 +377,29 @@ test_array_gtype_in (int n_types, GType *types)
   return g_string_free (string, FALSE);
 }
 
+char **
+test_strv_out (void)
+{
+  int i = 0;
+  int n = 6;
+  char **ret = g_new (char *, n);
+  ret[i++] = g_strdup ("thanks");
+  ret[i++] = g_strdup ("for");
+  ret[i++] = g_strdup ("all");
+  ret[i++] = g_strdup ("the");
+  ret[i++] = g_strdup ("fish");
+  ret[i++] = NULL;
+  g_assert (i == n);
+  return ret;
+}
+
 /**
- * test_strv_out:
+ * test_strv_out_container:
  *
  * Return value: (array zero-terminated=1) (transfer container):
  */
 char **
-test_strv_out (void)
+test_strv_out_container (void)
 {
   char **ret = g_new (char *, 4);
   ret[0] = "1";
diff --git a/gir/everything.h b/gir/everything.h
index a4120dc..583ccda 100644
--- a/gir/everything.h
+++ b/gir/everything.h
@@ -43,6 +43,7 @@ int test_array_gint16_in (int n_ints, gint16 *ints);
 gint32 test_array_gint32_in (int n_ints, gint32 *ints);
 gint64 test_array_gint64_in (int n_ints, gint64 *ints);
 char *test_array_gtype_in (int n_types, GType *types);
+char **test_strv_out_container (void);
 char **test_strv_out (void);
 void   test_strv_outarg (char ***retp);
 



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