mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 13:36:20 +00:00
Roll the tree back to the pre-merge tip3b673150b, undoing the upstream sync merge72f4f186d(303 files) and the 13 post-merge commits layered on top of it. Purpose: restore the last pre-sync baseline so the reported OMEMO/OTR encryption regressions can be reproduced against a known-good state and the upstream sync ruled in or out as the cause. Nothing is dropped from history; the merge and every post-merge commit remain reachable and can be cherry-picked back selectively. Baseline:3b673150bchore(chatlog): disable background message file logging (stage 1) Undoes merge:72f4f186dmerge: sync upstream profanity-im/profanity
53 lines
1.3 KiB
C
53 lines
1.3 KiB
C
#include <string.h>
|
|
#include "prof_cmocka.h"
|
|
#include <stdlib.h>
|
|
|
|
#include "xmpp/chat_session.h"
|
|
|
|
void
|
|
returns_false_when_chat_session_does_not_exist(void** state)
|
|
{
|
|
ChatSession* session = chat_session_get("somejid@server.org");
|
|
assert_null(session);
|
|
}
|
|
|
|
void
|
|
creates_chat_session_on_recipient_activity(void** state)
|
|
{
|
|
char* barejid = "myjid@server.org";
|
|
char* resource = "tablet";
|
|
|
|
chat_session_recipient_active(barejid, resource, FALSE);
|
|
ChatSession* session = chat_session_get(barejid);
|
|
|
|
assert_non_null(session);
|
|
assert_string_equal(session->resource, resource);
|
|
}
|
|
|
|
void
|
|
replaces_chat_session_on_recipient_activity_with_different_resource(void** state)
|
|
{
|
|
char* barejid = "myjid@server.org";
|
|
char* resource1 = "tablet";
|
|
char* resource2 = "mobile";
|
|
|
|
chat_session_recipient_active(barejid, resource1, FALSE);
|
|
chat_session_recipient_active(barejid, resource2, FALSE);
|
|
ChatSession* session = chat_session_get(barejid);
|
|
|
|
assert_string_equal(session->resource, resource2);
|
|
}
|
|
|
|
void
|
|
removes_chat_session(void** state)
|
|
{
|
|
char* barejid = "myjid@server.org";
|
|
char* resource1 = "laptop";
|
|
|
|
chat_session_recipient_active(barejid, resource1, FALSE);
|
|
chat_session_remove(barejid);
|
|
ChatSession* session = chat_session_get(barejid);
|
|
|
|
assert_null(session);
|
|
}
|