diff options
author | Simon van der Linden <svdlinden@src.gnome.org> | 2009-06-24 17:01:21 +0200 |
---|---|---|
committer | Simon van der Linden <svdlinden@src.gnome.org> | 2009-06-24 17:07:43 +0200 |
commit | f88185674fbac1cea33855e7e7760021e51eecab (patch) | |
tree | d167b23ce74e1f48befb8e3c26f3c842db7f8a8b /gir | |
parent | 8ef942ed56236380cbc9acc445926bfa534cc58a (diff) | |
download | gobject-introspection-f88185674fbac1cea33855e7e7760021e51eecab.tar.gz |
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
Diffstat (limited to 'gir')
-rw-r--r-- | gir/everything.c | 29 | ||||
-rw-r--r-- | gir/everything.h | 4 |
2 files changed, 33 insertions, 0 deletions
diff --git a/gir/everything.c b/gir/everything.c index 5e5bed80..674a0c22 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 88f91f26..a7d23221 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); |