Add a test_strv_out which is unannotated, rename current to test_strv_out_container
authorColin Walters <walters@verbum.org>
Thu, 4 Jun 2009 16:40:41 +0000 (12:40 -0400)
committerColin Walters <walters@verbum.org>
Mon, 8 Jun 2009 18:30:14 +0000 (14:30 -0400)
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
gir/everything.h

index e592399..341f849 100644 (file)
@@ -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";
index a4120dc..583ccda 100644 (file)
@@ -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);