diff options
author | James Booth <boothj5@gmail.com> | 2015-07-27 00:04:48 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-07-27 00:04:48 +0100 |
commit | 8119025120b0b511aea8bc3f477d2aff835bd24b (patch) | |
tree | 14d19a151bc8aa0862002a2da8feb10a7a89b788 /tests/unittests/test_cmd_sub.c | |
parent | 59d5dd73a77b2a85e199ad43e9ba4591b2bfbe08 (diff) | |
download | profani-tty-8119025120b0b511aea8bc3f477d2aff835bd24b.tar.gz |
Fixed tests for new command format
Diffstat (limited to 'tests/unittests/test_cmd_sub.c')
-rw-r--r-- | tests/unittests/test_cmd_sub.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/unittests/test_cmd_sub.c b/tests/unittests/test_cmd_sub.c index 55b9de60..62871520 100644 --- a/tests/unittests/test_cmd_sub.c +++ b/tests/unittests/test_cmd_sub.c @@ -13,33 +13,28 @@ #include "command/commands.h" +#define CMD_SUB "/sub" + void cmd_sub_shows_message_when_not_connected(void **state) { - CommandHelp *help = malloc(sizeof(CommandHelp)); gchar *args[] = { NULL }; will_return(jabber_get_connection_status, JABBER_DISCONNECTED); expect_cons_show("You are currently not connected."); - gboolean result = cmd_sub(NULL, args, *help); + gboolean result = cmd_sub(NULL, CMD_SUB, args); assert_true(result); - - free(help); } void cmd_sub_shows_usage_when_no_arg(void **state) { - CommandHelp *help = malloc(sizeof(CommandHelp)); - help->usage = "Some usage"; gchar *args[] = { NULL }; will_return(jabber_get_connection_status, JABBER_CONNECTED); - expect_cons_show("Usage: Some usage"); + expect_string(cons_bad_cmd_usage, cmd, CMD_SUB); - gboolean result = cmd_sub(NULL, args, *help); + gboolean result = cmd_sub(NULL, CMD_SUB, args); assert_true(result); - - free(help); } |