diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-05-31 23:39:19 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-05-31 23:39:19 +0200 |
commit | f7149dc7bed16220803301fc86a0a986ef6eca7d (patch) | |
tree | 3239508080d9da217dcba1c2120435066c7b9536 /tests/unit/plugins/irc/test-irc-join.cpp | |
parent | c0300ec0a4267d0b56bc8e65df6d835dfce7ef16 (diff) | |
download | weechat-f7149dc7bed16220803301fc86a0a986ef6eca7d.zip |
tests: create and close server buffer in tests on function irc_join_split
Diffstat (limited to 'tests/unit/plugins/irc/test-irc-join.cpp')
-rw-r--r-- | tests/unit/plugins/irc/test-irc-join.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/unit/plugins/irc/test-irc-join.cpp b/tests/unit/plugins/irc/test-irc-join.cpp index 012f6ed42..6becffc87 100644 --- a/tests/unit/plugins/irc/test-irc-join.cpp +++ b/tests/unit/plugins/irc/test-irc-join.cpp @@ -168,7 +168,6 @@ TEST(IrcJoin, SplitBuildString) struct t_arraylist *arraylist; struct t_irc_join_channel **channels; struct t_irc_server *server; - struct t_irc_channel *ptr_channel, *ptr_next_channel; char *autojoin; arraylist = irc_join_split (NULL, NULL, IRC_JOIN_SORT_DISABLED); @@ -362,6 +361,7 @@ TEST(IrcJoin, SplitBuildString) /* server with casemapping RFC1459, sort channels by buffer number */ server = irc_server_alloc ("my_ircd"); CHECK(server); + irc_server_create_buffer (server); server->casemapping = IRC_SERVER_CASEMAPPING_RFC1459; irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, "#CHAN{A}~", 0, 0); irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, "#def", 0, 0); @@ -388,14 +388,7 @@ TEST(IrcJoin, SplitBuildString) STRCMP_EQUAL("#xyz,#CHAN{A}~,#def,#abc,#zzz key_xyz", autojoin); free (autojoin); arraylist_free (arraylist); - ptr_channel = server->channels; - while (ptr_channel) - { - ptr_next_channel = ptr_channel->next_channel; - if (ptr_channel->buffer) - gui_buffer_close (ptr_channel->buffer); - ptr_channel = ptr_next_channel; - } + gui_buffer_close (server->buffer); irc_server_free (server); } |