mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-29 13:26:21 +00:00
Added tests for clearing chat sessions on lost connection
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "chat_session.h"
|
||||
#include "config/preferences.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/stub_ui.h"
|
||||
#include "muc.h"
|
||||
|
||||
void console_doesnt_show_online_presence_when_set_none(void **state)
|
||||
@@ -194,3 +195,18 @@ void handle_offline_removes_chat_session(void **state)
|
||||
roster_clear();
|
||||
chat_sessions_clear();
|
||||
}
|
||||
|
||||
void lost_connection_clears_chat_sessions(void **state)
|
||||
{
|
||||
chat_sessions_init();
|
||||
chat_session_on_recipient_activity("bob@server.org", "laptop");
|
||||
chat_session_on_recipient_activity("steve@server.org", "mobile");
|
||||
expect_any_cons_show_error();
|
||||
|
||||
handle_lost_connection();
|
||||
|
||||
ChatSession *session1 = chat_session_get("bob@server.org");
|
||||
ChatSession *session2 = chat_session_get("steve@server.org");
|
||||
assert_null(session1);
|
||||
assert_null(session2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user