1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Fix current tests

This commit is contained in:
Peter Vilim 2015-01-07 21:03:51 -06:00
parent b4f37b9e31
commit 6af10696f9
5 changed files with 24 additions and 11 deletions

View File

@ -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) {}

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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();

View File

@ -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);