about summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-01-13 00:41:56 +0000
committerJames Booth <boothj5@gmail.com>2015-01-13 00:41:56 +0000
commit21f8b1c4caa354efd3dfe567648916d6e58318a2 (patch)
treec73c73f5e1f37ed7eb198eb5b3d78cfd0e6b00c7 /tests
parent53a825de744a6aa687f695e7e54dea878c4909e1 (diff)
parent0cb548683c906eb7e48ddfccde4b95f671dea5fc (diff)
downloadprofani-tty-21f8b1c4caa354efd3dfe567648916d6e58318a2.tar.gz
Merge remote-tracking branch 'peterlvilim/keyring'
Diffstat (limited to 'tests')
-rw-r--r--tests/config/stub_accounts.c7
-rw-r--r--tests/test_cmd_account.c12
-rw-r--r--tests/test_cmd_connect.c6
-rw-r--r--tests/test_cmd_join.c8
-rw-r--r--tests/test_cmd_otr.c2
5 files changed, 24 insertions, 11 deletions
diff --git a/tests/config/stub_accounts.c b/tests/config/stub_accounts.c
index 22a130d4..32a80fda 100644
--- a/tests/config/stub_accounts.c
+++ b/tests/config/stub_accounts.c
@@ -97,6 +97,12 @@ void accounts_set_password(const char * const account_name, const char * const v
     check_expected(value);
 }
 
+void accounts_set_eval_password(const char * const account_name, const char * const value)
+{
+    check_expected(account_name);
+    check_expected(value);
+}
+
 void accounts_set_muc_service(const char * const account_name, const char * const value)
 {
     check_expected(account_name);
@@ -172,6 +178,7 @@ gint accounts_get_priority_for_presence_type(const char * const account_name,
 }
 
 void accounts_clear_password(const char * const account_name) {}
+void accounts_clear_eval_password(const char * const account_name) {}
 void accounts_clear_server(const char * const account_name) {}
 void accounts_clear_port(const char * const account_name) {}
 void accounts_clear_otr(const char * const account_name) {}
diff --git a/tests/test_cmd_account.c b/tests/test_cmd_account.c
index 1a49c571..553b0d83 100644
--- a/tests/test_cmd_account.c
+++ b/tests/test_cmd_account.c
@@ -35,7 +35,7 @@ void cmd_account_shows_usage_when_not_connected_and_no_args(void **state)
 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,
+    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);
     gchar *args[] = { NULL };
 
@@ -108,7 +108,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,
+    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);
 
     expect_any(accounts_get_account, name);
@@ -477,10 +477,16 @@ 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);
+
 
     expect_any(accounts_account_exists, account_name);
     will_return(accounts_account_exists, TRUE);
 
+    expect_string(accounts_get_account, name, "a_account");
+    will_return(accounts_get_account, account);
+
     expect_string(accounts_set_password, account_name, "a_account");
     expect_string(accounts_set_password, value, "a_password");
 
@@ -940,4 +946,4 @@ void cmd_account_clear_shows_message_when_invalid_property(void **state)
     assert_true(result);
 
     free(help);
-}
\ No newline at end of file
+}
diff --git a/tests/test_cmd_connect.c b/tests/test_cmd_connect.c
index 570d5f0e..e2089a09 100644
--- a/tests/test_cmd_connect.c
+++ b/tests/test_cmd_connect.c
@@ -410,7 +410,7 @@ void cmd_connect_asks_password_when_not_in_account(void **state)
 {
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "jabber_org", NULL };
-    ProfAccount *account = account_new("jabber_org", "me@jabber.org", 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);
 
     will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
@@ -435,7 +435,7 @@ void cmd_connect_shows_message_when_connecting_with_account(void **state)
 {
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "jabber_org", NULL };
-    ProfAccount *account = account_new("jabber_org", "user@jabber.org", "password",
+    ProfAccount *account = account_new("jabber_org", "user@jabber.org", "password", NULL,
         TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL);
 
     will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
@@ -458,7 +458,7 @@ void cmd_connect_connects_with_account(void **state)
 {
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "jabber_org", NULL };
-    ProfAccount *account = account_new("jabber_org", "me@jabber.org", "password",
+    ProfAccount *account = account_new("jabber_org", "me@jabber.org", "password", NULL,
         TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL);
 
     will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
diff --git a/tests/test_cmd_join.c b/tests/test_cmd_join.c
index caa3ed0b..10ffa547 100644
--- a/tests/test_cmd_join.c
+++ b/tests/test_cmd_join.c
@@ -92,7 +92,7 @@ void cmd_join_uses_account_mucservice_when_no_service_specified(void **state)
     char *expected_room = "room@conference.server.org";
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { room, "nick", nick, NULL };
-    ProfAccount *account = account_new(account_name, "user@server.org", NULL,
+    ProfAccount *account = account_new(account_name, "user@server.org", NULL, NULL,
         TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, account_service, NULL, NULL, NULL, NULL, NULL);
 
     muc_init();
@@ -120,7 +120,7 @@ void cmd_join_uses_supplied_nick(void **state)
     char *nick = "bob";
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { room, "nick", nick, NULL };
-    ProfAccount *account = account_new(account_name, "user@server.org", NULL,
+    ProfAccount *account = account_new(account_name, "user@server.org", NULL, NULL,
         TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL);
 
     muc_init();
@@ -148,7 +148,7 @@ void cmd_join_uses_account_nick_when_not_supplied(void **state)
     char *account_nick = "a_nick";
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { room, NULL };
-    ProfAccount *account = account_new(account_name, "user@server.org", NULL,
+    ProfAccount *account = account_new(account_name, "user@server.org", NULL, NULL,
         TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, NULL, account_nick, NULL, NULL, NULL, NULL);
 
     muc_init();
@@ -179,7 +179,7 @@ void cmd_join_uses_password_when_supplied(void **state)
     char *expected_room = "room@a_service";
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { room, "password", password, NULL };
-    ProfAccount *account = account_new(account_name, "user@server.org", NULL,
+    ProfAccount *account = account_new(account_name, "user@server.org", NULL, NULL,
         TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, account_service, account_nick, NULL, NULL, NULL, NULL);
 
     muc_init();
diff --git a/tests/test_cmd_otr.c b/tests/test_cmd_otr.c
index 7d0adc1a..c6c6f7cf 100644
--- a/tests/test_cmd_otr.c
+++ b/tests/test_cmd_otr.c
@@ -307,7 +307,7 @@ void cmd_otr_gen_generates_key_for_connected_account(void **state)
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "gen", NULL };
     char *account_name = "myaccount";
-    ProfAccount *account = account_new(account_name, "me@jabber.org", NULL,
+    ProfAccount *account = account_new(account_name, "me@jabber.org", NULL, NULL,
         TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL);
 
     will_return(jabber_get_connection_status, JABBER_CONNECTED);