mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
gobject/tests: Don't unref a floating object reference by mistake
This goes undiagnosed under normal circumstances, but is a critical warning (which is fatal by default) under G_ENABLE_DIAGNOSTIC. This is a programming error, so we should only exercise it under g_test_undefined(), and only in a test that is intentionally doing this (as in the previous commit). Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
0bba27eea9
commit
7254fd7aa3
@ -185,7 +185,7 @@ test_interface_check (void)
|
||||
|
||||
check_called = 0;
|
||||
g_type_add_interface_check (&check_called, check_func);
|
||||
o = g_object_new (bazo_get_type (), NULL);
|
||||
o = g_object_ref_sink (g_object_new (bazo_get_type (), NULL));
|
||||
g_object_unref (o);
|
||||
g_assert_cmpint (check_called, ==, 1);
|
||||
g_type_remove_interface_check (&check_called, check_func);
|
||||
|
Loading…
Reference in New Issue
Block a user