libpurple/tests/test_notification_manager.c

changeset 42985
66ad6fc11879
parent 42962
a2c1926ce7b2
child 42988
c2357ee36551
--- a/libpurple/tests/test_notification_manager.c	Fri Sep 27 02:21:36 2024 -0500
+++ b/libpurple/tests/test_notification_manager.c	Tue Oct 01 01:15:31 2024 -0500
@@ -284,7 +284,8 @@
 	/* 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_new_from_connection_error(account, info);
+	notification = purple_notification_connection_error_new(NULL, account,
+	                                                        info);
 	purple_connection_error_info_free(info);
 	purple_notification_manager_add(manager, notification);
 	g_clear_object(&notification);
@@ -301,27 +302,24 @@
 	g_clear_object(&notification);
 
 	/* Verify that we have all of the notifications in the manager. */
-	g_assert_cmpuint(4, ==, g_list_model_get_n_items(model));
+	g_assert_cmpuint(g_list_model_get_n_items(model), ==, 4);
 
 	/* Remove the transient notifications for the account. */
 	purple_notification_manager_remove_with_account(manager, account, FALSE);
-	g_assert_cmpuint(2, ==, g_list_model_get_n_items(model));
+	g_assert_cmpuint(g_list_model_get_n_items(model), ==, 2);
 
 	/* Make sure that the second item is the connection error. */
 	notification = g_list_model_get_item(G_LIST_MODEL(model), 1);
-	G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-	g_assert_cmpint(purple_notification_get_notification_type(notification),
-	                ==, PURPLE_NOTIFICATION_TYPE_CONNECTION_ERROR);
-	G_GNUC_END_IGNORE_DEPRECATIONS
+	g_assert_true(PURPLE_IS_NOTIFICATION_CONNECTION_ERROR(notification));
 	g_clear_object(&notification);
 
 	/* Remove the non-transient notifications for the account. */
 	purple_notification_manager_remove_with_account(manager, account, TRUE);
-	g_assert_cmpuint(1, ==, g_list_model_get_n_items(model));
+	g_assert_cmpuint(g_list_model_get_n_items(model), ==, 1);
 
 	/* Remove the generic notification that's not tied to an account. */
 	purple_notification_manager_clear(manager);
-	g_assert_cmpuint(0, ==, g_list_model_get_n_items(model));
+	g_assert_cmpuint(g_list_model_get_n_items(model), ==, 0);
 
 	g_assert_finalize_object(manager);
 	g_assert_finalize_object(account);

mercurial