#include #include #include #include #include #include #include #include #include #include "proftest.h" void connect_jid(void **state) { prof_connect("stabber@localhost", "password"); assert_true(prof_output_exact("Connecting as stabber@localhost")); assert_true(prof_output_regex("stabber@localhost logged in successfully, .+online.+ \\(priority 0\\)\\.")); } void connect_jid_requests_roster(void **state) { prof_connect("stabber@localhost", "password"); assert_true(stbbr_received( "" )); } void connect_jid_sends_presence_after_receiving_roster(void **state) { stbbr_for_query("jabber:iq:roster", "" "" "" "" "" "" ); prof_connect("stabber@localhost", "password"); assert_true(stbbr_received( "" "" "" )); } void connect_jid_requests_bookmarks(void **state) { prof_connect("stabber@localhost", "password"); assert_true(stbbr_received( "" "" "" "" "" )); } void connect_bad_password(void **state) { prof_connect("stabber@localhost", "badpassword"); assert_true(prof_output_exact("Login failed.")); } void connect_shows_presence_updates(void **state) { stbbr_for_query("jabber:iq:roster", "" "" "" "" "" "" ); stbbr_for_id("prof_presence_1", "" "dnd" "busy!" "" "" "chat" "Talk to me!" "" "" "away" "Out of office" "" ); prof_connect("stabber@localhost", "password"); assert_true(prof_output_exact("Buddy1 (mobile) is dnd, \"busy!\"")); assert_true(prof_output_exact("Buddy1 (laptop) is chat, \"Talk to me!\"")); assert_true(prof_output_exact("Buddy2 (work) is away, \"Out of office\"")); stbbr_send( "" "xa" "Gone :(" "" ); assert_true(prof_output_exact("Buddy1 (mobile) is xa, \"Gone :(\"")); }