From 049c7fd7cf1faaf1ddcd6ed5445dfaceefe70295 Mon Sep 17 00:00:00 2001 From: Simon Feltman Date: Tue, 2 Jul 2013 19:13:53 -0700 Subject: gimarshallingtests: Add test for GValue pass-by-reference https://bugzilla.gnome.org/show_bug.cgi?id=701058 --- tests/gimarshallingtests.c | 14 ++++++++++++++ tests/gimarshallingtests.h | 1 + 2 files changed, 15 insertions(+) diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 1998161b..7d392544 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -3137,6 +3137,20 @@ gi_marshalling_tests_gvalue_in_with_type (GValue *value, GType type) g_assert (g_type_is_a (G_VALUE_TYPE (value), type)); } +/** + * gi_marshalling_tests_gvalue_in_with_modification: + * @value: (transfer none): + * + * Expects a GValue passed by reference which is then modified by + * this function. + */ +void +gi_marshalling_tests_gvalue_in_with_modification (GValue *value) +{ + g_assert_cmpint (g_value_get_int (value), ==, 42); + g_value_set_int (value, 24); +} + /** * gi_marshalling_tests_gvalue_in_enum: * @value: (transfer none): diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h index 33f3b3e9..3b436f0c 100644 --- a/tests/gimarshallingtests.h +++ b/tests/gimarshallingtests.h @@ -545,6 +545,7 @@ GValue *gi_marshalling_tests_gvalue_return (void); void gi_marshalling_tests_gvalue_in (GValue *value); void gi_marshalling_tests_gvalue_int64_in (GValue *value); void gi_marshalling_tests_gvalue_in_with_type (GValue *value, GType type); +void gi_marshalling_tests_gvalue_in_with_modification (GValue *value); void gi_marshalling_tests_gvalue_in_enum (GValue *value); -- cgit v1.2.1