diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_cmd_win.c | 41 | ||||
-rw-r--r-- | tests/test_cmd_win.h | 2 | ||||
-rw-r--r-- | tests/testsuite.c | 4 | ||||
-rw-r--r-- | tests/ui/stub_ui.c | 12 |
4 files changed, 1 insertions, 58 deletions
diff --git a/tests/test_cmd_win.c b/tests/test_cmd_win.c deleted file mode 100644 index 7ad01c49..00000000 --- a/tests/test_cmd_win.c +++ /dev/null @@ -1,41 +0,0 @@ -#include <stdarg.h> -#include <stddef.h> -#include <setjmp.h> -#include <cmocka.h> -#include <stdlib.h> -#include <glib.h> - -#include "ui/ui.h" -#include "ui/stub_ui.h" - -#include "command/commands.h" - -void cmd_win_shows_message_when_win_doesnt_exist(void **state) -{ - CommandHelp *help = malloc(sizeof(CommandHelp)); - gchar *args[] = { "3", NULL }; - - expect_value(ui_switch_win_num, i, 3); - will_return(ui_switch_win_num, FALSE); - - expect_cons_show("Window 3 does not exist."); - - gboolean result = cmd_win(args, *help); - assert_true(result); - - free(help); -} - -void cmd_win_switches_to_given_win_when_exists(void **state) -{ - CommandHelp *help = malloc(sizeof(CommandHelp)); - gchar *args[] = { "12", NULL }; - - expect_value(ui_switch_win_num, i, 12); - will_return(ui_switch_win_num, TRUE); - - gboolean result = cmd_win(args, *help); - assert_true(result); - - free(help); -} diff --git a/tests/test_cmd_win.h b/tests/test_cmd_win.h deleted file mode 100644 index a0f61a6b..00000000 --- a/tests/test_cmd_win.h +++ /dev/null @@ -1,2 +0,0 @@ -void cmd_win_shows_message_when_win_doesnt_exist(void **state); -void cmd_win_switches_to_given_win_when_exists(void **state); diff --git a/tests/testsuite.c b/tests/testsuite.c index 15682d1f..b4ce1c0a 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -31,7 +31,6 @@ #include "test_cmd_join.h" #include "test_muc.h" #include "test_cmd_roster.h" -#include "test_cmd_win.h" #include "test_cmd_disconnect.h" #include "test_form.h" @@ -586,9 +585,6 @@ int main(int argc, char* argv[]) { unit_test(cmd_roster_clearnick_shows_message_when_no_contact_exists), unit_test(cmd_roster_clearnick_sends_name_change_request_with_empty_nick), - unit_test(cmd_win_shows_message_when_win_doesnt_exist), - unit_test(cmd_win_switches_to_given_win_when_exists), - unit_test(get_form_type_field_returns_null_no_fields), unit_test(get_form_type_field_returns_null_when_not_present), unit_test(get_form_type_field_returns_value_when_present), diff --git a/tests/ui/stub_ui.c b/tests/ui/stub_ui.c index 16933e5d..1f812781 100644 --- a/tests/ui/stub_ui.c +++ b/tests/ui/stub_ui.c @@ -64,17 +64,7 @@ GSList* ui_get_chat_recipients(void) return NULL; } -gboolean ui_switch_win(ProfWin *win) -{ - return FALSE; -} - -gboolean ui_switch_win_num(const int i) -{ - check_expected(i); - return (gboolean)mock(); - return FALSE; -} +void ui_switch_win(ProfWin *win) {} void ui_next_win(void) {} void ui_previous_win(void) {} |