about summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pgp/stub_gpg.c6
-rw-r--r--tests/test_cmd_account.c10
-rw-r--r--tests/xmpp/stub_xmpp.c3
3 files changed, 17 insertions, 2 deletions
diff --git a/tests/pgp/stub_gpg.c b/tests/pgp/stub_gpg.c
index b8150d0a..da80bbf5 100644
--- a/tests/pgp/stub_gpg.c
+++ b/tests/pgp/stub_gpg.c
@@ -24,3 +24,9 @@ const char* p_gpg_libver(void)
 void p_gpg_free_key(ProfPGPKey *key) {}
 
 void p_gpg_verify(const char * const barejid, const char *const sign) {}
+
+char* p_gpg_sign(const char * const str, const char * const fp)
+{
+    return NULL;
+}
+
diff --git a/tests/test_cmd_account.c b/tests/test_cmd_account.c
index 7405658f..887f635e 100644
--- a/tests/test_cmd_account.c
+++ b/tests/test_cmd_account.c
@@ -926,6 +926,8 @@ void cmd_account_set_priority_updates_presence_when_account_connected_with_prese
 {
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "set", "a_account", "online", "10", NULL };
+    ProfAccount *account = account_new("a_account", "a_jid", NULL, NULL, TRUE, NULL, 5222, "a_resource",
+        NULL, NULL, 10, 10, 10, 10, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 
     expect_any(accounts_account_exists, account_name);
     will_return(accounts_account_exists, TRUE);
@@ -934,16 +936,22 @@ void cmd_account_set_priority_updates_presence_when_account_connected_with_prese
     expect_any(accounts_set_priority_online, value);
 
     will_return(jabber_get_connection_status, JABBER_CONNECTED);
-    will_return(jabber_get_account_name, "a_account");
 
     expect_any(accounts_get_last_presence, account_name);
     will_return(accounts_get_last_presence, RESOURCE_ONLINE);
 
+    will_return(jabber_get_account_name, "a_account");
+    will_return(jabber_get_account_name, "a_account");
+
+    expect_any(accounts_get_account, name);
+    will_return(accounts_get_account, account);
+
     will_return(jabber_get_presence_message, "Free to chat");
 
     expect_value(presence_send, status, RESOURCE_ONLINE);
     expect_string(presence_send, msg, "Free to chat");
     expect_value(presence_send, idle, 0);
+    expect_value(presence_send, signed_status, NULL);
 
     expect_cons_show("Updated online priority for account a_account: 10");
     expect_cons_show("");
diff --git a/tests/xmpp/stub_xmpp.c b/tests/xmpp/stub_xmpp.c
index cc9580bf..d134b901 100644
--- a/tests/xmpp/stub_xmpp.c
+++ b/tests/xmpp/stub_xmpp.c
@@ -114,11 +114,12 @@ void presence_join_room(char *room, char *nick, char * passwd)
 void presence_change_room_nick(const char * const room, const char * const nick) {}
 void presence_leave_chat_room(const char * const room_jid) {}
 
-void presence_send(resource_presence_t status, const char * const msg, int idle)
+void presence_send(resource_presence_t status, const char * const msg, int idle, char *signed_status)
 {
     check_expected(status);
     check_expected(msg);
     check_expected(idle);
+    check_expected(signed_status);
 }
 
 gboolean presence_sub_request_exists(const char * const bare_jid)