1
0
mirror of https://github.com/irssi/irssi.git synced 2025-02-02 15:08:01 -05:00

Call functions via signals rather than directly

This allows us to leave functions static.
This commit is contained in:
Will Storey 2018-08-27 21:04:54 -07:00
parent b11932d24f
commit 7b09cac9ec

View File

@ -93,6 +93,7 @@ int main(int argc, char **argv)
set_irssi_config("/tmp/irssi/config"); set_irssi_config("/tmp/irssi/config");
settings_init(); settings_init();
recode_init(); recode_init();
channel_events_init();
settings_add_str("lookandfeel", "term_charset", "UTF-8"); settings_add_str("lookandfeel", "term_charset", "UTF-8");
recode_update_charset(); recode_update_charset();
@ -123,6 +124,7 @@ int main(int argc, char **argv)
#endif #endif
res = g_test_run(); res = g_test_run();
channel_events_deinit();
recode_deinit(); recode_deinit();
settings_deinit(); settings_deinit();
signals_deinit(); signals_deinit();
@ -135,7 +137,7 @@ static void test_event_topic_get(topic_test_case const *const test)
{ {
setup(); setup();
event_topic_get(server, test->input); signal_emit("event 332", 2, server, test->input);
g_assert_cmpstr(channel->topic, ==, test->topic); g_assert_cmpstr(channel->topic, ==, test->topic);
g_assert_cmpstr(channel->topic_by, ==, test->topic_by); g_assert_cmpstr(channel->topic_by, ==, test->topic_by);
@ -151,7 +153,8 @@ static void test_event_topic(topic_test_case const *const test)
setup(); setup();
now = time(NULL); now = time(NULL);
event_topic(server, test->input, "newnick", "user@example.com"); signal_emit("event topic", 4, server, test->input, "newnick",
"user@example.com");
g_assert_cmpstr(channel->topic, ==, test->topic); g_assert_cmpstr(channel->topic, ==, test->topic);
g_assert_cmpstr(channel->topic_by, ==, test->topic_by); g_assert_cmpstr(channel->topic_by, ==, test->topic_by);
@ -164,7 +167,7 @@ static void test_event_topic_info(topic_test_case const *const test)
{ {
setup(); setup();
event_topic_info(server, test->input); signal_emit("event 333", 2, server, test->input);
g_assert_cmpstr(channel->topic, ==, test->topic); g_assert_cmpstr(channel->topic, ==, test->topic);
g_assert_cmpstr(channel->topic_by, ==, test->topic_by); g_assert_cmpstr(channel->topic_by, ==, test->topic_by);