1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 07:46:38 +02:00

irc: revert compute of nick colors to case sensitive way, deprecate again IRC nick color infos (issue #194, issue #2032)

This commit is contained in:
Sébastien Helleu
2023-10-19 23:31:49 +02:00
parent 252f787fcf
commit 6ca604938f
9 changed files with 48 additions and 177 deletions
+1 -70
View File
@@ -184,76 +184,7 @@ TEST(IrcNick, IsNick)
TEST(IrcNick, IrcNickFindColor)
{
struct t_irc_server *server;
char *str, str_color[128];
server = irc_server_alloc ("my_ircd");
CHECK(server);
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("default"));
WEE_TEST_STR(str_color, irc_nick_find_color (NULL, NULL));
WEE_TEST_STR("default", irc_nick_find_color_name (NULL, NULL));
WEE_TEST_STR(str_color, irc_nick_find_color (server, NULL));
WEE_TEST_STR("default", irc_nick_find_color_name (server, NULL));
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("142"));
WEE_TEST_STR(str_color, irc_nick_find_color (NULL, "NICK]"));
WEE_TEST_STR(str_color, irc_nick_find_color (NULL, "nick}"));
WEE_TEST_STR("142", irc_nick_find_color_name (NULL, "NICK]"));
WEE_TEST_STR("142", irc_nick_find_color_name (NULL, "nick}"));
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("lightcyan"));
WEE_TEST_STR(str_color, irc_nick_find_color (NULL, "NICK^A"));
WEE_TEST_STR(str_color, irc_nick_find_color (NULL, "nick~a"));
WEE_TEST_STR("lightcyan", irc_nick_find_color_name (NULL, "NICK^A"));
WEE_TEST_STR("lightcyan", irc_nick_find_color_name (NULL, "nick~a"));
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("142"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "NICK]"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "nick}"));
WEE_TEST_STR("142", irc_nick_find_color_name (server, "NICK]"));
WEE_TEST_STR("142", irc_nick_find_color_name (server, "nick}"));
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("lightcyan"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "NICK^A"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "nick~a"));
WEE_TEST_STR("lightcyan", irc_nick_find_color_name (server, "NICK^A"));
WEE_TEST_STR("lightcyan", irc_nick_find_color_name (server, "nick~a"));
server->casemapping = IRC_SERVER_CASEMAPPING_STRICT_RFC1459;
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("142"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "NICK]"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "nick}"));
WEE_TEST_STR("142", irc_nick_find_color_name (server, "NICK]"));
WEE_TEST_STR("142", irc_nick_find_color_name (server, "nick}"));
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("176"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "NICK^A"));
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("lightcyan"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "nick~a"));
WEE_TEST_STR("176", irc_nick_find_color_name (server, "NICK^A"));
WEE_TEST_STR("lightcyan", irc_nick_find_color_name (server, "nick~a"));
server->casemapping = IRC_SERVER_CASEMAPPING_ASCII;
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("169"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "NICK]"));
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("142"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "nick}"));
WEE_TEST_STR("169", irc_nick_find_color_name (server, "NICK]"));
WEE_TEST_STR("142", irc_nick_find_color_name (server, "nick}"));
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("176"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "NICK^A"));
snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("lightcyan"));
WEE_TEST_STR(str_color, irc_nick_find_color (server, "nick~a"));
WEE_TEST_STR("176", irc_nick_find_color_name (server, "NICK^A"));
WEE_TEST_STR("lightcyan", irc_nick_find_color_name (server, "nick~a"));
irc_server_free (server);
/* TODO: write tests */
}
/*