summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVadim Rutkovsky <vrutkovs@redhat.com>2013-01-11 12:17:53 +0100
committerMartin Pitt <martinpitt@gnome.org>2013-01-11 15:31:15 +0100
commit63c9759e17ef5ac71c50d5ac91289714db19b587 (patch)
tree49db9a08bc50c7a535110d1e3e54d08bf3e6a0ff /tests
parentee36c78b0c11763a69203e8ef14d74543698473a (diff)
downloadgobject-introspection-63c9759e17ef5ac71c50d5ac91289714db19b587.tar.gz
gimarshallingtests: Add string_ to boxed structure
Co-Authored-By: Martin Pitt <martinpitt@gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=678401
Diffstat (limited to 'tests')
-rw-r--r--tests/gimarshallingtests.c6
-rw-r--r--tests/gimarshallingtests.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index d4b6cb30..f12ea05e 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -3645,6 +3645,7 @@ gi_marshalling_tests_boxed_struct_copy (GIMarshallingTestsBoxedStruct *struct_)
new_struct = g_slice_new (GIMarshallingTestsBoxedStruct);
*new_struct = *struct_;
+ new_struct->string_ = g_strdup (struct_->string_);
return new_struct;
}
@@ -3652,8 +3653,10 @@ gi_marshalling_tests_boxed_struct_copy (GIMarshallingTestsBoxedStruct *struct_)
static void
gi_marshalling_tests_boxed_struct_free (GIMarshallingTestsBoxedStruct *struct_)
{
- if (struct_ != NULL)
+ if (struct_ != NULL) {
+ g_free (struct_->string_);
g_slice_free (GIMarshallingTestsBoxedStruct, struct_);
+ }
}
GType
@@ -3690,6 +3693,7 @@ gi_marshalling_tests_boxed_struct_returnv (void)
struct_ = g_new(GIMarshallingTestsBoxedStruct, 1);
struct_->long_ = 42;
+ struct_->string_ = g_strdup("hello");
struct_->g_strv = g_new0(gchar*, 4);
struct_->g_strv[0] = g_strdup("0");
struct_->g_strv[1] = g_strdup("1");
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index 03d165b9..6ac212e7 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -656,6 +656,7 @@ void gi_marshalling_tests_pointer_struct_inv (GIMarshallingTestsPointerStruct *s
struct _GIMarshallingTestsBoxedStruct {
glong long_;
+ gchar *string_;
GStrv g_strv;
};
@@ -968,7 +969,7 @@ typedef struct _GIMarshallingTestsInterface3Iface GIMarshallingTestsInterface3If
struct _GIMarshallingTestsInterface3Iface {
GTypeInterface base_iface;
-
+
/**
* GIMarshallingTestsInterface3::test_variant_array_in:
* @in: (in) (array length=n_in):
@@ -1080,7 +1081,7 @@ struct _GIMarshallingTestsPropertiesObject {
gfloat some_float;
gdouble some_double;
gchar **some_strv;
- GIMarshallingTestsBoxedStruct* some_boxed_struct;
+ GIMarshallingTestsBoxedStruct* some_boxed_struct;
GVariant *some_variant;
};