From 2a92169351f88ab3bfe1acf15628878c5e8ef520 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 5 Aug 2015 00:26:29 +0100 Subject: Use id handler for software version requests, handle errors --- tests/functionaltests/functionaltests.c | 1 + tests/functionaltests/test_software.c | 25 +++++++++++++++++++++++++ tests/functionaltests/test_software.h | 1 + 3 files changed, 27 insertions(+) (limited to 'tests/functionaltests') diff --git a/tests/functionaltests/functionaltests.c b/tests/functionaltests/functionaltests.c index a253fe63..cbedf401 100644 --- a/tests/functionaltests/functionaltests.c +++ b/tests/functionaltests/functionaltests.c @@ -79,6 +79,7 @@ int main(int argc, char* argv[]) { PROF_FUNC_TEST(send_software_version_request), PROF_FUNC_TEST(display_software_version_result), + PROF_FUNC_TEST(shows_message_when_software_version_error), }; return run_tests(all_tests); diff --git a/tests/functionaltests/test_software.c b/tests/functionaltests/test_software.c index aeb3f8f5..9b063c20 100644 --- a/tests/functionaltests/test_software.c +++ b/tests/functionaltests/test_software.c @@ -57,3 +57,28 @@ display_software_version_result(void **state) prof_output_exact("Name : Profanity"); prof_output_exact("Version : 0.4.7dev.master.2cb2f83"); } + +void +shows_message_when_software_version_error(void **state) +{ + prof_connect(); + stbbr_send( + "" + "10" + "I'm here" + "" + ); + prof_output_exact("Buddy1 (mobile) is online, \"I'm here\""); + + stbbr_for_query("jabber:iq:version", + "" + "" + "" + "" + "" + "" + ); + prof_input("/software buddy1@localhost/laptop"); + + prof_output_exact("Could not get software version: service-unavailable"); +} diff --git a/tests/functionaltests/test_software.h b/tests/functionaltests/test_software.h index b031e264..985d7002 100644 --- a/tests/functionaltests/test_software.h +++ b/tests/functionaltests/test_software.h @@ -1,3 +1,4 @@ void send_software_version_request(void **state); void display_software_version_result(void **state); +void shows_message_when_software_version_error(void **state); -- cgit