From c0300ec0a4267d0b56bc8e65df6d835dfce7ef16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 31 May 2023 23:00:34 +0200 Subject: [PATCH] tests: fix close of channel buffers after tests on function irc_join_split --- tests/unit/plugins/irc/test-irc-join.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/unit/plugins/irc/test-irc-join.cpp b/tests/unit/plugins/irc/test-irc-join.cpp index ed8aa4087..012f6ed42 100644 --- a/tests/unit/plugins/irc/test-irc-join.cpp +++ b/tests/unit/plugins/irc/test-irc-join.cpp @@ -168,7 +168,7 @@ TEST(IrcJoin, SplitBuildString) struct t_arraylist *arraylist; struct t_irc_join_channel **channels; struct t_irc_server *server; - struct t_irc_channel *ptr_channel; + struct t_irc_channel *ptr_channel, *ptr_next_channel; char *autojoin; arraylist = irc_join_split (NULL, NULL, IRC_JOIN_SORT_DISABLED); @@ -388,11 +388,13 @@ TEST(IrcJoin, SplitBuildString) STRCMP_EQUAL("#xyz,#CHAN{A}~,#def,#abc,#zzz key_xyz", autojoin); free (autojoin); arraylist_free (arraylist); - for (ptr_channel = server->channels; ptr_channel; - ptr_channel = ptr_channel->next_channel) + 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; } irc_server_free (server); }