diff options
author | James Booth <boothj5@gmail.com> | 2015-05-30 22:44:41 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-05-30 22:44:41 +0100 |
commit | a5cf83d2595c41fda72f67284b101f509524e659 (patch) | |
tree | 1cf53b43a01bf949383358f77d65218b75676957 | |
parent | 272e9f83fc97141a19af5db447481f37e587cfb3 (diff) | |
download | profani-tty-a5cf83d2595c41fda72f67284b101f509524e659.tar.gz |
Added presence received test
-rw-r--r-- | functionaltests/functionaltests.c | 3 | ||||
-rw-r--r-- | functionaltests/test_presence.c | 25 | ||||
-rw-r--r-- | functionaltests/test_presence.h | 1 |
3 files changed, 29 insertions, 0 deletions
diff --git a/functionaltests/functionaltests.c b/functionaltests/functionaltests.c index e0a4415a..27fa91c9 100644 --- a/functionaltests/functionaltests.c +++ b/functionaltests/functionaltests.c @@ -85,6 +85,9 @@ int main(int argc, char* argv[]) { unit_test_setup_teardown(presence_includes_priority, init_prof_test, close_prof_test), + unit_test_setup_teardown(presence_received, + init_prof_test, + close_prof_test), }; return run_tests(all_tests); diff --git a/functionaltests/test_presence.c b/functionaltests/test_presence.c index 210cdaaf..6129339d 100644 --- a/functionaltests/test_presence.c +++ b/functionaltests/test_presence.c @@ -226,3 +226,28 @@ presence_includes_priority(void **state) )); assert_true(prof_output_exact("Status set to chat (priority 25), \"Free to talk\".")); } + +void +presence_received(void **state) +{ + stbbr_for("roster", + "<iq id=\"roster\" type=\"result\" to=\"stabber@localhost/profanity\">" + "<query xmlns=\"jabber:iq:roster\" ver=\"362\">" + "<item jid=\"buddy1@localhost\" subscription=\"both\" name=\"Buddy1\"/>" + "<item jid=\"buddy2@localhost\" subscription=\"both\" name=\"Buddy2\"/>" + "</query>" + "</iq>" + ); + + prof_connect("stabber@localhost", "password"); + stbbr_wait_for("prof_presence_1"); + + stbbr_send( + "<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">" + "<priority>10</priority>" + "<status>I'm here</status>" + "</presence>" + ); + + assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"")); +} diff --git a/functionaltests/test_presence.h b/functionaltests/test_presence.h index 23fd5d98..0603732a 100644 --- a/functionaltests/test_presence.h +++ b/functionaltests/test_presence.h @@ -10,3 +10,4 @@ void presence_chat(void **state); void presence_chat_with_message(void **state); void presence_set_priority(void **state); void presence_includes_priority(void **state); +void presence_received(void **state); |