tests: always run callback in calls to function config_file_option_set
This commit is contained in:
parent
ba70173a2e
commit
aa3941fee2
@ -56,12 +56,12 @@ TEST_GROUP(GuiNick)
|
|||||||
|
|
||||||
TEST(GuiNick, NickHashColor)
|
TEST(GuiNick, NickHashColor)
|
||||||
{
|
{
|
||||||
config_file_option_set (config_color_chat_nick_colors, NICK_COLORS, 0);
|
config_file_option_set (config_color_chat_nick_colors, NICK_COLORS, 1);
|
||||||
|
|
||||||
/* hash without salt */
|
/* hash without salt */
|
||||||
|
|
||||||
/* test hash: djb2 */
|
/* test hash: djb2 */
|
||||||
config_file_option_set (config_look_nick_color_hash, "djb2", 0);
|
config_file_option_set (config_look_nick_color_hash, "djb2", 1);
|
||||||
|
|
||||||
LONGS_EQUAL(0, gui_nick_hash_color (NULL));
|
LONGS_EQUAL(0, gui_nick_hash_color (NULL));
|
||||||
LONGS_EQUAL(0, gui_nick_hash_color (""));
|
LONGS_EQUAL(0, gui_nick_hash_color (""));
|
||||||
@ -76,7 +76,7 @@ TEST(GuiNick, NickHashColor)
|
|||||||
LONGS_EQUAL(94, gui_nick_hash_color ("zzzzzz"));
|
LONGS_EQUAL(94, gui_nick_hash_color ("zzzzzz"));
|
||||||
|
|
||||||
/* test hash: sum */
|
/* test hash: sum */
|
||||||
config_file_option_set (config_look_nick_color_hash, "sum", 0);
|
config_file_option_set (config_look_nick_color_hash, "sum", 1);
|
||||||
|
|
||||||
LONGS_EQUAL(0, gui_nick_hash_color (NULL));
|
LONGS_EQUAL(0, gui_nick_hash_color (NULL));
|
||||||
LONGS_EQUAL(0, gui_nick_hash_color (""));
|
LONGS_EQUAL(0, gui_nick_hash_color (""));
|
||||||
@ -91,7 +91,7 @@ TEST(GuiNick, NickHashColor)
|
|||||||
LONGS_EQUAL(220, gui_nick_hash_color ("zzzzzz"));
|
LONGS_EQUAL(220, gui_nick_hash_color ("zzzzzz"));
|
||||||
|
|
||||||
/* test hash: djb2_32 */
|
/* test hash: djb2_32 */
|
||||||
config_file_option_set (config_look_nick_color_hash, "djb2_32", 0);
|
config_file_option_set (config_look_nick_color_hash, "djb2_32", 1);
|
||||||
|
|
||||||
LONGS_EQUAL(0, gui_nick_hash_color (NULL));
|
LONGS_EQUAL(0, gui_nick_hash_color (NULL));
|
||||||
LONGS_EQUAL(0, gui_nick_hash_color (""));
|
LONGS_EQUAL(0, gui_nick_hash_color (""));
|
||||||
@ -106,7 +106,7 @@ TEST(GuiNick, NickHashColor)
|
|||||||
LONGS_EQUAL(94, gui_nick_hash_color ("zzzzzz"));
|
LONGS_EQUAL(94, gui_nick_hash_color ("zzzzzz"));
|
||||||
|
|
||||||
/* test hash: sum_32 */
|
/* test hash: sum_32 */
|
||||||
config_file_option_set (config_look_nick_color_hash, "sum_32", 0);
|
config_file_option_set (config_look_nick_color_hash, "sum_32", 1);
|
||||||
|
|
||||||
LONGS_EQUAL(0, gui_nick_hash_color (NULL));
|
LONGS_EQUAL(0, gui_nick_hash_color (NULL));
|
||||||
LONGS_EQUAL(0, gui_nick_hash_color (""));
|
LONGS_EQUAL(0, gui_nick_hash_color (""));
|
||||||
@ -122,22 +122,22 @@ TEST(GuiNick, NickHashColor)
|
|||||||
|
|
||||||
/* hash with salt */
|
/* hash with salt */
|
||||||
|
|
||||||
config_file_option_set (config_look_nick_color_hash_salt, "abc", 0);
|
config_file_option_set (config_look_nick_color_hash_salt, "abc", 1);
|
||||||
|
|
||||||
/* test hash: djb2 */
|
/* test hash: djb2 */
|
||||||
config_file_option_set (config_look_nick_color_hash, "djb2", 0);
|
config_file_option_set (config_look_nick_color_hash, "djb2", 1);
|
||||||
LONGS_EQUAL(146, gui_nick_hash_color ("def"));
|
LONGS_EQUAL(146, gui_nick_hash_color ("def"));
|
||||||
|
|
||||||
/* test hash: sum */
|
/* test hash: sum */
|
||||||
config_file_option_set (config_look_nick_color_hash, "sum", 0);
|
config_file_option_set (config_look_nick_color_hash, "sum", 1);
|
||||||
LONGS_EQUAL(85, gui_nick_hash_color ("def"));
|
LONGS_EQUAL(85, gui_nick_hash_color ("def"));
|
||||||
|
|
||||||
/* test hash: djb2_32 */
|
/* test hash: djb2_32 */
|
||||||
config_file_option_set (config_look_nick_color_hash, "djb2_32", 0);
|
config_file_option_set (config_look_nick_color_hash, "djb2_32", 1);
|
||||||
LONGS_EQUAL(146, gui_nick_hash_color ("def"));
|
LONGS_EQUAL(146, gui_nick_hash_color ("def"));
|
||||||
|
|
||||||
/* test hash: sum_32 */
|
/* test hash: sum_32 */
|
||||||
config_file_option_set (config_look_nick_color_hash, "sum_32", 0);
|
config_file_option_set (config_look_nick_color_hash, "sum_32", 1);
|
||||||
LONGS_EQUAL(85, gui_nick_hash_color ("def"));
|
LONGS_EQUAL(85, gui_nick_hash_color ("def"));
|
||||||
|
|
||||||
config_file_option_reset (config_look_nick_color_hash_salt, 0);
|
config_file_option_reset (config_look_nick_color_hash_salt, 0);
|
||||||
|
@ -1214,7 +1214,7 @@ TEST(IrcMessage, Split)
|
|||||||
/* PRIVMSG with 512 bytes and split_msg_max_length == 0: no split */
|
/* PRIVMSG with 512 bytes and split_msg_max_length == 0: no split */
|
||||||
config_file_option_set (
|
config_file_option_set (
|
||||||
irc_config_server_default[IRC_SERVER_OPTION_SPLIT_MSG_MAX_LENGTH],
|
irc_config_server_default[IRC_SERVER_OPTION_SPLIT_MSG_MAX_LENGTH],
|
||||||
"0", 0);
|
"0", 1);
|
||||||
hashtable = irc_message_split (server,
|
hashtable = irc_message_split (server,
|
||||||
"PRIVMSG #channel :" LOREM_IPSUM_512);
|
"PRIVMSG #channel :" LOREM_IPSUM_512);
|
||||||
CHECK(hashtable);
|
CHECK(hashtable);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user