Fixed tests

This commit is contained in:
James Booth
2016-04-27 00:30:33 +01:00
parent ce32814679
commit 38652efb19
4 changed files with 87 additions and 112 deletions

View File

@@ -61,7 +61,7 @@ void cmd_account_list_shows_accounts(void **state)
expect_memory(cons_show_account_list, accounts, accounts, sizeof(accounts));
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_list(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -71,7 +71,7 @@ void cmd_account_show_shows_usage_when_no_arg(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_show(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -85,7 +85,7 @@ void cmd_account_show_shows_message_when_account_does_not_exist(void **state)
expect_cons_show("No such account.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_show(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -100,7 +100,7 @@ void cmd_account_show_shows_account_when_exists(void **state)
expect_memory(cons_show_account, account, account, sizeof(account));
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_show(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -110,7 +110,7 @@ void cmd_account_add_shows_usage_when_no_arg(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_add(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -124,7 +124,7 @@ void cmd_account_add_adds_account(void **state)
expect_cons_show("Account created.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_add(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -134,7 +134,7 @@ void cmd_account_enable_shows_usage_when_no_arg(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_enable(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -148,7 +148,7 @@ void cmd_account_enable_enables_account(void **state)
expect_cons_show("Account enabled.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_enable(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -162,7 +162,7 @@ void cmd_account_enable_shows_message_when_account_doesnt_exist(void **state)
expect_cons_show("No such account: account_name");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_enable(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -172,7 +172,7 @@ void cmd_account_disable_shows_usage_when_no_arg(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_disable(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -186,7 +186,7 @@ void cmd_account_disable_disables_account(void **state)
expect_cons_show("Account disabled.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_disable(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -200,7 +200,7 @@ void cmd_account_disable_shows_message_when_account_doesnt_exist(void **state)
expect_cons_show("No such account: account_name");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_disable(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -210,7 +210,7 @@ void cmd_account_rename_shows_usage_when_no_args(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_rename(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -220,7 +220,7 @@ void cmd_account_rename_shows_usage_when_one_arg(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_rename(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -235,7 +235,7 @@ void cmd_account_rename_renames_account(void **state)
expect_cons_show("Account renamed.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_rename(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -250,7 +250,7 @@ void cmd_account_rename_shows_message_when_not_renamed(void **state)
expect_cons_show("Either account original_name doesn't exist, or account new_name already exists.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_rename(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -260,7 +260,7 @@ void cmd_account_set_shows_usage_when_no_args(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -270,7 +270,7 @@ void cmd_account_set_shows_usage_when_one_arg(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -280,7 +280,7 @@ void cmd_account_set_shows_usage_when_two_args(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -294,7 +294,7 @@ void cmd_account_set_shows_message_when_account_doesnt_exist(void **state)
expect_cons_show("Account a_account doesn't exist");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -307,7 +307,7 @@ void cmd_account_set_jid_shows_message_for_malformed_jid(void **state)
expect_cons_show("Malformed jid: @malformed");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -324,7 +324,7 @@ void cmd_account_set_jid_sets_barejid(void **state)
expect_cons_show("Updated jid for account a_account: a_local@a_domain");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -346,7 +346,7 @@ void cmd_account_set_jid_sets_resource(void **state)
expect_cons_show("Updated resource for account a_account: a_resource");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -363,7 +363,7 @@ void cmd_account_set_server_sets_server(void **state)
expect_cons_show("Updated server for account a_account: a_server");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -382,7 +382,7 @@ void cmd_account_set_resource_sets_resource(void **state)
expect_cons_show("Updated resource for account a_account: a_resource");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -401,7 +401,7 @@ void cmd_account_set_resource_sets_resource_with_online_message(void **state)
expect_cons_show("Updated resource for account a_account: a_resource, you will need to reconnect to pick up the change.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -424,7 +424,7 @@ void cmd_account_set_password_sets_password(void **state)
expect_cons_show("Updated password for account a_account");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -446,7 +446,7 @@ void cmd_account_set_eval_password_sets_eval_password(void **state)
expect_cons_show("Updated eval_password for account a_account");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -463,7 +463,7 @@ void cmd_account_set_password_when_eval_password_set(void **state) {
expect_cons_show("Cannot set password when eval_password is set.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -480,7 +480,7 @@ void cmd_account_set_eval_password_when_password_set(void **state) {
expect_cons_show("Cannot set eval_password when password is set.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -497,7 +497,7 @@ void cmd_account_set_muc_sets_muc(void **state)
expect_cons_show("Updated muc service for account a_account: a_muc");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -514,7 +514,7 @@ void cmd_account_set_nick_sets_nick(void **state)
expect_cons_show("Updated muc nick for account a_account: a_nick");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -524,7 +524,7 @@ void cmd_account_show_message_for_missing_otr_policy(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -537,7 +537,7 @@ void cmd_account_show_message_for_invalid_otr_policy(void **state)
expect_cons_show("OTR policy must be one of: manual, opportunistic or always.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -554,7 +554,7 @@ void cmd_account_set_otr_sets_otr(void **state)
expect_cons_show("Updated OTR policy for account a_account: opportunistic");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -568,7 +568,7 @@ void cmd_account_set_status_shows_message_when_invalid_status(void **state)
expect_cons_show("Invalid status: bad_status");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -585,7 +585,7 @@ void cmd_account_set_status_sets_status_when_valid(void **state)
expect_cons_show("Updated login status for account a_account: away");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -602,7 +602,7 @@ void cmd_account_set_status_sets_status_when_last(void **state)
expect_cons_show("Updated login status for account a_account: last");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -616,7 +616,7 @@ void cmd_account_set_invalid_presence_string_priority_shows_message(void **state
expect_cons_show("Invalid property: blah");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -630,7 +630,7 @@ void cmd_account_set_last_priority_shows_message(void **state)
expect_cons_show("Invalid property: last");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -649,7 +649,7 @@ void cmd_account_set_online_priority_sets_preference(void **state)
expect_cons_show("Updated online priority for account a_account: 10");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -668,7 +668,7 @@ void cmd_account_set_chat_priority_sets_preference(void **state)
expect_cons_show("Updated chat priority for account a_account: 10");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -687,7 +687,7 @@ void cmd_account_set_away_priority_sets_preference(void **state)
expect_cons_show("Updated away priority for account a_account: 10");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -706,7 +706,7 @@ void cmd_account_set_xa_priority_sets_preference(void **state)
expect_cons_show("Updated xa priority for account a_account: 10");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -725,7 +725,7 @@ void cmd_account_set_dnd_priority_sets_preference(void **state)
expect_cons_show("Updated dnd priority for account a_account: 10");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -738,7 +738,7 @@ void cmd_account_set_priority_too_low_shows_message(void **state)
expect_cons_show("Value -150 out of range. Must be in -128..127.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -751,7 +751,7 @@ void cmd_account_set_priority_too_high_shows_message(void **state)
expect_cons_show("Value 150 out of range. Must be in -128..127.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -764,7 +764,7 @@ void cmd_account_set_priority_when_not_number_shows_message(void **state)
expect_cons_show("Could not convert \"abc\" to a number.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -777,7 +777,7 @@ void cmd_account_set_priority_when_empty_shows_message(void **state)
expect_cons_show("Could not convert \"\" to a number.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -817,7 +817,7 @@ void cmd_account_set_priority_updates_presence_when_account_connected_with_prese
expect_cons_show("Updated online priority for account a_account: 10");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_set(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -827,7 +827,7 @@ void cmd_account_clear_shows_usage_when_no_args(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_clear(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -837,7 +837,7 @@ void cmd_account_clear_shows_usage_when_one_arg(void **state)
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_clear(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -851,7 +851,7 @@ void cmd_account_clear_shows_message_when_account_doesnt_exist(void **state)
expect_cons_show("Account a_account doesn't exist");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_clear(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
@@ -865,6 +865,6 @@ void cmd_account_clear_shows_message_when_invalid_property(void **state)
expect_cons_show("Invalid property: badproperty");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
gboolean result = cmd_account_clear(NULL, CMD_ACCOUNT, args);
assert_true(result);
}