Commit Graph

12 Commits

Author SHA1 Message Date
Emmanuele Bassi
56a56f1ee5 Allow calling get_property() with an uninitialized GValue
We already have the GType with which the GValue should be initialized,
so requiring an initialized GValue is not really necessary, and it
actually complicates code that wraps GObject, by requiring the retrieval
of the GParamSpec in order to get the property type. Additionally, it
introduces a mostly unnecessary g_value_reset().

We already changed g_object_getv() to allow passing uninitialized
GValues, but this fell through the cracks.

Closes: #737
2019-06-04 20:05:24 +01:00
Philip Withnall
ffb1c3cb74 tests: Various minor leak fixes in the GObject tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-29 12:13:32 +01:00
Emmanuele Bassi
f952fdf3fc Drop trailing semi-colon from G_DEFINE_ macro
It's unnecessary, and only adds visual noise; we have been fairly
inconsistent in the past, but the semi-colon-less version clearly
dominates in the code base.

https://bugzilla.gnome.org/show_bug.cgi?id=669355
2017-04-10 10:38:31 +01:00
Fabian Orccon
942edbc700 tests: Add test for gobject properties for g_object_newv/setv/getv
https://bugzilla.gnome.org/show_bug.cgi?id=709865
2017-03-31 11:00:23 +01:00
Ryan Lortie
0208861a13 test: add test for explicit-notify properties
https://bugzilla.gnome.org/show_bug.cgi?id=731200
2014-06-06 10:25:48 -04:00
Matthias Clasen
f16045c9cf Add a test for notify emission ordering
This tests the ordering that was just documented.
See

https://bugzilla.gnome.org/show_bug.cgi?id=607016
2013-11-23 16:58:51 -05:00
Nick Schermer
4b334ef8f1 gobject: Handle ref_count==0 in notify_by_pspec
Just like g_object_notify, check for a zero ref_count in
g_object_notify_by_pspec and leave if it is 0.

This allows using functions in ->finalize() that possibly also
notify a property change on the object.  Previously,
this resulted in an error from g_object_ref.

https://bugzilla.gnome.org/show_bug.cgi?id=705570
2013-08-14 18:11:05 +01:00
Ryan Lortie
1dc774a653 Remove g_type_init() calls
Very many testcases, some GLib tools (resource compiler, etc) and
GApplication were calling g_type_init().

Remove those uses, as they are no longer required.

https://bugzilla.gnome.org/show_bug.cgi?id=686161
2012-10-16 09:39:24 -04:00
Matthias Clasen
8b618eb7f1 Improve test coverage in gobject/tests
This is just making sure that we execute property getters/setters.
2012-04-23 08:20:21 -04:00
Ryan Lortie
38e8ecd62a more 'static' adding in testcases
No dead code found this time...
2011-10-16 21:41:15 -04:00
Jonas Holmberg
dec8323b4b gobject: added property test
Added test for setting properties with g_object_new.
2010-11-28 18:27:47 -05:00
Emmanuele Bassi
9cd43d7a4c gobject: Add install_properties()
Since we added g_object_notify_by_pspec(), an efficient way to install
and notify properties relies on storing the GParamSpec pointers inside
a static arrays, like we do for signal identifiers.

Instead of multiple calls to g_object_class_install_property(), we
should have a single function to take the static array of GParamSpecs
and iterate it.

https://bugzilla.gnome.org/show_bug.cgi?id=626919

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-13 12:34:53 +01:00