tests: Add marshalling test for a caller-allocated out GValue parameter
authorMartin Pitt <martinpitt@gnome.org>
Fri, 1 Jun 2012 10:01:53 +0000 (12:01 +0200)
committerMartin Pitt <martinpitt@gnome.org>
Fri, 1 Jun 2012 10:01:53 +0000 (12:01 +0200)
This came up as a side issue in
https://bugzilla.gnome.org/show_bug.cgi?id=653151

tests/gimarshallingtests.c
tests/gimarshallingtests.h

index cf54d5e..9d58e26 100644 (file)
@@ -2984,6 +2984,17 @@ gi_marshalling_tests_gvalue_out (GValue **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):
  */
index ba688a9..2c022c6 100644 (file)
@@ -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);