1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

irc: use parsed command parameters in "005" command callback

This commit is contained in:
Sébastien Helleu
2021-10-15 19:59:11 +02:00
parent 0ea0b24563
commit 1029780ce2
2 changed files with 127 additions and 182 deletions
+19 -6
View File
@@ -2056,7 +2056,7 @@ TEST(IrcProtocolWithServer, 005_full)
POINTERS_EQUAL(NULL, ptr_server->isupport);
RECV(":server 005 alice " IRC_MSG_005 " :are supported");
CHECK_SRV("-- " IRC_MSG_005 " :are supported");
CHECK_SRV("-- " IRC_MSG_005 " are supported");
STRCMP_EQUAL("ohv", ptr_server->prefix_modes);
STRCMP_EQUAL("@%+", ptr_server->prefix_chars);
@@ -2072,7 +2072,19 @@ TEST(IrcProtocolWithServer, 005_full)
/* check that realloc of info is OK if we receive the message again */
RECV(":server 005 alice " IRC_MSG_005 " :are supported");
CHECK_SRV("-- " IRC_MSG_005 " :are supported");
CHECK_SRV("-- " IRC_MSG_005 " are supported");
STRCMP_EQUAL("ohv", ptr_server->prefix_modes);
STRCMP_EQUAL("@%+", ptr_server->prefix_chars);
LONGS_EQUAL(30, ptr_server->nick_max_length);
LONGS_EQUAL(16, ptr_server->user_max_length);
LONGS_EQUAL(32, ptr_server->host_max_length);
LONGS_EQUAL(1, ptr_server->casemapping);
STRCMP_EQUAL("#", ptr_server->chantypes);
STRCMP_EQUAL("eIbq,k,flj,CFLMPQScgimnprstuz", ptr_server->chanmodes);
LONGS_EQUAL(100, ptr_server->monitor);
CHECK(ptr_server->isupport[0] == ' ');
STRCMP_EQUAL(IRC_MSG_005 " " IRC_MSG_005, ptr_server->isupport + 1);
}
/*
@@ -2090,12 +2102,13 @@ TEST(IrcProtocolWithServer, 005_multiple_messages)
POINTERS_EQUAL(NULL, ptr_server->isupport);
RECV(":server 005 alice PREFIX=(ohv)@%+ :are supported");
CHECK_SRV("-- PREFIX=(ohv)@%+ :are supported");
RECV(":server 005 alice HOSTLEN=24 :are supported");
CHECK_SRV("-- HOSTLEN=24 :are supported");
CHECK_SRV("-- PREFIX=(ohv)@%+ are supported");
STRCMP_EQUAL("ohv", ptr_server->prefix_modes);
STRCMP_EQUAL("@%+", ptr_server->prefix_chars);
STRCMP_EQUAL(" PREFIX=(ohv)@%+", ptr_server->isupport);
RECV(":server 005 alice HOSTLEN=24 :are supported");
CHECK_SRV("-- HOSTLEN=24 are supported");
LONGS_EQUAL(24, ptr_server->host_max_length);
STRCMP_EQUAL(" PREFIX=(ohv)@%+ HOSTLEN=24", ptr_server->isupport);
}