glib/gobject/tests
Philip Withnall d951db4236 gobject: Add g_set_object() convenience function to set GObject pointers
Along the same lines as g_clear_object(), g_set_object() is a
convenience function to update a GObject pointer, handling reference
counting transparently and correctly.

Specifically, it handles the case where a pointer is set to its current
value. If handled naïvely, that could result in the object instance
being finalised. In the following code, that happens when
(my_obj == new_value) and the object has a single reference:
    g_clear_object (&my_obj);
    my_obj = g_object_ref (new_value);

It also simplifies boilerplate code such as set_property()
implementations, which are otherwise long and boring.

Test cases included.

https://bugzilla.gnome.org/show_bug.cgi?id=741589
2014-12-18 11:32:56 +00:00
..
.gitignore gobject: forbid finalization-during-construction 2013-10-22 11:01:15 -04:00
binding.c gbinding: warn on failed value transformation 2014-03-17 17:43:19 -04:00
boxed.c boxed: Fix double free in boxed unit tests 2013-11-11 07:20:09 +01:00
closure.c Fix the closure test in continuous 2014-05-30 10:22:35 -04:00
dynamictests.c Remove g_type_init() calls 2012-10-16 09:39:24 -04:00
enums.c enums: Fix leaks in tests 2013-11-11 07:25:53 +01:00
ifaceproperties.c Updated FSF's address 2014-01-31 14:31:55 +01:00
Makefile.am gobject: forbid finalization-during-construction 2013-10-22 11:01:15 -04:00
marshalers.list Add more tests for signal emissions 2012-03-02 17:13:04 +01:00
object.c gobject: re-allow finalization from constructor() 2014-02-15 10:20:53 -05:00
param.c tests: move /param/implement to -m slow 2013-11-27 10:17:15 -05:00
private.c Improve GType test coverage 2013-11-28 21:58:48 -05:00
properties.c test: add test for explicit-notify properties 2014-06-06 10:25:48 -04:00
qdata.c qdata: Fix leak in qdata unit tests 2013-11-06 10:14:30 +01:00
reference.c gobject: Add g_set_object() convenience function to set GObject pointers 2014-12-18 11:32:56 +00:00
signals.c Add a test for g_signal_get_invocation_hint 2013-11-23 20:06:07 -05:00
testcommon.h Updated FSF's address 2014-01-31 14:31:55 +01:00
threadtests.c threadtests: Fix leaks in tests 2013-11-11 07:26:04 +01:00
type.c Improve test coverage in gobject/ 2013-05-29 08:37:08 -04:00
valuearray.c Remove g_type_init() calls 2012-10-16 09:39:24 -04:00