From a5cf83d2595c41fda72f67284b101f509524e659 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 30 May 2015 22:44:41 +0100 Subject: Added presence received test --- functionaltests/functionaltests.c | 3 +++ functionaltests/test_presence.c | 25 +++++++++++++++++++++++++ functionaltests/test_presence.h | 1 + 3 files changed, 29 insertions(+) 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", + "" + "" + "" + "" + "" + "" + ); + + prof_connect("stabber@localhost", "password"); + stbbr_wait_for("prof_presence_1"); + + stbbr_send( + "" + "10" + "I'm here" + "" + ); + + 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); -- cgit 1.4.1-2-gfad0