tests: replace freenode by libera in tests

This commit is contained in:
Sébastien Helleu 2021-05-25 13:38:12 +02:00
parent f55dcde4ff
commit 18c82fc5c7
2 changed files with 60 additions and 54 deletions

View File

@ -51,12 +51,12 @@ TEST(IrcIgnore, New)
STRCMP_EQUAL("*", ignore->channel); STRCMP_EQUAL("*", ignore->channel);
irc_ignore_free (ignore); irc_ignore_free (ignore);
ignore = irc_ignore_new ("^user@host$", "freenode", "#weechat"); ignore = irc_ignore_new ("^user@host$", "libera", "#weechat");
CHECK(ignore); CHECK(ignore);
LONGS_EQUAL(1, ignore->number); LONGS_EQUAL(1, ignore->number);
STRCMP_EQUAL("^user@host$", ignore->mask); STRCMP_EQUAL("^user@host$", ignore->mask);
CHECK(ignore->regex_mask); CHECK(ignore->regex_mask);
STRCMP_EQUAL("freenode", ignore->server); STRCMP_EQUAL("libera", ignore->server);
STRCMP_EQUAL("#weechat", ignore->channel); STRCMP_EQUAL("#weechat", ignore->channel);
irc_ignore_free (ignore); irc_ignore_free (ignore);
} }
@ -135,7 +135,7 @@ TEST(IrcIgnore, Search)
{ {
struct t_irc_ignore *ignore1, *ignore2; struct t_irc_ignore *ignore1, *ignore2;
ignore1 = irc_ignore_new ("^user1@host$", "freenode", "#weechat"); ignore1 = irc_ignore_new ("^user1@host$", "libera", "#weechat");
CHECK(ignore1); CHECK(ignore1);
LONGS_EQUAL(1, ignore1->number); LONGS_EQUAL(1, ignore1->number);
@ -145,16 +145,16 @@ TEST(IrcIgnore, Search)
POINTERS_EQUAL(NULL, irc_ignore_search ("not_found", NULL, NULL)); POINTERS_EQUAL(NULL, irc_ignore_search ("not_found", NULL, NULL));
POINTERS_EQUAL(NULL, irc_ignore_search ("not_found", POINTERS_EQUAL(NULL, irc_ignore_search ("not_found",
"freenode", "#weechat")); "libera", "#weechat"));
POINTERS_EQUAL(NULL, irc_ignore_search ("^user1@host$", POINTERS_EQUAL(NULL, irc_ignore_search ("^user1@host$",
"server1", "#weechat")); "server1", "#weechat"));
POINTERS_EQUAL(NULL, irc_ignore_search ("^user1@host$", POINTERS_EQUAL(NULL, irc_ignore_search ("^user1@host$",
"freenode", "#channel1")); "libera", "#channel1"));
POINTERS_EQUAL(NULL, irc_ignore_search ("^user1@host$", NULL, NULL)); POINTERS_EQUAL(NULL, irc_ignore_search ("^user1@host$", NULL, NULL));
POINTERS_EQUAL(NULL, irc_ignore_search ("^user2@host$", NULL, NULL)); POINTERS_EQUAL(NULL, irc_ignore_search ("^user2@host$", NULL, NULL));
POINTERS_EQUAL(ignore1, irc_ignore_search ("^user1@host$", POINTERS_EQUAL(ignore1, irc_ignore_search ("^user1@host$",
"freenode", "#weechat")); "libera", "#weechat"));
POINTERS_EQUAL(ignore2, irc_ignore_search ("^user2@host$", POINTERS_EQUAL(ignore2, irc_ignore_search ("^user2@host$",
"server2", "#channel2")); "server2", "#channel2"));
@ -181,7 +181,7 @@ TEST(IrcIgnore, CheckHost)
server = irc_server_alloc ("test_ignore"); server = irc_server_alloc ("test_ignore");
CHECK(server); CHECK(server);
ignore1 = irc_ignore_new ("^user1@host$", "freenode", "#weechat"); ignore1 = irc_ignore_new ("^user1@host$", "libera", "#weechat");
CHECK(ignore1); CHECK(ignore1);
LONGS_EQUAL(1, ignore1->number); LONGS_EQUAL(1, ignore1->number);
@ -191,9 +191,9 @@ TEST(IrcIgnore, CheckHost)
/* check server */ /* check server */
LONGS_EQUAL(0, irc_ignore_check_server (ignore1, "test")); LONGS_EQUAL(0, irc_ignore_check_server (ignore1, "test"));
LONGS_EQUAL(1, irc_ignore_check_server (ignore1, "freenode")); LONGS_EQUAL(1, irc_ignore_check_server (ignore1, "libera"));
LONGS_EQUAL(1, irc_ignore_check_server (ignore2, "test")); LONGS_EQUAL(1, irc_ignore_check_server (ignore2, "test"));
LONGS_EQUAL(1, irc_ignore_check_server (ignore2, "freenode")); LONGS_EQUAL(1, irc_ignore_check_server (ignore2, "libera"));
/* check channel */ /* check channel */
LONGS_EQUAL(0, irc_ignore_check_channel (ignore1, server, "#test", "nick")); LONGS_EQUAL(0, irc_ignore_check_channel (ignore1, server, "#test", "nick"));

View File

@ -91,21 +91,23 @@ extern "C"
"nick59,nick60,nick61,nick62,nick63,nick64,nick65,nick66,nick67,nick68,n" \ "nick59,nick60,nick61,nick62,nick63,nick64,nick65,nick66,nick67,nick68,n" \
"ick69,nick70,nick71,nick72,nick__73" "ick69,nick70,nick71,nick72,nick__73"
#define MSG_005 "CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQScgimn" \ #define MSG_005 "CHANTYPES=# EXCEPTS INVEX " \
"prstz CHANLIMIT=#:120 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=fr" \ "CHANMODES=eIbq,k,flj,CFLMPQScgimnprstz CHANLIMIT=#:120 PREFIX=(ov)@+ " \
"eenode STATUSMSG=@+ CALLERID=g CASEMAPPING=rfc1459 CHARSET=ascii NICKLE" \ "MAXLIST=bqeI:100 MODES=4 NETWORK=libera STATUSMSG=@+ CALLERID=g " \
"N=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D FNC TARGMAX=NAMES:1,LIST:1,KICK:" \ "CASEMAPPING=rfc1459 CHARSET=ascii NICKLEN=16 CHANNELLEN=50 " \
"1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=" \ "TOPICLEN=390 DEAF=D FNC TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1," \
"3.0 SAFELIST ELIST=CTU CPRIVMSG :are supported by this server" "PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 " \
"SAFELIST ELIST=CTU CPRIVMSG :are supported by this server"
#define MSG_LONG_005 "CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQS" \ #define MSG_LONG_005 "CHANTYPES=# EXCEPTS INVEX " \
"cgimnprstz CHANLIMIT=#:120 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWO" \ "CHANMODES=eIbq,k,flj,CFLMPQScgimnprstz CHANLIMIT=#:120 PREFIX=(ov)@+ " \
"RK=freenode STATUSMSG=@+ CALLERID=g CASEMAPPING=rfc1459 CHARSET=ascii N" \ "MAXLIST=bqeI:100 MODES=4 NETWORK=libera STATUSMSG=@+ CALLERID=g " \
"ICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D FNC TARGMAX=NAMES:1,LIST:1," \ "CASEMAPPING=rfc1459 CHARSET=ascii NICKLEN=16 CHANNELLEN=50 " \
"KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIEN" \ "TOPICLEN=390 DEAF=D FNC TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1," \
"TVER=3.0 SAFELIST ELIST=CTU CPRIVMSG TEST1:abc TEST2:dev TEST3:ghi TEST" \ "PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 " \
"4:jkl TEST5:mno TEST6:pqr TEST7:stu TEST8:vwx TEST9:yz ABC:1 DEF:2 GHI:" \ "SAFELIST ELIST=CTU CPRIVMSG TEST1:abc TEST2:dev TEST3:ghi TEST4:jkl " \
"3 JKL:4 MNO:5 PQR:6 STU:7 VWX:8 YT:9 :are supported by this server" "TEST5:mno TEST6:pqr TEST7:stu TEST8:vwx TEST9:yz ABC:1 DEF:2 GHI:3 " \
"JKL:4 MNO:5 PQR:6 STU:7 VWX:8 YT:9 :are supported by this server"
#define STRING_200 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD" \ #define STRING_200 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD" \
"EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW" \ "EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW" \
@ -1329,21 +1331,23 @@ TEST(IrcMessage, Split)
LONGS_EQUAL(3, hashtable->items_count); LONGS_EQUAL(3, hashtable->items_count);
STRCMP_EQUAL("1", STRCMP_EQUAL("1",
(const char *)hashtable_get (hashtable, "count")); (const char *)hashtable_get (hashtable, "count"));
STRCMP_EQUAL("005 nick CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFL" STRCMP_EQUAL("005 nick CHANTYPES=# EXCEPTS INVEX "
"MPQScgimnprstz CHANLIMIT=#:120 PREFIX=(ov)@+ MAXLIST=bqeI:1" "CHANMODES=eIbq,k,flj,CFLMPQScgimnprstz CHANLIMIT=#:120 "
"00 MODES=4 NETWORK=freenode STATUSMSG=@+ CALLERID=g CASEMAP" "PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=libera "
"PING=rfc1459 CHARSET=ascii NICKLEN=16 CHANNELLEN=50 TOPICLE" "STATUSMSG=@+ CALLERID=g CASEMAPPING=rfc1459 CHARSET=ascii "
"N=390 DEAF=D FNC TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIV" "NICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D FNC "
"MSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3." "TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,"
"0 SAFELIST ELIST=CTU CPRIVMSG :are supported by this server", "ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 SAFELIST "
"ELIST=CTU CPRIVMSG :are supported by this server",
(const char *)hashtable_get (hashtable, "msg1")); (const char *)hashtable_get (hashtable, "msg1"));
STRCMP_EQUAL("CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQScgimn" STRCMP_EQUAL("CHANTYPES=# EXCEPTS INVEX "
"prstz CHANLIMIT=#:120 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=" "CHANMODES=eIbq,k,flj,CFLMPQScgimnprstz CHANLIMIT=#:120 "
"4 NETWORK=freenode STATUSMSG=@+ CALLERID=g CASEMAPPING=rfc1" "PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=libera "
"459 CHARSET=ascii NICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEA" "STATUSMSG=@+ CALLERID=g CASEMAPPING=rfc1459 CHARSET=ascii "
"F=D FNC TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOT" "NICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D FNC "
"ICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 SAFELIS" "TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,"
"T ELIST=CTU CPRIVMSG", "ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 SAFELIST "
"ELIST=CTU CPRIVMSG",
(const char *)hashtable_get (hashtable, "args1")); (const char *)hashtable_get (hashtable, "args1"));
hashtable_free (hashtable); hashtable_free (hashtable);
@ -1353,24 +1357,26 @@ TEST(IrcMessage, Split)
LONGS_EQUAL(5, hashtable->items_count); LONGS_EQUAL(5, hashtable->items_count);
STRCMP_EQUAL("2", STRCMP_EQUAL("2",
(const char *)hashtable_get (hashtable, "count")); (const char *)hashtable_get (hashtable, "count"));
STRCMP_EQUAL("005 nick CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFL" STRCMP_EQUAL("005 nick CHANTYPES=# EXCEPTS INVEX "
"MPQScgimnprstz CHANLIMIT=#:120 PREFIX=(ov)@+ MAXLIST=bqeI:1" "CHANMODES=eIbq,k,flj,CFLMPQScgimnprstz CHANLIMIT=#:120 "
"00 MODES=4 NETWORK=freenode STATUSMSG=@+ CALLERID=g CASEMAP" "PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=libera "
"PING=rfc1459 CHARSET=ascii NICKLEN=16 CHANNELLEN=50 TOPICLE" "STATUSMSG=@+ CALLERID=g CASEMAPPING=rfc1459 CHARSET=ascii "
"N=390 DEAF=D FNC TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIV" "NICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D FNC "
"MSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3." "TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,"
"0 SAFELIST ELIST=CTU CPRIVMSG TEST1:abc TEST2:dev TEST3:ghi" "ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 SAFELIST "
" TEST4:jkl TEST5:mno TEST6:pqr TEST7:stu TEST8:vwx TEST9:yz" "ELIST=CTU CPRIVMSG TEST1:abc TEST2:dev TEST3:ghi TEST4:jkl "
" ABC:1 :are supported by this server", "TEST5:mno TEST6:pqr TEST7:stu TEST8:vwx TEST9:yz ABC:1 "
":are supported by this server",
(const char *)hashtable_get (hashtable, "msg1")); (const char *)hashtable_get (hashtable, "msg1"));
STRCMP_EQUAL("CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQScgimn" STRCMP_EQUAL("CHANTYPES=# EXCEPTS INVEX "
"prstz CHANLIMIT=#:120 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=" "CHANMODES=eIbq,k,flj,CFLMPQScgimnprstz CHANLIMIT=#:120 "
"4 NETWORK=freenode STATUSMSG=@+ CALLERID=g CASEMAPPING=rfc1" "PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=libera "
"459 CHARSET=ascii NICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEA" "STATUSMSG=@+ CALLERID=g CASEMAPPING=rfc1459 CHARSET=ascii "
"F=D FNC TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOT" "NICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D FNC "
"ICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 SAFELIS" "TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,"
"T ELIST=CTU CPRIVMSG TEST1:abc TEST2:dev TEST3:ghi TEST4:jk" "ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 SAFELIST "
"l TEST5:mno TEST6:pqr TEST7:stu TEST8:vwx TEST9:yz ABC:1", "ELIST=CTU CPRIVMSG TEST1:abc TEST2:dev TEST3:ghi TEST4:jkl "
"TEST5:mno TEST6:pqr TEST7:stu TEST8:vwx TEST9:yz ABC:1",
(const char *)hashtable_get (hashtable, "args1")); (const char *)hashtable_get (hashtable, "args1"));
STRCMP_EQUAL("005 nick DEF:2 GHI:3 JKL:4 MNO:5 PQR:6 STU:7 VWX:8 YT:9 :ar" STRCMP_EQUAL("005 nick DEF:2 GHI:3 JKL:4 MNO:5 PQR:6 STU:7 VWX:8 YT:9 :ar"
"e supported by this server", "e supported by this server",