Added cmd_bookmark tests
This commit is contained in:
30
tests/test_cmd_bookmark.c
Normal file
30
tests/test_cmd_bookmark.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <setjmp.h>
|
||||
#include <cmocka.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "xmpp/xmpp.h"
|
||||
#include "xmpp/mock_xmpp.h"
|
||||
|
||||
#include "command/commands.h"
|
||||
|
||||
#include "ui/mock_ui.h"
|
||||
|
||||
void cmd_bookmark_shows_usage_when_no_args(void **state)
|
||||
{
|
||||
mock_cons_show();
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
help->usage = "some usage";
|
||||
gchar *args[] = { NULL };
|
||||
|
||||
mock_connection_status(JABBER_CONNECTED);
|
||||
expect_cons_show("Usage: some usage");
|
||||
|
||||
gboolean result = cmd_bookmark(args, *help);
|
||||
assert_true(result);
|
||||
|
||||
free(help);
|
||||
}
|
||||
Reference in New Issue
Block a user