diff options
author | Johan Dahlin <johan@gnome.org> | 2010-06-21 19:24:46 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-06-22 09:49:31 -0300 |
commit | 0477ee7e6d5b475b6fdfaadaabbec451af61b184 (patch) | |
tree | de231199776356fc51667ae74478ac626b319714 | |
parent | 7d161b5ac2e8c7aa1d22eadb47fc2381fadd8ba1 (diff) | |
download | gobject-introspection-0477ee7e6d5b475b6fdfaadaabbec451af61b184.tar.gz |
[GIMarshallingTest] Add GByteArray test API
-rw-r--r-- | gir/GIMarshallingTests-1.0-expected.gir | 20 | ||||
-rw-r--r-- | gir/gimarshallingtests.c | 35 | ||||
-rw-r--r-- | gir/gimarshallingtests.h | 5 |
3 files changed, 60 insertions, 0 deletions
diff --git a/gir/GIMarshallingTests-1.0-expected.gir b/gir/GIMarshallingTests-1.0-expected.gir index ed4739b4..b83dbdf6 100644 --- a/gir/GIMarshallingTests-1.0-expected.gir +++ b/gir/GIMarshallingTests-1.0-expected.gir @@ -860,6 +860,26 @@ and/or use gtk-doc annotations. --> <type name="BoxedStruct" c:type="GIMarshallingTestsBoxedStruct*"/> </return-value> </function> + <function name="bytearray_full_return" + c:identifier="g_i_marshalling_tests_bytearray_full_return"> + <return-value transfer-ownership="full"> + <array name="GLib.ByteArray" c:type="GByteArray*"> + </array> + </return-value> + </function> + <function name="bytearray_none_in" + c:identifier="g_i_marshalling_tests_bytearray_none_in"> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="array_" transfer-ownership="none"> + <array name="GLib.ByteArray" c:type="GByteArray*"> + <type name="int"/> + </array> + </parameter> + </parameters> + </function> <function name="double_in" c:identifier="g_i_marshalling_tests_double_in"> <return-value transfer-ownership="none"> <type name="none" c:type="void"/> diff --git a/gir/gimarshallingtests.c b/gir/gimarshallingtests.c index ee6d91f3..da2fadec 100644 --- a/gir/gimarshallingtests.c +++ b/gir/gimarshallingtests.c @@ -1581,6 +1581,41 @@ g_i_marshalling_tests_garray_utf8_full_inout (GArray **array_) } /** + * g_i_marshalling_tests_bytearray_full_return: + * Returns: (transfer full): + */ +GByteArray * +g_i_marshalling_tests_bytearray_full_return (void) +{ + GByteArray *array = NULL; + static gchar *values[] = {"0", "1", "2", "3", NULL}; + gint i; + + array = g_byte_array_new (); + for (i = 0; values[i]; i++) { + gchar *str = g_strdup (values[i]); + g_byte_array_append (array, (const guint8*)str, 1); + } + + return array; + +} + +/** + * g_i_marshalling_tests_bytearray_none_in: + * @array_: (element-type gint) (transfer none): + */ +void +g_i_marshalling_tests_bytearray_none_in (GByteArray *array_) +{ + g_assert (array_->len == 4); + g_assert (g_array_index (array_, char, 0) == '0'); + g_assert (g_array_index (array_, char, 1) == '1'); + g_assert (g_array_index (array_, char, 2) == '2'); + g_assert (g_array_index (array_, char, 3) == '3'); +} + +/** * g_i_marshalling_tests_gstrv_return: * Returns: */ diff --git a/gir/gimarshallingtests.h b/gir/gimarshallingtests.h index 1ad5dd7e..34ae0bb4 100644 --- a/gir/gimarshallingtests.h +++ b/gir/gimarshallingtests.h @@ -316,6 +316,11 @@ void g_i_marshalling_tests_garray_utf8_none_inout (GArray **array_); void g_i_marshalling_tests_garray_utf8_container_inout (GArray **array_); void g_i_marshalling_tests_garray_utf8_full_inout (GArray **array_); +/* GByteArray */ + +GByteArray *g_i_marshalling_tests_bytearray_full_return (void); +void g_i_marshalling_tests_bytearray_none_in (GByteArray* array_); + /* GStrv */ GStrv g_i_marshalling_tests_gstrv_return (void); |