diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functionaltests/functionaltests.c | 1 | ||||
-rw-r--r-- | tests/functionaltests/test_software.c | 25 | ||||
-rw-r--r-- | tests/functionaltests/test_software.h | 1 |
3 files changed, 27 insertions, 0 deletions
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( + "<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">" + "<priority>10</priority>" + "<status>I'm here</status>" + "</presence>" + ); + prof_output_exact("Buddy1 (mobile) is online, \"I'm here\""); + + stbbr_for_query("jabber:iq:version", + "<iq id=\"*\" lang=\"en\" type=\"error\" to=\"stabber@localhost/profanity\" from=\"buddy1@localhost/laptop\">" + "<query xmlns=\"jabber:iq:version\"/>" + "<error code=\"503\" type=\"cancel\">" + "<service-unavailable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"/>" + "</error>" + "</iq>" + ); + 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); |