about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-12-27 00:05:06 +0000
committerJames Booth <boothj5@gmail.com>2013-12-27 00:05:06 +0000
commitada3c768e503d25e743bd0b6e18def475f9c776e (patch)
tree3cbfb3d680aab61995d97d552d3106c1cf5f7840
parentb466809245f125f4c85c85e72cce0d167315aea8 (diff)
downloadprofani-tty-ada3c768e503d25e743bd0b6e18def475f9c776e.tar.gz
Test priority below lower bounds
-rw-r--r--tests/test_cmd_account.c18
-rw-r--r--tests/test_cmd_account.h1
-rw-r--r--tests/testsuite.c1
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_cmd_account.c b/tests/test_cmd_account.c
index 204f0985..3db512ab 100644
--- a/tests/test_cmd_account.c
+++ b/tests/test_cmd_account.c
@@ -968,6 +968,24 @@ void cmd_account_set_online_priority_shows_message(void **state)
     free(help);
 
 }
+
+void cmd_account_does_not_set_priority_when_too_low(void **state)
+{
+    mock_cons_show();
+    CommandHelp *help = malloc(sizeof(CommandHelp));
+    gchar *args[] = { "set", "a_account", "online", "-150", NULL };
+
+    accounts_account_exists_return(TRUE);
+
+    expect_cons_show("Value out of range. Must be in -128..127.");
+
+    gboolean result = cmd_account(args, *help);
+    assert_true(result);
+
+    free(help);
+
+
+}
 // test invalid priority low
 // test invalid priority high
 // test presence updated when connected as account and current presence equals setting
diff --git a/tests/test_cmd_account.h b/tests/test_cmd_account.h
index 20376dad..94ce6d74 100644
--- a/tests/test_cmd_account.h
+++ b/tests/test_cmd_account.h
@@ -51,3 +51,4 @@ void cmd_account_set_away_priority_sets_preference(void **state);
 void cmd_account_set_xa_priority_sets_preference(void **state);
 void cmd_account_set_dnd_priority_sets_preference(void **state);
 void cmd_account_set_online_priority_shows_message(void **state);
+void cmd_account_does_not_set_priority_when_too_low(void **state);
diff --git a/tests/testsuite.c b/tests/testsuite.c
index 189698a4..126a69a2 100644
--- a/tests/testsuite.c
+++ b/tests/testsuite.c
@@ -242,6 +242,7 @@ int main(int argc, char* argv[]) {
         unit_test(cmd_account_set_xa_priority_sets_preference),
         unit_test(cmd_account_set_dnd_priority_sets_preference),
         unit_test(cmd_account_set_online_priority_shows_message),
+        unit_test(cmd_account_does_not_set_priority_when_too_low),
     };
     return run_tests(tests);
 }