summaryrefslogtreecommitdiff
path: root/tests/unit/plugins/irc/test-irc-join.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-05-31 23:39:19 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-05-31 23:39:19 +0200
commitf7149dc7bed16220803301fc86a0a986ef6eca7d (patch)
tree3239508080d9da217dcba1c2120435066c7b9536 /tests/unit/plugins/irc/test-irc-join.cpp
parentc0300ec0a4267d0b56bc8e65df6d835dfce7ef16 (diff)
downloadweechat-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.cpp11
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);
}