diff -r 2f12cdef0048 -r e9cc6fc1f717 libpurple/tests/test_notification_authorization_request.c --- a/libpurple/tests/test_notification_authorization_request.c Tue Sep 10 01:07:47 2024 -0500 +++ b/libpurple/tests/test_notification_authorization_request.c Tue Sep 10 01:31:09 2024 -0500 @@ -42,15 +42,26 @@ test_purple_notification_authorization_request_new(void) { PurpleAccount *account = NULL; PurpleAuthorizationRequest *request = NULL; + PurpleAuthorizationRequest *request1 = NULL; PurpleNotification *notification = NULL; + PurpleNotificationAuthorizationRequest *auth_notification = NULL; + const char *id = NULL; account = purple_account_new("test", "test"); request = purple_authorization_request_new(account, "remote-username"); - notification = purple_notification_authorization_request_new(request); + notification = purple_notification_authorization_request_new("id", + request); g_assert_true(PURPLE_IS_NOTIFICATION(notification)); g_assert_true(PURPLE_IS_NOTIFICATION_AUTHORIZATION_REQUEST(notification)); + id = purple_notification_get_id(PURPLE_NOTIFICATION(notification)); + g_assert_cmpstr(id, ==, "id"); + + auth_notification = PURPLE_NOTIFICATION_AUTHORIZATION_REQUEST(notification); + request1 = purple_notification_authorization_request_get_request(auth_notification); + g_assert_true(request1 == request); + g_assert_finalize_object(notification); g_clear_object(&request); @@ -60,27 +71,37 @@ static void test_purple_notification_authorization_request_properties(void) { PurpleAccount *account = NULL; + PurpleAccount *account1 = NULL; PurpleAuthorizationRequest *request = NULL; PurpleAuthorizationRequest *request1 = NULL; PurpleNotification *notification = NULL; + char *id = NULL; account = purple_account_new("test", "test"); request = purple_authorization_request_new(account, "username"); notification = g_object_new( PURPLE_TYPE_NOTIFICATION_AUTHORIZATION_REQUEST, - "account", account, "authorization-request", request, + "id", "id1", NULL); g_object_get( notification, + "account", &account1, "authorization-request", &request1, + "id", &id, NULL); + g_assert_true(account1 == account); + g_clear_object(&account1); + g_assert_true(request1 == request); g_clear_object(&request1); + g_assert_cmpstr(id, ==, "id1"); + g_clear_pointer(&id, g_free); + g_assert_finalize_object(notification); g_clear_object(&request); @@ -97,7 +118,8 @@ account = purple_account_new("test", "test"); request = purple_authorization_request_new(account, "remote-username"); - notification = purple_notification_authorization_request_new(request); + notification = purple_notification_authorization_request_new(NULL, + request); g_signal_connect(notification, "notify::title", G_CALLBACK(test_purple_notification_authorization_request_notify_cb), &counter);