diff -r 7b54f6fa1e6a -r 06521648500e libpurple/tests/test_notification_manager.c --- a/libpurple/tests/test_notification_manager.c Mon Oct 14 20:34:15 2024 -0500 +++ b/libpurple/tests/test_notification_manager.c Mon Oct 14 22:54:33 2024 -0500 @@ -240,10 +240,10 @@ static void test_purple_notification_manager_remove_with_account_all(void) { - PurpleConnectionErrorInfo *info = NULL; + PurpleAccount *account = NULL; PurpleNotificationManager *manager = NULL; PurpleNotification *notification = NULL; - PurpleAccount *account = NULL; + GError *error = NULL; GListModel *model = NULL; /* This test will add 3 notifications to the notification manager for the @@ -282,11 +282,11 @@ g_clear_object(¬ification); /* Add a connection error notification with the account. */ - info = purple_connection_error_info_new(PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - "the network is borked."); - notification = purple_notification_connection_error_new(NULL, account, - info); - purple_connection_error_info_free(info); + error = g_error_new_literal(PURPLE_CONNECTION_ERROR, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, + "the network is borked."); + purple_account_set_error(account, error); + notification = purple_notification_connection_error_new(NULL, account); purple_notification_manager_add(manager, notification); g_clear_object(¬ification); @@ -321,6 +321,12 @@ purple_notification_manager_clear(manager); g_assert_cmpuint(g_list_model_get_n_items(model), ==, 0); + /* We have a reference cycle between the account and its error + * notification. The dispose method does not get called in this case. So to + * break the stalemate, we just set the error to NULL. + */ + purple_account_set_error(account, NULL); + g_assert_finalize_object(manager); g_assert_finalize_object(account); }