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

core, plugins, tests: fix octal notation in strings

This commit is contained in:
Sébastien Helleu
2024-09-17 22:13:57 +02:00
parent 2b702f21d3
commit 02847246b2
13 changed files with 225 additions and 225 deletions
+12 -12
View File
@@ -1574,46 +1574,46 @@ TEST(IrcMessage, Split)
(const char *)hashtable_get (hashtable, "args2"));
hashtable_free (hashtable);
/* PRIVMSG with "\01ACTION\01": no split */
hashtable = irc_message_split (server, "PRIVMSG #channel :\01ACTION\01");
/* PRIVMSG with "\001ACTION\001": no split */
hashtable = irc_message_split (server, "PRIVMSG #channel :\001ACTION\001");
CHECK(hashtable);
LONGS_EQUAL(3, hashtable->items_count);
STRCMP_EQUAL("1",
(const char *)hashtable_get (hashtable, "count"));
STRCMP_EQUAL("PRIVMSG #channel :\01ACTION\01",
STRCMP_EQUAL("PRIVMSG #channel :\001ACTION\001",
(const char *)hashtable_get (hashtable, "msg1"));
STRCMP_EQUAL("",
(const char *)hashtable_get (hashtable, "args1"));
hashtable_free (hashtable);
/* PRIVMSG with "\01ACTION test\01": no split */
hashtable = irc_message_split (server, "PRIVMSG #channel :\01ACTION test\01");
/* PRIVMSG with "\001ACTION test\001": no split */
hashtable = irc_message_split (server, "PRIVMSG #channel :\001ACTION test\001");
CHECK(hashtable);
LONGS_EQUAL(3, hashtable->items_count);
STRCMP_EQUAL("1",
(const char *)hashtable_get (hashtable, "count"));
STRCMP_EQUAL("PRIVMSG #channel :\01ACTION test\01",
STRCMP_EQUAL("PRIVMSG #channel :\001ACTION test\001",
(const char *)hashtable_get (hashtable, "msg1"));
STRCMP_EQUAL("test",
(const char *)hashtable_get (hashtable, "args1"));
hashtable_free (hashtable);
/* PRIVMSG with "\01ACTION " + 512 bytes + "\01": 1 split */
/* PRIVMSG with "\001ACTION " + 512 bytes + "\001": 1 split */
hashtable = irc_message_split (server,
"PRIVMSG #channel :"
"\01ACTION " LOREM_IPSUM_512 "\01");
"\001ACTION " LOREM_IPSUM_512 "\001");
CHECK(hashtable);
LONGS_EQUAL(5, hashtable->items_count);
STRCMP_EQUAL("2",
(const char *)hashtable_get (hashtable, "count"));
STRCMP_EQUAL("PRIVMSG #channel :\01ACTION Lorem ipsum dolor sit"
STRCMP_EQUAL("PRIVMSG #channel :\001ACTION Lorem ipsum dolor sit"
" amet, consectetur adipiscing elit. Fusce auctor ac leo ut "
"maximus. Curabitur vestibulum facilisis neque, vitae sodale"
"s elit pulvinar ac. Mauris suscipit pharetra metus eu hendr"
"erit. Proin viverra ligula ut nibh malesuada, vel vehicula "
"leo pulvinar. Nullam tellus dolor, posuere sed orci in, pre"
"tium fermentum ante. Donec a quam vulputate, fermentum nisi"
" nec, convallis\01",
" nec, convallis\001",
(const char *)hashtable_get (hashtable, "msg1"));
STRCMP_EQUAL("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fu"
"sce auctor ac leo ut maximus. Curabitur vestibulum facilisi"
@@ -1623,9 +1623,9 @@ TEST(IrcMessage, Split)
"uere sed orci in, pretium fermentum ante. Donec a quam vulp"
"utate, fermentum nisi nec, convallis",
(const char *)hashtable_get (hashtable, "args1"));
STRCMP_EQUAL("PRIVMSG #channel :\01ACTION sapien. Vestibulum ma"
STRCMP_EQUAL("PRIVMSG #channel :\001ACTION sapien. Vestibulum ma"
"lesuada dui eget iaculis sagittis. Praesent egestas non ex "
"quis blandit. Maecenas quis leo nunc. In.\01",
"quis blandit. Maecenas quis leo nunc. In.\001",
(const char *)hashtable_get (hashtable, "msg2"));
STRCMP_EQUAL("sapien. Vestibulum malesuada dui eget iaculis sagittis. Pra"
"esent egestas non ex quis blandit. Maecenas quis leo nunc. "