mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
tests: Use g_object_assert_last_unref() in various tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
b76bf3ca72
commit
b6d4da7684
@ -77,7 +77,6 @@ test_store_boundaries (void)
|
||||
store = g_list_store_new (G_TYPE_MENU_ITEM);
|
||||
|
||||
item = g_menu_item_new (NULL, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (item), (gpointer *) &item);
|
||||
|
||||
/* remove an item from an empty list */
|
||||
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, "*g_sequence*");
|
||||
@ -123,8 +122,7 @@ test_store_boundaries (void)
|
||||
g_assert_cmpuint (g_list_model_get_n_items (G_LIST_MODEL (store)), ==, 1);
|
||||
|
||||
g_object_unref (store);
|
||||
g_object_unref (item);
|
||||
g_assert_null (item);
|
||||
g_assert_finalize_object (item);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -673,18 +673,10 @@ static void
|
||||
teardown_without_loop (Test *test,
|
||||
gconstpointer unused)
|
||||
{
|
||||
gpointer weak_pointer = test->interaction;
|
||||
|
||||
g_object_add_weak_pointer (weak_pointer, &weak_pointer);
|
||||
|
||||
g_object_unref (test->connection);
|
||||
|
||||
g_object_unref (test->password);
|
||||
|
||||
g_object_unref (test->interaction);
|
||||
|
||||
g_assert (weak_pointer == NULL);
|
||||
|
||||
g_assert_finalize_object (test->interaction);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
Loading…
Reference in New Issue
Block a user