mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 04:56:22 +00:00
Tests lowercasing argument on cmd_connect
This commit is contained in:
@@ -119,3 +119,28 @@ void cmd_connect_fail_message(void **state)
|
|||||||
|
|
||||||
free(help);
|
free(help);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmd_connect_lowercases_argument(void **state)
|
||||||
|
{
|
||||||
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
|
gchar *args[] = { "USER@server.ORG", NULL };
|
||||||
|
|
||||||
|
will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
|
||||||
|
|
||||||
|
expect_string(accounts_get_account, name, "user@server.org");
|
||||||
|
will_return(accounts_get_account, NULL);
|
||||||
|
|
||||||
|
will_return(ui_ask_password, strdup("password"));
|
||||||
|
|
||||||
|
expect_any(cons_show, output);
|
||||||
|
|
||||||
|
expect_any(jabber_connect_with_details, jid);
|
||||||
|
expect_any(jabber_connect_with_details, passwd);
|
||||||
|
expect_any(jabber_connect_with_details, altdomain);
|
||||||
|
will_return(jabber_connect_with_details, JABBER_CONNECTING);
|
||||||
|
|
||||||
|
gboolean result = cmd_connect(args, *help);
|
||||||
|
assert_true(result);
|
||||||
|
|
||||||
|
free(help);
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,3 +5,4 @@ void cmd_connect_shows_message_when_undefined(void **state);
|
|||||||
void cmd_connect_when_no_account(void **state);
|
void cmd_connect_when_no_account(void **state);
|
||||||
void cmd_connect_with_altdomain_when_provided(void **state);
|
void cmd_connect_with_altdomain_when_provided(void **state);
|
||||||
void cmd_connect_fail_message(void **state);
|
void cmd_connect_fail_message(void **state);
|
||||||
|
void cmd_connect_lowercases_argument(void **state);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ int main(int argc, char* argv[]) {
|
|||||||
unit_test(cmd_connect_when_no_account),
|
unit_test(cmd_connect_when_no_account),
|
||||||
unit_test(cmd_connect_with_altdomain_when_provided),
|
unit_test(cmd_connect_with_altdomain_when_provided),
|
||||||
unit_test(cmd_connect_fail_message),
|
unit_test(cmd_connect_fail_message),
|
||||||
|
unit_test(cmd_connect_lowercases_argument),
|
||||||
|
|
||||||
unit_test(cmd_rooms_shows_message_when_disconnected),
|
unit_test(cmd_rooms_shows_message_when_disconnected),
|
||||||
unit_test(cmd_rooms_shows_message_when_disconnecting),
|
unit_test(cmd_rooms_shows_message_when_disconnecting),
|
||||||
|
|||||||
Reference in New Issue
Block a user