--- a/libpurple/tests/test_protocol.c Thu May 15 22:55:59 2025 -0500 +++ b/libpurple/tests/test_protocol.c Thu May 15 23:56:42 2025 -0500 @@ -144,6 +144,72 @@ } /****************************************************************************** + * General Tests + *****************************************************************************/ +static void +test_purple_protocol_properties(void) { + PurpleProtocol *protocol = NULL; + PurpleProtocolOptions options = 0; + PurpleTags *tags = NULL; + char *description = NULL; + char *icon_name = NULL; + char *icon_resource_path = NULL; + char *icon_search_path = NULL; + char *id = NULL; + char *name = NULL; + + protocol = g_object_new( + TEST_PURPLE_TYPE_PROTOCOL, + "description", "This is a description", + "icon-name", "icon-name", + "icon-resource-path", "resource-path", + "icon-search-path", "search-path", + "id", "test-protocol", + "name", "Test Protocol", + "options", OPT_PROTO_NO_PASSWORD, + NULL); + + birb_assert_type(protocol, TEST_PURPLE_TYPE_PROTOCOL); + + g_object_get( + G_OBJECT(protocol), + "description", &description, + "icon-name", &icon_name, + "icon-resource-path", &icon_resource_path, + "icon-search-path", &icon_search_path, + "id", &id, + "name", &name, + "options", &options, + "tags", &tags, + NULL); + + g_assert_cmpstr(description, ==, "This is a description"); + g_clear_pointer(&description, g_free); + + g_assert_cmpstr(icon_name, ==, "icon-name"); + g_clear_pointer(&icon_name, g_free); + + g_assert_cmpstr(icon_resource_path, ==, "resource-path"); + g_clear_pointer(&icon_resource_path, g_free); + + g_assert_cmpstr(icon_search_path, ==, "search-path"); + g_clear_pointer(&icon_search_path, g_free); + + g_assert_cmpstr(id, ==, "test-protocol"); + g_clear_pointer(&id, g_free); + + g_assert_cmpstr(name, ==, "Test Protocol"); + g_clear_pointer(&name, g_free); + + g_assert_cmphex(options, ==, OPT_PROTO_NO_PASSWORD); + + birb_assert_type(tags, PURPLE_TYPE_TAGS); + g_clear_object(&tags); + + g_assert_finalize_object(protocol); +} + +/****************************************************************************** * TestPurpleProtocol->can_connect Tests *****************************************************************************/ static void @@ -321,6 +387,8 @@ g_test_init(&argc, &argv, NULL); g_test_set_nonfatal_assertions(); + g_test_add_func("/protocol/properties", test_purple_protocol_properties); + g_test_add_func("/protocol/can-connect/error", test_purple_protocol_can_connect_error); g_test_add_func("/protocol/can-connect/false",