diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-03-12 15:20:45 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-03-12 15:20:45 +0100 |
commit | 47e71a1bbd4ff71b8cccd8db4df1187ccf0638f4 (patch) | |
tree | 901a7cf5cb0d3bc24facb785ec4419bb0c330187 | |
parent | 3a4a9459e7721bdf32a5e2968dccb0694323f7d2 (diff) | |
download | weechat-47e71a1bbd4ff71b8cccd8db4df1187ccf0638f4.zip |
tests: close buffers of channels created for tests on irc_join_save_channels_to_autojoin
-rw-r--r-- | tests/unit/plugins/irc/test-irc-join.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/unit/plugins/irc/test-irc-join.cpp b/tests/unit/plugins/irc/test-irc-join.cpp index a163b4b0d..de40dd24b 100644 --- a/tests/unit/plugins/irc/test-irc-join.cpp +++ b/tests/unit/plugins/irc/test-irc-join.cpp @@ -28,6 +28,7 @@ extern "C" #include <string.h> #include "src/core/wee-arraylist.h" #include "src/core/wee-config-file.h" +#include "src/gui/gui-buffer.h" #include "src/plugins/irc/irc-channel.h" #include "src/plugins/irc/irc-join.h" #include "src/plugins/irc/irc-server.h" @@ -479,22 +480,25 @@ TEST(IrcJoin, AddRemoveChannelsAutojoin) TEST(IrcJoin, SaveChannelsToAutojoin) { struct t_irc_server *server; - struct t_irc_channel *channel; + struct t_irc_channel *channel1, *channel2; server = irc_server_alloc ("my_ircd"); CHECK(server); - irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, + channel1 = irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, "#test1", 0, 0); - channel = irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, - "#test2", 0, 0); - channel->key = strdup ("key2"); + channel2 = irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, + "#test2", 0, 0); + channel2->key = strdup ("key2"); irc_join_save_channels_to_autojoin (server); STRCMP_EQUAL( "#test2,#test1 key2", CONFIG_STRING(server->options[IRC_SERVER_OPTION_AUTOJOIN])); + gui_buffer_close (channel1->buffer); + gui_buffer_close (channel2->buffer); + irc_server_free (server); } |