From e1e0fda8b307270045a744f1325e8d88032f65b9 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 5 Jan 2016 01:30:32 +0000 Subject: Call UI disconnect functions before disconnecting with /disconnect fixes #703 --- tests/functionaltests/functionaltests.c | 3 +++ tests/functionaltests/test_disconnect.c | 24 ++++++++++++++++++++++++ tests/functionaltests/test_disconnect.h | 1 + 3 files changed, 28 insertions(+) create mode 100644 tests/functionaltests/test_disconnect.c create mode 100644 tests/functionaltests/test_disconnect.h (limited to 'tests/functionaltests') diff --git a/tests/functionaltests/functionaltests.c b/tests/functionaltests/functionaltests.c index 751306c0..878561dc 100644 --- a/tests/functionaltests/functionaltests.c +++ b/tests/functionaltests/functionaltests.c @@ -21,6 +21,7 @@ #include "test_roster.h" #include "test_software.h" #include "test_muc.h" +#include "test_disconnect.h" #define PROF_FUNC_TEST(test) unit_test_setup_teardown(test, init_prof_test, close_prof_test) @@ -98,6 +99,8 @@ int main(int argc, char* argv[]) { PROF_FUNC_TEST(shows_all_messages_in_console_when_window_not_focussed), PROF_FUNC_TEST(shows_first_message_in_console_when_window_not_focussed), PROF_FUNC_TEST(shows_no_message_in_console_when_window_not_focussed), + + PROF_FUNC_TEST(disconnect_ends_session), }; return run_tests(all_tests); diff --git a/tests/functionaltests/test_disconnect.c b/tests/functionaltests/test_disconnect.c new file mode 100644 index 00000000..7529da18 --- /dev/null +++ b/tests/functionaltests/test_disconnect.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "proftest.h" + +void +disconnect_ends_session(void **state) +{ + prof_connect(); + + prof_input("/disconnect"); + assert_true(prof_output_exact("stabber@localhost/profanity logged out successfully.")); + + prof_input("/roster"); + assert_true(prof_output_exact("You are not currently connected.")); +} diff --git a/tests/functionaltests/test_disconnect.h b/tests/functionaltests/test_disconnect.h new file mode 100644 index 00000000..2024269a --- /dev/null +++ b/tests/functionaltests/test_disconnect.h @@ -0,0 +1 @@ +void disconnect_ends_session(void **state); -- cgit 1.4.1-2-gfad0