libpurple/tests/test_contact_manager.c

changeset 42689
d921cd91924f
parent 42583
8a8c571eb98c
child 42866
4b201e18638f
--- a/libpurple/tests/test_contact_manager.c	Thu Apr 11 20:34:07 2024 -0500
+++ b/libpurple/tests/test_contact_manager.c	Thu Apr 11 20:55:27 2024 -0500
@@ -262,95 +262,6 @@
 	g_clear_object(&manager);
 }
 
-static void
-test_purple_contact_manager_add_buddy(void) {
-	PurpleAccount *account = NULL;
-	PurpleBuddy *buddy = NULL;
-	PurpleContact *contact = NULL;
-	PurpleContactInfo *info = NULL;
-	PurpleContactManager *manager = NULL;
-	PurpleStatusType *type = NULL;
-	GList *statuses = NULL;
-	const gchar *id = NULL;
-	const gchar *source = NULL;
-	const gchar *destination = NULL;
-
-	manager = purple_contact_manager_get_default();
-
-	/* Create our account and add the statuses for testing. */
-	account = purple_account_new("test", "test");
-
-	type = purple_status_type_new(PURPLE_STATUS_OFFLINE, "offline",
-	                              "offline", TRUE);
-	statuses = g_list_append(statuses, type);
-
-	purple_account_set_status_types(account, statuses);
-
-	/* purple_buddy_new will call purple_contact_manager_add_buddy. */
-	buddy = purple_buddy_new(account, "buddy-name", "buddy-alias");
-
-	/* Verify that we can find the created contact via id. */
-	id = purple_buddy_get_id(buddy);
-	contact = purple_contact_manager_find_with_id(manager, account, id);
-	g_assert_nonnull(contact);
-	g_assert_true(PURPLE_IS_CONTACT(contact));
-	g_clear_object(&contact);
-
-	/* Verify that we can find the created contact via username. */
-	contact = purple_contact_manager_find_with_username(manager, account,
-	                                                    "buddy-name");
-	g_assert_nonnull(contact);
-	g_assert_true(PURPLE_IS_CONTACT(contact));
-
-	info = PURPLE_CONTACT_INFO(contact);
-
-	/* Now check the alias and display name to make sure they were synced as
-	 * well.
-	 */
-	source = purple_buddy_get_local_alias(buddy);
-	destination = purple_contact_info_get_alias(info);
-	g_assert_cmpstr(destination, ==, source);
-
-	source = purple_buddy_get_server_alias(buddy);
-	destination = purple_contact_info_get_display_name(info);
-	g_assert_cmpstr(destination, ==, source);
-
-	/* Now let's change the settings in the buddy and verify they made it to the
-	 * contact.
-	 */
-	/* We have to skip testing the name because we have to stand up a LOT more
-	 * of libpurple to be able to change the name.
-	purple_buddy_set_name(buddy, "guy-name");
-	g_assert_cmpstr(purple_contact_get_username(contact), ==, "guy-name");
-	*/
-
-	purple_buddy_set_local_alias(buddy, "guy-alias");
-	g_assert_cmpstr(purple_contact_info_get_alias(info), ==, "guy-alias");
-
-	purple_buddy_set_server_alias(buddy, "server-guy");
-	g_assert_cmpstr(purple_contact_info_get_display_name(info), ==,
-	                "server-guy");
-
-	purple_contact_info_set_alias(info, "friend-alias");
-	g_assert_cmpstr(purple_buddy_get_local_alias(buddy), ==, "friend-alias");
-
-	purple_contact_info_set_display_name(info, "server-friend");
-	g_assert_cmpstr(purple_buddy_get_server_alias(buddy), ==, "server-friend");
-
-	/* We can't verify the presences changes because PurpleBuddy has to be in
-	 * a PurpleMetaContact for that to not crash.
-	 */
-
-	/* Since we're working on the default contact manager, make sure we remove
-	 * any contacts for our test account.
-	 */
-	purple_contact_manager_remove_all(manager, account);
-
-	g_clear_object(&account);
-	g_clear_object(&buddy);
-	g_clear_object(&contact);
-}
-
 /******************************************************************************
  * Person Tests
  *****************************************************************************/
@@ -553,9 +464,6 @@
 	g_test_add_func("/contact-manager/find/with-id",
 	                test_purple_contact_manager_find_with_id);
 
-	g_test_add_func("/contact-manager/add-buddy",
-	                test_purple_contact_manager_add_buddy);
-
 	g_test_add_func("/contact-manager/person/add-remove",
 	                test_purple_contact_manager_person_add_remove);
 	g_test_add_func("/contact-manager/person/add-via-contact-remove-person-with-contacts",

mercurial