1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Reimplemented stabber presence test

This commit is contained in:
James Booth 2015-05-27 19:48:25 +01:00
parent db9376d82b
commit 3760084680
3 changed files with 39 additions and 54 deletions

View File

@ -31,9 +31,9 @@ int main(int argc, char* argv[]) {
unit_test_setup_teardown(connect_bad_password, unit_test_setup_teardown(connect_bad_password,
init_prof_test, init_prof_test,
close_prof_test), close_prof_test),
// unit_test_setup_teardown(show_presence_updates, unit_test_setup_teardown(show_presence_updates,
// init_prof_test, init_prof_test,
// close_prof_test), close_prof_test),
// unit_test_setup_teardown(sends_rooms_iq, // unit_test_setup_teardown(sends_rooms_iq,
// init_prof_test, // init_prof_test,
// close_prof_test), // close_prof_test),

View File

@ -84,56 +84,41 @@ connect_bad_password(void **state)
assert_true(prof_output("Login failed.")); assert_true(prof_output("Login failed."));
} }
//void void
//show_presence_updates(void **state) show_presence_updates(void **state)
//{ {
// will_return(ui_ask_password, strdup("password")); stbbr_for("roster",
// expect_any_cons_show(); "<iq id=\"roster\" type=\"result\" to=\"stabber@localhost/profanity\">"
// "<query xmlns=\"jabber:iq:roster\" ver=\"362\">"
// stbbr_for("roster", "<item jid=\"buddy1@localhost\" subscription=\"both\" name=\"Buddy1\"/>"
// "<iq id=\"roster\" type=\"result\" to=\"stabber@localhost/profanity\">" "<item jid=\"buddy2@localhost\" subscription=\"both\" name=\"Buddy2\"/>"
// "<query xmlns=\"jabber:iq:roster\" ver=\"362\">" "</query>"
// "<item jid=\"buddy1@localhost\" subscription=\"both\" name=\"Buddy1\"/>" "</iq>"
// "<item jid=\"buddy2@localhost\" subscription=\"both\" name=\"Buddy2\"/>" );
// "</query>"
// "</iq>" prof_input("/connect stabber@localhost port 5230");
// ); prof_input("password");
// assert_true(prof_output("stabber@localhost logged in successfully"));
// cmd_process_input(strdup("/connect stabber@localhost port 5230"));
// prof_process_xmpp(20); stbbr_send(
// "<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
// stbbr_send( "<show>dnd</show>"
// "<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">" "<status>busy!</status>"
// "<show>dnd</show>" "</presence>"
// "<status>busy!</status>" "<presence to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\">"
// "</presence>" "<show>chat</show>"
// "<presence to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\">" "<status>Talk to me!</status>"
// "<show>chat</show>" "</presence>"
// "<status>Talk to me!</status>" "<presence to=\"stabber@localhost\" from=\"buddy2@localhost/work\">"
// "</presence>" "<show>away</show>"
// "<presence to=\"stabber@localhost\" from=\"buddy2@localhost/work\">" "<status>Out of office</status>"
// "<show>away</show>" "</presence>"
// "<status>Out of office</status>" );
// "</presence>"
// ); assert_true(prof_output("Buddy1 (mobile) is dnd"));
// assert_true(prof_output("Buddy1 (laptop) is chat"));
// Resource *resource1 = resource_new("mobile", RESOURCE_DND, "busy!", 0); assert_true(prof_output("Buddy2 (work) is away"));
// expect_string(ui_contact_online, barejid, "buddy1@localhost"); }
// expect_check(ui_contact_online, resource, (CheckParameterValue)resource_equal_check, resource1);
// expect_value(ui_contact_online, last_activity, NULL);
//
// Resource *resource2 = resource_new("laptop", RESOURCE_CHAT, "Talk to me!", 0);
// expect_string(ui_contact_online, barejid, "buddy1@localhost");
// expect_check(ui_contact_online, resource, (CheckParameterValue)resource_equal_check, resource2);
// expect_value(ui_contact_online, last_activity, NULL);
//
// Resource *resource3 = resource_new("work", RESOURCE_AWAY, "Out of office", 0);
// expect_string(ui_contact_online, barejid, "buddy2@localhost");
// expect_check(ui_contact_online, resource, (CheckParameterValue)resource_equal_check, resource3);
// expect_value(ui_contact_online, last_activity, NULL);
//
// prof_process_xmpp(20);
//}
// //
//void //void
//sends_rooms_iq(void **state) //sends_rooms_iq(void **state)

View File

@ -3,7 +3,7 @@ void connect_jid_requests_roster(void **state);
void connect_jid_sends_presence_after_receiving_roster(void **state); void connect_jid_sends_presence_after_receiving_roster(void **state);
void connect_jid_requests_bookmarks(void **state); void connect_jid_requests_bookmarks(void **state);
void connect_bad_password(void **state); void connect_bad_password(void **state);
//void show_presence_updates(void **state); void show_presence_updates(void **state);
//void sends_rooms_iq(void **state); //void sends_rooms_iq(void **state);
//void multiple_pings(void **state); //void multiple_pings(void **state);
//void responds_to_ping(void **state); //void responds_to_ping(void **state);