diff options
author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2021-04-09 05:14:06 +0200 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2022-01-11 19:01:16 +0000 |
commit | 1482ab986e51c098c7225b31cc7126ce0ee2f1a4 (patch) | |
tree | a2aa75e6066ff84fa0bed894239037e1047b995a /tests/gimarshallingtests.c | |
parent | 6a9f1cb432c10efcce85bfdaf9e0998142b7abea (diff) | |
download | gobject-introspection-1482ab986e51c098c7225b31cc7126ce0ee2f1a4.tar.gz |
gimarshallingtests: Add some-string property to PropertiesObject
It's the only basic type missing, better to have for consistency.
Diffstat (limited to 'tests/gimarshallingtests.c')
-rw-r--r-- | tests/gimarshallingtests.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index fe265303..37960ea5 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -5524,6 +5524,7 @@ enum SOME_INT64_PROPERTY, SOME_UINT64_PROPERTY, SOME_FLOAT_PROPERTY, + SOME_STRING_PROPERTY, SOME_DOUBLE_PROPERTY, SOME_STRV_PROPERTY, SOME_BOXED_STRUCT_PROPERTY, @@ -5554,6 +5555,7 @@ gi_marshalling_tests_properties_object_finalize (GObject *obj) self->some_gvalue = NULL; } + g_clear_pointer (&self->some_string, g_free); g_clear_pointer (&self->some_strv, g_strfreev); g_clear_pointer (&self->some_boxed_struct, gi_marshalling_tests_boxed_struct_free); g_clear_pointer (&self->some_variant, g_variant_unref); @@ -5604,6 +5606,9 @@ gi_marshalling_tests_properties_object_get_property (GObject *object, case SOME_DOUBLE_PROPERTY: g_value_set_double (value, self->some_double); break; + case SOME_STRING_PROPERTY: + g_value_set_string (value, self->some_string); + break; case SOME_STRV_PROPERTY: g_value_set_boxed (value, self->some_strv); break; @@ -5681,6 +5686,10 @@ gi_marshalling_tests_properties_object_set_property (GObject *object, case SOME_DOUBLE_PROPERTY: self->some_double = g_value_get_double (value); break; + case SOME_STRING_PROPERTY: + g_clear_pointer (&self->some_string, g_free); + self->some_string = g_value_dup_string (value); + break; case SOME_STRV_PROPERTY: g_strfreev (self->some_strv); self->some_strv = g_strdupv (g_value_get_boxed (value)); @@ -5813,6 +5822,13 @@ static void gi_marshalling_tests_properties_object_class_init (GIMarshallingTest G_MAXDOUBLE, 0, G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + g_object_class_install_property (object_class, SOME_STRING_PROPERTY, + g_param_spec_string ("some-string", + "some-string", + "some-string", + NULL, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + g_object_class_install_property (object_class, SOME_STRV_PROPERTY, g_param_spec_boxed ("some-strv", "some-strv", |