diff options
author | Colin Walters <walters@verbum.org> | 2009-06-04 12:40:41 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2009-06-08 14:30:14 -0400 |
commit | 4a5c6543195963d9a09843d9b015dd9db3107798 (patch) | |
tree | 885a0bce9cbe72e9a0779e582455bc4764cafc86 | |
parent | 317c1df1f152312dd87b6a7e51fe012607e1f05f (diff) | |
download | gobject-introspection-4a5c6543195963d9a09843d9b015dd9db3107798.tar.gz |
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.
-rw-r--r-- | gir/everything.c | 20 | ||||
-rw-r--r-- | gir/everything.h | 1 |
2 files changed, 19 insertions, 2 deletions
diff --git a/gir/everything.c b/gir/everything.c index e5923994..341f8493 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 a4120dc2..583ccda9 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); |