Move /statuses options to /presence command
This commit is contained in:
@@ -13,55 +13,55 @@
|
||||
|
||||
#include "command/cmd_funcs.h"
|
||||
|
||||
#define CMD_STATUSES "/statuses"
|
||||
#define CMD_PRESENCE "/presence"
|
||||
|
||||
void cmd_statuses_shows_usage_when_bad_subcmd(void **state)
|
||||
void cmd_presence_shows_usage_when_bad_subcmd(void **state)
|
||||
{
|
||||
gchar *args[] = { "badcmd", NULL };
|
||||
|
||||
expect_string(cons_bad_cmd_usage, cmd, CMD_STATUSES);
|
||||
expect_string(cons_bad_cmd_usage, cmd, CMD_PRESENCE);
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_shows_usage_when_bad_console_setting(void **state)
|
||||
void cmd_presence_shows_usage_when_bad_console_setting(void **state)
|
||||
{
|
||||
gchar *args[] = { "console", "badsetting", NULL };
|
||||
|
||||
expect_string(cons_bad_cmd_usage, cmd, CMD_STATUSES);
|
||||
expect_string(cons_bad_cmd_usage, cmd, CMD_PRESENCE);
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_shows_usage_when_bad_chat_setting(void **state)
|
||||
void cmd_presence_shows_usage_when_bad_chat_setting(void **state)
|
||||
{
|
||||
gchar *args[] = { "chat", "badsetting", NULL };
|
||||
|
||||
expect_string(cons_bad_cmd_usage, cmd, CMD_STATUSES);
|
||||
expect_string(cons_bad_cmd_usage, cmd, CMD_PRESENCE);
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_shows_usage_when_bad_muc_setting(void **state)
|
||||
void cmd_presence_shows_usage_when_bad_muc_setting(void **state)
|
||||
{
|
||||
gchar *args[] = { "muc", "badsetting", NULL };
|
||||
|
||||
expect_string(cons_bad_cmd_usage, cmd, CMD_STATUSES);
|
||||
expect_string(cons_bad_cmd_usage, cmd, CMD_PRESENCE);
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_console_sets_all(void **state)
|
||||
void cmd_presence_console_sets_all(void **state)
|
||||
{
|
||||
gchar *args[] = { "console", "all", NULL };
|
||||
|
||||
expect_cons_show("All presence updates will appear in the console.");
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
|
||||
char *setting = prefs_get_string(PREF_STATUSES_CONSOLE);
|
||||
assert_non_null(setting);
|
||||
@@ -69,13 +69,13 @@ void cmd_statuses_console_sets_all(void **state)
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_console_sets_online(void **state)
|
||||
void cmd_presence_console_sets_online(void **state)
|
||||
{
|
||||
gchar *args[] = { "console", "online", NULL };
|
||||
|
||||
expect_cons_show("Only online/offline presence updates will appear in the console.");
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
|
||||
char *setting = prefs_get_string(PREF_STATUSES_CONSOLE);
|
||||
assert_non_null(setting);
|
||||
@@ -83,13 +83,13 @@ void cmd_statuses_console_sets_online(void **state)
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_console_sets_none(void **state)
|
||||
void cmd_presence_console_sets_none(void **state)
|
||||
{
|
||||
gchar *args[] = { "console", "none", NULL };
|
||||
|
||||
expect_cons_show("Presence updates will not appear in the console.");
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
|
||||
char *setting = prefs_get_string(PREF_STATUSES_CONSOLE);
|
||||
assert_non_null(setting);
|
||||
@@ -97,13 +97,13 @@ void cmd_statuses_console_sets_none(void **state)
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_chat_sets_all(void **state)
|
||||
void cmd_presence_chat_sets_all(void **state)
|
||||
{
|
||||
gchar *args[] = { "chat", "all", NULL };
|
||||
|
||||
expect_cons_show("All presence updates will appear in chat windows.");
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
|
||||
char *setting = prefs_get_string(PREF_STATUSES_CHAT);
|
||||
assert_non_null(setting);
|
||||
@@ -111,13 +111,13 @@ void cmd_statuses_chat_sets_all(void **state)
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_chat_sets_online(void **state)
|
||||
void cmd_presence_chat_sets_online(void **state)
|
||||
{
|
||||
gchar *args[] = { "chat", "online", NULL };
|
||||
|
||||
expect_cons_show("Only online/offline presence updates will appear in chat windows.");
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
|
||||
char *setting = prefs_get_string(PREF_STATUSES_CHAT);
|
||||
assert_non_null(setting);
|
||||
@@ -125,13 +125,13 @@ void cmd_statuses_chat_sets_online(void **state)
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_chat_sets_none(void **state)
|
||||
void cmd_presence_chat_sets_none(void **state)
|
||||
{
|
||||
gchar *args[] = { "chat", "none", NULL };
|
||||
|
||||
expect_cons_show("Presence updates will not appear in chat windows.");
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
|
||||
char *setting = prefs_get_string(PREF_STATUSES_CHAT);
|
||||
assert_non_null(setting);
|
||||
@@ -139,13 +139,13 @@ void cmd_statuses_chat_sets_none(void **state)
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_muc_sets_all(void **state)
|
||||
void cmd_presence_room_sets_all(void **state)
|
||||
{
|
||||
gchar *args[] = { "muc", "all", NULL };
|
||||
gchar *args[] = { "room", "all", NULL };
|
||||
|
||||
expect_cons_show("All presence updates will appear in chat room windows.");
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
|
||||
char *setting = prefs_get_string(PREF_STATUSES_MUC);
|
||||
assert_non_null(setting);
|
||||
@@ -153,13 +153,13 @@ void cmd_statuses_muc_sets_all(void **state)
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_muc_sets_online(void **state)
|
||||
void cmd_presence_room_sets_online(void **state)
|
||||
{
|
||||
gchar *args[] = { "muc", "online", NULL };
|
||||
gchar *args[] = { "room", "online", NULL };
|
||||
|
||||
expect_cons_show("Only join/leave presence updates will appear in chat room windows.");
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
|
||||
char *setting = prefs_get_string(PREF_STATUSES_MUC);
|
||||
assert_non_null(setting);
|
||||
@@ -167,13 +167,13 @@ void cmd_statuses_muc_sets_online(void **state)
|
||||
assert_true(result);
|
||||
}
|
||||
|
||||
void cmd_statuses_muc_sets_none(void **state)
|
||||
void cmd_presence_room_sets_none(void **state)
|
||||
{
|
||||
gchar *args[] = { "muc", "none", NULL };
|
||||
gchar *args[] = { "room", "none", NULL };
|
||||
|
||||
expect_cons_show("Presence updates will not appear in chat room windows.");
|
||||
|
||||
gboolean result = cmd_statuses(NULL, CMD_STATUSES, args);
|
||||
gboolean result = cmd_presence(NULL, CMD_PRESENCE, args);
|
||||
|
||||
char *setting = prefs_get_string(PREF_STATUSES_MUC);
|
||||
assert_non_null(setting);
|
||||
13
tests/unittests/test_cmd_presence.h
Normal file
13
tests/unittests/test_cmd_presence.h
Normal file
@@ -0,0 +1,13 @@
|
||||
void cmd_presence_shows_usage_when_bad_subcmd(void **state);
|
||||
void cmd_presence_shows_usage_when_bad_console_setting(void **state);
|
||||
void cmd_presence_shows_usage_when_bad_chat_setting(void **state);
|
||||
void cmd_presence_shows_usage_when_bad_muc_setting(void **state);
|
||||
void cmd_presence_console_sets_all(void **state);
|
||||
void cmd_presence_console_sets_online(void **state);
|
||||
void cmd_presence_console_sets_none(void **state);
|
||||
void cmd_presence_chat_sets_all(void **state);
|
||||
void cmd_presence_chat_sets_online(void **state);
|
||||
void cmd_presence_chat_sets_none(void **state);
|
||||
void cmd_presence_room_sets_all(void **state);
|
||||
void cmd_presence_room_sets_online(void **state);
|
||||
void cmd_presence_room_sets_none(void **state);
|
||||
@@ -1,13 +0,0 @@
|
||||
void cmd_statuses_shows_usage_when_bad_subcmd(void **state);
|
||||
void cmd_statuses_shows_usage_when_bad_console_setting(void **state);
|
||||
void cmd_statuses_shows_usage_when_bad_chat_setting(void **state);
|
||||
void cmd_statuses_shows_usage_when_bad_muc_setting(void **state);
|
||||
void cmd_statuses_console_sets_all(void **state);
|
||||
void cmd_statuses_console_sets_online(void **state);
|
||||
void cmd_statuses_console_sets_none(void **state);
|
||||
void cmd_statuses_chat_sets_all(void **state);
|
||||
void cmd_statuses_chat_sets_online(void **state);
|
||||
void cmd_statuses_chat_sets_none(void **state);
|
||||
void cmd_statuses_muc_sets_all(void **state);
|
||||
void cmd_statuses_muc_sets_online(void **state);
|
||||
void cmd_statuses_muc_sets_none(void **state);
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "test_cmd_account.h"
|
||||
#include "test_cmd_rooms.h"
|
||||
#include "test_cmd_sub.h"
|
||||
#include "test_cmd_statuses.h"
|
||||
#include "test_cmd_presence.h"
|
||||
#include "test_cmd_otr.h"
|
||||
#include "test_cmd_pgp.h"
|
||||
#include "test_jid.h"
|
||||
@@ -395,35 +395,35 @@ int main(int argc, char* argv[]) {
|
||||
unit_test(contact_available_when_highest_priority_online),
|
||||
unit_test(contact_available_when_highest_priority_chat),
|
||||
|
||||
unit_test(cmd_statuses_shows_usage_when_bad_subcmd),
|
||||
unit_test(cmd_statuses_shows_usage_when_bad_console_setting),
|
||||
unit_test(cmd_statuses_shows_usage_when_bad_chat_setting),
|
||||
unit_test(cmd_statuses_shows_usage_when_bad_muc_setting),
|
||||
unit_test_setup_teardown(cmd_statuses_console_sets_all,
|
||||
unit_test(cmd_presence_shows_usage_when_bad_subcmd),
|
||||
unit_test(cmd_presence_shows_usage_when_bad_console_setting),
|
||||
unit_test(cmd_presence_shows_usage_when_bad_chat_setting),
|
||||
unit_test(cmd_presence_shows_usage_when_bad_muc_setting),
|
||||
unit_test_setup_teardown(cmd_presence_console_sets_all,
|
||||
load_preferences,
|
||||
close_preferences),
|
||||
unit_test_setup_teardown(cmd_statuses_console_sets_online,
|
||||
unit_test_setup_teardown(cmd_presence_console_sets_online,
|
||||
load_preferences,
|
||||
close_preferences),
|
||||
unit_test_setup_teardown(cmd_statuses_console_sets_none,
|
||||
unit_test_setup_teardown(cmd_presence_console_sets_none,
|
||||
load_preferences,
|
||||
close_preferences),
|
||||
unit_test_setup_teardown(cmd_statuses_chat_sets_all,
|
||||
unit_test_setup_teardown(cmd_presence_chat_sets_all,
|
||||
load_preferences,
|
||||
close_preferences),
|
||||
unit_test_setup_teardown(cmd_statuses_chat_sets_online,
|
||||
unit_test_setup_teardown(cmd_presence_chat_sets_online,
|
||||
load_preferences,
|
||||
close_preferences),
|
||||
unit_test_setup_teardown(cmd_statuses_chat_sets_none,
|
||||
unit_test_setup_teardown(cmd_presence_chat_sets_none,
|
||||
load_preferences,
|
||||
close_preferences),
|
||||
unit_test_setup_teardown(cmd_statuses_muc_sets_all,
|
||||
unit_test_setup_teardown(cmd_presence_room_sets_all,
|
||||
load_preferences,
|
||||
close_preferences),
|
||||
unit_test_setup_teardown(cmd_statuses_muc_sets_online,
|
||||
unit_test_setup_teardown(cmd_presence_room_sets_online,
|
||||
load_preferences,
|
||||
close_preferences),
|
||||
unit_test_setup_teardown(cmd_statuses_muc_sets_none,
|
||||
unit_test_setup_teardown(cmd_presence_room_sets_none,
|
||||
load_preferences,
|
||||
close_preferences),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user