diff options
author | James Booth <boothj5@gmail.com> | 2015-08-05 00:48:50 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-08-05 00:48:50 +0100 |
commit | ac3e7dd9e899013ca08ed7fbe3b0cfcbd823f7bd (patch) | |
tree | f02212794bd84b71af71d463d3cb37b92d5032ac /tests/functionaltests | |
parent | 2a92169351f88ab3bfe1acf15628878c5e8ef520 (diff) | |
download | profani-tty-ac3e7dd9e899013ca08ed7fbe3b0cfcbd823f7bd.tar.gz |
Handle software version requests for gateways that return from domainpart
Diffstat (limited to 'tests/functionaltests')
-rw-r--r-- | tests/functionaltests/functionaltests.c | 1 | ||||
-rw-r--r-- | tests/functionaltests/test_presence.c | 1 | ||||
-rw-r--r-- | tests/functionaltests/test_software.c | 28 | ||||
-rw-r--r-- | tests/functionaltests/test_software.h | 1 |
4 files changed, 31 insertions, 0 deletions
diff --git a/tests/functionaltests/functionaltests.c b/tests/functionaltests/functionaltests.c index cbedf401..a9dfea68 100644 --- a/tests/functionaltests/functionaltests.c +++ b/tests/functionaltests/functionaltests.c @@ -80,6 +80,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), + PROF_FUNC_TEST(display_software_version_result_when_from_domainpart), }; return run_tests(all_tests); diff --git a/tests/functionaltests/test_presence.c b/tests/functionaltests/test_presence.c index 936d9405..7f37f2fd 100644 --- a/tests/functionaltests/test_presence.c +++ b/tests/functionaltests/test_presence.c @@ -242,6 +242,7 @@ presence_received(void **state) assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"")); } +// Typical use case for gateways that don't support resources void presence_missing_resource_defaults(void **state) { diff --git a/tests/functionaltests/test_software.c b/tests/functionaltests/test_software.c index 9b063c20..08c3edff 100644 --- a/tests/functionaltests/test_software.c +++ b/tests/functionaltests/test_software.c @@ -82,3 +82,31 @@ shows_message_when_software_version_error(void **state) prof_output_exact("Could not get software version: service-unavailable"); } + +// Typical use case for gateways that don't support resources +void +display_software_version_result_when_from_domainpart(void **state) +{ + prof_connect(); + stbbr_send( + "<presence to=\"stabber@localhost\" from=\"buddy1@localhost\">" + "<priority>10</priority>" + "<status>I'm here</status>" + "</presence>" + ); + prof_output_exact("Buddy1 is online, \"I'm here\""); + + stbbr_for_query("jabber:iq:version", + "<iq id=\"*\" type=\"result\" lang=\"en\" to=\"stabber@localhost/profanity\" from=\"localhost\">" + "<query xmlns=\"jabber:iq:version\">" + "<name>Some Gateway</name>" + "<version>1.0</version>" + "</query>" + "</iq>" + ); + prof_input("/software buddy1@localhost/__prof_default"); + + prof_output_exact("buddy1@localhost/__prof_default:"); + prof_output_exact("Name : Some Gateway"); + prof_output_exact("Version : 1.0"); +} diff --git a/tests/functionaltests/test_software.h b/tests/functionaltests/test_software.h index 985d7002..6d75f049 100644 --- a/tests/functionaltests/test_software.h +++ b/tests/functionaltests/test_software.h @@ -1,4 +1,5 @@ void send_software_version_request(void **state); void display_software_version_result(void **state); void shows_message_when_software_version_error(void **state); +void display_software_version_result_when_from_domainpart(void **state); |