about summary refs log tree commit diff stats
path: root/tests/unittests/test_cmd_account.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-06-17 00:15:28 +0100
committerJames Booth <boothj5@gmail.com>2015-06-17 00:15:28 +0100
commit2215a3791f4394394c3ddcde7dd4aa98c704809b (patch)
tree9d654ffdd90a49d22efa603cc926238b1d34eafa /tests/unittests/test_cmd_account.c
parentcfef64c7677cdf66e2b37aa0aa5728262c3bb2f6 (diff)
downloadprofani-tty-2215a3791f4394394c3ddcde7dd4aa98c704809b.tar.gz
Added current window reference to command functions
Diffstat (limited to 'tests/unittests/test_cmd_account.c')
-rw-r--r--tests/unittests/test_cmd_account.c110
1 files changed, 55 insertions, 55 deletions
diff --git a/tests/unittests/test_cmd_account.c b/tests/unittests/test_cmd_account.c
index bddc4c6d..a0f71bc8 100644
--- a/tests/unittests/test_cmd_account.c
+++ b/tests/unittests/test_cmd_account.c
@@ -25,7 +25,7 @@ void cmd_account_shows_usage_when_not_connected_and_no_args(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -46,7 +46,7 @@ void cmd_account_shows_account_when_connected_and_no_args(void **state)
 
     expect_memory(cons_show_account, account, account, sizeof(ProfAccount));
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -67,7 +67,7 @@ void cmd_account_list_shows_accounts(void **state)
 
     expect_memory(cons_show_account_list, accounts, accounts, sizeof(accounts));
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -81,7 +81,7 @@ void cmd_account_show_shows_usage_when_no_arg(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -98,7 +98,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -116,7 +116,7 @@ void cmd_account_show_shows_account_when_exists(void **state)
 
     expect_memory(cons_show_account, account, account, sizeof(account));
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -130,7 +130,7 @@ void cmd_account_add_shows_usage_when_no_arg(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -147,7 +147,7 @@ void cmd_account_add_adds_account(void **state)
     expect_cons_show("Account created.");
     expect_cons_show("");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -161,7 +161,7 @@ void cmd_account_enable_shows_usage_when_no_arg(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -178,7 +178,7 @@ void cmd_account_enable_enables_account(void **state)
     expect_cons_show("Account enabled.");
     expect_cons_show("");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -195,7 +195,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -209,7 +209,7 @@ void cmd_account_disable_shows_usage_when_no_arg(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -226,7 +226,7 @@ void cmd_account_disable_disables_account(void **state)
     expect_cons_show("Account disabled.");
     expect_cons_show("");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -243,7 +243,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -257,7 +257,7 @@ void cmd_account_rename_shows_usage_when_no_args(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -271,7 +271,7 @@ void cmd_account_rename_shows_usage_when_one_arg(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -289,7 +289,7 @@ void cmd_account_rename_renames_account(void **state)
     expect_cons_show("Account renamed.");
     expect_cons_show("");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -307,7 +307,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -321,7 +321,7 @@ void cmd_account_set_shows_usage_when_no_args(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -335,7 +335,7 @@ void cmd_account_set_shows_usage_when_one_arg(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -349,7 +349,7 @@ void cmd_account_set_shows_usage_when_two_args(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -366,7 +366,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -382,7 +382,7 @@ void cmd_account_set_jid_shows_message_for_malformed_jid(void **state)
 
     expect_cons_show("Malformed jid: @malformed");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -402,7 +402,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -427,7 +427,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -447,7 +447,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -467,7 +467,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -493,7 +493,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -519,7 +519,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -540,7 +540,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -561,7 +561,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -581,7 +581,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -601,7 +601,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -615,7 +615,7 @@ void cmd_account_show_message_for_missing_otr_policy(void **state)
 
     expect_cons_show("Usage: Some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -631,7 +631,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -651,7 +651,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -668,7 +668,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -688,7 +688,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -708,7 +708,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -725,7 +725,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -742,7 +742,7 @@ void cmd_account_set_last_priority_shows_message(void **state)
     expect_cons_show("Invalid property: last");
     expect_cons_show("");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -764,7 +764,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -786,7 +786,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -808,7 +808,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -830,7 +830,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -852,7 +852,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -868,7 +868,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -884,7 +884,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -900,7 +900,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -916,7 +916,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -948,7 +948,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -962,7 +962,7 @@ void cmd_account_clear_shows_usage_when_no_args(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -976,7 +976,7 @@ void cmd_account_clear_shows_usage_when_one_arg(void **state)
 
     expect_cons_show("Usage: some usage");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -993,7 +993,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(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);
@@ -1010,7 +1010,7 @@ void cmd_account_clear_shows_message_when_invalid_property(void **state)
     expect_cons_show("Invalid property: badproperty");
     expect_cons_show("");
 
-    gboolean result = cmd_account(args, *help);
+    gboolean result = cmd_account(NULL, args, *help);
     assert_true(result);
 
     free(help);