mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 20:36:22 +00:00
cleanup: Map test files according to structure in src
For example cmd_account() is located in src/command/cmd_funcs.c. The unit test was located in tests/unittests/test_cmd_account.c. Let's move it to a subdirectory like tests/unittests/command/test_cmd_account.c to correpsond to the same structure.
This commit is contained in:
39
tests/unittests/command/test_cmd_sub.c
Normal file
39
tests/unittests/command/test_cmd_sub.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "prof_cmocka.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "xmpp/xmpp.h"
|
||||
|
||||
#include "ui/ui.h"
|
||||
#include "ui/stub_ui.h"
|
||||
|
||||
#include "command/cmd_funcs.h"
|
||||
|
||||
#define CMD_SUB "/sub"
|
||||
|
||||
void
|
||||
cmd_sub_shows_message_when_not_connected(void** state)
|
||||
{
|
||||
gchar* args[] = { NULL };
|
||||
|
||||
will_return(connection_get_status, JABBER_DISCONNECTED);
|
||||
|
||||
expect_cons_show("You are currently not connected.");
|
||||
|
||||
gboolean result = cmd_sub(NULL, CMD_SUB, args);
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void
|
||||
cmd_sub_shows_usage_when_no_arg(void** state)
|
||||
{
|
||||
gchar* args[] = { NULL };
|
||||
|
||||
will_return(connection_get_status, JABBER_CONNECTED);
|
||||
|
||||
expect_string(cons_bad_cmd_usage, cmd, CMD_SUB);
|
||||
|
||||
gboolean result = cmd_sub(NULL, CMD_SUB, args);
|
||||
assert_true(result);
|
||||
}
|
||||
Reference in New Issue
Block a user