From 784b60e85561a3b4a98e33df159a77ae2daef1c7 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 1 Jun 2012 12:01:53 +0200 Subject: tests: Add marshalling test for a caller-allocated out GValue parameter This came up as a side issue in https://bugzilla.gnome.org/show_bug.cgi?id=653151 --- tests/gimarshallingtests.c | 11 +++++++++++ tests/gimarshallingtests.h | 1 + 2 files changed, 12 insertions(+) diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index cf54d5e3..9d58e260 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -2983,6 +2983,17 @@ gi_marshalling_tests_gvalue_out (GValue **value) *value = new_value; } +/** + * gi_marshalling_tests_gvalue_out_caller_allocates: + * @value: (out) (transfer none): + */ +void +gi_marshalling_tests_gvalue_out_caller_allocates (GValue *value) +{ + g_value_init(value, G_TYPE_INT); + g_value_set_int(value, 42); +} + /** * gi_marshalling_tests_gvalue_inout: * @value: (inout) (transfer none): diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h index ba688a92..2c022c6d 100644 --- a/tests/gimarshallingtests.h +++ b/tests/gimarshallingtests.h @@ -533,6 +533,7 @@ void gi_marshalling_tests_gvalue_in_with_type (GValue *value, GType type); void gi_marshalling_tests_gvalue_in_enum (GValue *value); void gi_marshalling_tests_gvalue_out (GValue **value); +void gi_marshalling_tests_gvalue_out_caller_allocates (GValue *value); void gi_marshalling_tests_gvalue_inout (GValue **value); -- cgit v1.2.1