mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Fix current tests
This commit is contained in:
parent
b4f37b9e31
commit
6af10696f9
@ -97,6 +97,12 @@ void accounts_set_password(const char * const account_name, const char * const v
|
|||||||
check_expected(value);
|
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)
|
void accounts_set_muc_service(const char * const account_name, const char * const value)
|
||||||
{
|
{
|
||||||
check_expected(account_name);
|
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_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_server(const char * const account_name) {}
|
||||||
void accounts_clear_port(const char * const account_name) {}
|
void accounts_clear_port(const char * const account_name) {}
|
||||||
void accounts_clear_otr(const char * const account_name) {}
|
void accounts_clear_otr(const char * const account_name) {}
|
||||||
|
@ -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)
|
void cmd_account_shows_account_when_connected_and_no_args(void **state)
|
||||||
{
|
{
|
||||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
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);
|
TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
gchar *args[] = { NULL };
|
gchar *args[] = { NULL };
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ void cmd_account_show_shows_account_when_exists(void **state)
|
|||||||
{
|
{
|
||||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { "show", "account_name", NULL };
|
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);
|
TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
expect_any(accounts_get_account, name);
|
expect_any(accounts_get_account, name);
|
||||||
@ -477,10 +477,16 @@ void cmd_account_set_password_sets_password(void **state)
|
|||||||
{
|
{
|
||||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { "set", "a_account", "password", "a_password", NULL };
|
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);
|
expect_any(accounts_account_exists, account_name);
|
||||||
will_return(accounts_account_exists, TRUE);
|
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, account_name, "a_account");
|
||||||
expect_string(accounts_set_password, value, "a_password");
|
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);
|
assert_true(result);
|
||||||
|
|
||||||
free(help);
|
free(help);
|
||||||
}
|
}
|
||||||
|
@ -410,7 +410,7 @@ void cmd_connect_asks_password_when_not_in_account(void **state)
|
|||||||
{
|
{
|
||||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { "jabber_org", NULL };
|
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);
|
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);
|
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));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { "jabber_org", NULL };
|
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);
|
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);
|
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));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { "jabber_org", NULL };
|
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);
|
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);
|
will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
|
||||||
|
@ -92,7 +92,7 @@ void cmd_join_uses_account_mucservice_when_no_service_specified(void **state)
|
|||||||
char *expected_room = "room@conference.server.org";
|
char *expected_room = "room@conference.server.org";
|
||||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { room, "nick", nick, NULL };
|
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);
|
TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, account_service, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
muc_init();
|
muc_init();
|
||||||
@ -120,7 +120,7 @@ void cmd_join_uses_supplied_nick(void **state)
|
|||||||
char *nick = "bob";
|
char *nick = "bob";
|
||||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { room, "nick", nick, NULL };
|
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);
|
TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
muc_init();
|
muc_init();
|
||||||
@ -148,7 +148,7 @@ void cmd_join_uses_account_nick_when_not_supplied(void **state)
|
|||||||
char *account_nick = "a_nick";
|
char *account_nick = "a_nick";
|
||||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { room, NULL };
|
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);
|
TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, NULL, account_nick, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
muc_init();
|
muc_init();
|
||||||
@ -179,7 +179,7 @@ void cmd_join_uses_password_when_supplied(void **state)
|
|||||||
char *expected_room = "room@a_service";
|
char *expected_room = "room@a_service";
|
||||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { room, "password", password, NULL };
|
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);
|
TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, account_service, account_nick, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
muc_init();
|
muc_init();
|
||||||
|
@ -307,7 +307,7 @@ void cmd_otr_gen_generates_key_for_connected_account(void **state)
|
|||||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
gchar *args[] = { "gen", NULL };
|
gchar *args[] = { "gen", NULL };
|
||||||
char *account_name = "myaccount";
|
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);
|
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);
|
will_return(jabber_get_connection_status, JABBER_CONNECTED);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user