mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Added presence received test
This commit is contained in:
parent
272e9f83fc
commit
a5cf83d259
@ -85,6 +85,9 @@ int main(int argc, char* argv[]) {
|
|||||||
unit_test_setup_teardown(presence_includes_priority,
|
unit_test_setup_teardown(presence_includes_priority,
|
||||||
init_prof_test,
|
init_prof_test,
|
||||||
close_prof_test),
|
close_prof_test),
|
||||||
|
unit_test_setup_teardown(presence_received,
|
||||||
|
init_prof_test,
|
||||||
|
close_prof_test),
|
||||||
};
|
};
|
||||||
|
|
||||||
return run_tests(all_tests);
|
return run_tests(all_tests);
|
||||||
|
@ -226,3 +226,28 @@ presence_includes_priority(void **state)
|
|||||||
));
|
));
|
||||||
assert_true(prof_output_exact("Status set to chat (priority 25), \"Free to talk\"."));
|
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\""));
|
||||||
|
}
|
||||||
|
@ -10,3 +10,4 @@ void presence_chat(void **state);
|
|||||||
void presence_chat_with_message(void **state);
|
void presence_chat_with_message(void **state);
|
||||||
void presence_set_priority(void **state);
|
void presence_set_priority(void **state);
|
||||||
void presence_includes_priority(void **state);
|
void presence_includes_priority(void **state);
|
||||||
|
void presence_received(void **state);
|
||||||
|
Loading…
Reference in New Issue
Block a user