diff options
Diffstat (limited to 'unittests/test_cmd_account.c')
-rw-r--r-- | unittests/test_cmd_account.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/unittests/test_cmd_account.c b/unittests/test_cmd_account.c index bddc4c6d..887f635e 100644 --- a/unittests/test_cmd_account.c +++ b/unittests/test_cmd_account.c @@ -36,7 +36,7 @@ void cmd_account_shows_account_when_connected_and_no_args(void **state) { CommandHelp *help = malloc(sizeof(CommandHelp)); ProfAccount *account = account_new("jabber_org", "me@jabber.org", NULL, NULL, - TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL); + TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); gchar *args[] = { NULL }; will_return(jabber_get_connection_status, JABBER_CONNECTED); @@ -109,7 +109,7 @@ void cmd_account_show_shows_account_when_exists(void **state) CommandHelp *help = malloc(sizeof(CommandHelp)); gchar *args[] = { "show", "account_name", NULL }; ProfAccount *account = account_new("jabber_org", "me@jabber.org", NULL, NULL, - TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL); + TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); expect_any(accounts_get_account, name); will_return(accounts_get_account, account); @@ -478,7 +478,7 @@ void cmd_account_set_password_sets_password(void **state) CommandHelp *help = malloc(sizeof(CommandHelp)); gchar *args[] = { "set", "a_account", "password", "a_password", NULL }; ProfAccount *account = account_new("a_account", NULL, NULL, NULL, - TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL); + TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); expect_any(accounts_account_exists, account_name); @@ -504,7 +504,7 @@ void cmd_account_set_eval_password_sets_eval_password(void **state) CommandHelp *help = malloc(sizeof(CommandHelp)); gchar *args[] = { "set", "a_account", "eval_password", "a_password", NULL }; ProfAccount *account = account_new("a_account", NULL, NULL, NULL, - TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL); + TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); expect_any(accounts_account_exists, account_name); @@ -529,7 +529,7 @@ void cmd_account_set_password_when_eval_password_set(void **state) { CommandHelp *help = malloc(sizeof(CommandHelp)); gchar *args[] = { "set", "a_account", "password", "a_password", NULL }; ProfAccount *account = account_new("a_account", NULL, NULL, "a_password", - TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL); + TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); expect_any(accounts_account_exists, account_name); @@ -550,7 +550,7 @@ void cmd_account_set_eval_password_when_password_set(void **state) { CommandHelp *help = malloc(sizeof(CommandHelp)); gchar *args[] = { "set", "a_account", "eval_password", "a_password", NULL }; ProfAccount *account = account_new("a_account", NULL, "a_password", NULL, - TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL); + TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); expect_any(accounts_account_exists, account_name); @@ -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(""); |