tests: update unit tests

Not really a best practise. They should have been run before each commit
and updated accordingly. Next time..
This commit is contained in:
Michael Vetter
2026-02-27 23:01:14 +01:00
parent 02cde29b65
commit 36b15ec6d5
12 changed files with 215 additions and 215 deletions

View File

@@ -52,7 +52,7 @@ cmd_connect_when_no_account(void** state)
expect_string(accounts_get_account, name, "user@server.org");
will_return(accounts_get_account, NULL);
will_return(ui_ask_password, strdup("password"));
will_return(ui_ask_password, g_strdup("password"));
expect_cons_show("Connecting as user@server.org");
@@ -76,7 +76,7 @@ cmd_connect_fail_message(void** state)
expect_any(accounts_get_account, name);
will_return(accounts_get_account, NULL);
will_return(ui_ask_password, strdup("password"));
will_return(ui_ask_password, g_strdup("password"));
expect_cons_show("Connecting as user@server.org");
@@ -102,7 +102,7 @@ cmd_connect_lowercases_argument_with_no_account(void** state)
expect_string(accounts_get_account, name, "USER@server.ORG");
will_return(accounts_get_account, NULL);
will_return(ui_ask_password, strdup("password"));
will_return(ui_ask_password, g_strdup("password"));
expect_cons_show("Connecting as user@server.org");
@@ -130,7 +130,7 @@ cmd_connect_lowercases_argument_with_account(void** state)
expect_cons_show("Connecting with account Jabber_org as me@jabber.org");
expect_memory(session_connect_with_account, account, account, sizeof(account));
expect_memory(session_connect_with_account, account, account, sizeof(ProfAccount));
will_return(session_connect_with_account, JABBER_CONNECTING);
gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
@@ -149,7 +149,7 @@ cmd_connect_asks_password_when_not_in_account(void** state)
expect_any(accounts_get_account, name);
will_return(accounts_get_account, account);
will_return(ui_ask_password, strdup("password"));
will_return(ui_ask_password, g_strdup("password"));
expect_cons_show("Connecting with account jabber_org as me@jabber.org");
@@ -338,7 +338,7 @@ cmd_connect_with_server_when_provided(void** state)
expect_string(accounts_get_account, name, "user@server.org");
will_return(accounts_get_account, NULL);
will_return(ui_ask_password, strdup("password"));
will_return(ui_ask_password, g_strdup("password"));
expect_cons_show("Connecting as user@server.org");
@@ -362,7 +362,7 @@ cmd_connect_with_port_when_provided(void** state)
expect_string(accounts_get_account, name, "user@server.org");
will_return(accounts_get_account, NULL);
will_return(ui_ask_password, strdup("password"));
will_return(ui_ask_password, g_strdup("password"));
expect_cons_show("Connecting as user@server.org");
@@ -386,7 +386,7 @@ cmd_connect_with_server_and_port_when_provided(void** state)
expect_string(accounts_get_account, name, "user@server.org");
will_return(accounts_get_account, NULL);
will_return(ui_ask_password, strdup("password"));
will_return(ui_ask_password, g_strdup("password"));
expect_cons_show("Connecting as user@server.org");
@@ -435,7 +435,7 @@ cmd_connect_connects_with_account(void** state)
expect_cons_show("Connecting with account jabber_org as me@jabber.org");
expect_memory(session_connect_with_account, account, account, sizeof(account));
expect_memory(session_connect_with_account, account, account, sizeof(ProfAccount));
will_return(session_connect_with_account, JABBER_CONNECTING);
gboolean result = cmd_connect(NULL, CMD_CONNECT, args);