1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-07-21 18:24:14 -04:00

Fix server_event unit tests

roster_update_presence now requires that
roster_process_pending_presence() has been called. Otherwise presence
are set to pending and not processed yet.
This commit is contained in:
Paul Fariello 2019-04-17 06:40:11 +03:20
parent 973a05d15a
commit 6d39f49f57

View File

@ -21,6 +21,7 @@ void console_shows_online_presence_when_set_online(void **state)
prefs_set_string(PREF_STATUSES_CONSOLE, "online");
plugins_init();
roster_create();
roster_process_pending_presence();
char *barejid = "test1@server";
roster_add(barejid, "bob", NULL, "both", FALSE);
Resource *resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10);
@ -40,6 +41,7 @@ void console_shows_online_presence_when_set_all(void **state)
prefs_set_string(PREF_STATUSES_CONSOLE, "all");
plugins_init();
roster_create();
roster_process_pending_presence();
char *barejid = "test1@server";
roster_add(barejid, "bob", NULL, "both", FALSE);
Resource *resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10);
@ -59,6 +61,7 @@ void console_shows_dnd_presence_when_set_all(void **state)
prefs_set_string(PREF_STATUSES_CONSOLE, "all");
plugins_init();
roster_create();
roster_process_pending_presence();
char *barejid = "test1@server";
roster_add(barejid, "bob", NULL, "both", FALSE);
Resource *resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10);
@ -77,6 +80,7 @@ void handle_offline_removes_chat_session(void **state)
{
plugins_init();
roster_create();
roster_process_pending_presence();
chat_sessions_init();
char *barejid = "friend@server.chat.com";
char *resource = "home";
@ -100,6 +104,7 @@ void handle_offline_removes_chat_session(void **state)
void lost_connection_clears_chat_sessions(void **state)
{
roster_create();
roster_process_pending_presence();
chat_sessions_init();
chat_session_recipient_active("bob@server.org", "laptop", FALSE);
chat_session_recipient_active("steve@server.org", "mobile", FALSE);