Show message when server does not support ping
This commit is contained in:
@@ -36,6 +36,7 @@ int main(int argc, char* argv[]) {
|
||||
PROF_FUNC_TEST(connect_shows_presence_updates),
|
||||
|
||||
PROF_FUNC_TEST(ping_multiple),
|
||||
PROF_FUNC_TEST(ping_not_supported),
|
||||
PROF_FUNC_TEST(ping_responds),
|
||||
|
||||
PROF_FUNC_TEST(rooms_query),
|
||||
|
||||
@@ -14,6 +14,15 @@
|
||||
void
|
||||
ping_multiple(void **state)
|
||||
{
|
||||
stbbr_for_id("prof_disco_info_onconnect_2",
|
||||
"<iq id='prof_disco_info_onconnect_2' to='stabber@localhost/profanity' type='result' from='localhost'>"
|
||||
"<query xmlns='http://jabber.org/protocol/disco#info'>"
|
||||
"<identity category='server' type='im' name='Prosody'/>"
|
||||
"<feature var='urn:xmpp:ping'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
);
|
||||
|
||||
stbbr_for_id("prof_ping_4",
|
||||
"<iq id='prof_ping_4' type='result' to='stabber@localhost/profanity'/>"
|
||||
);
|
||||
@@ -40,6 +49,23 @@ ping_multiple(void **state)
|
||||
assert_true(prof_output_exact("Ping response from server"));
|
||||
}
|
||||
|
||||
void
|
||||
ping_not_supported(void **state)
|
||||
{
|
||||
stbbr_for_id("prof_disco_info_onconnect_2",
|
||||
"<iq id='prof_disco_info_onconnect_2' to='stabber@localhost/profanity' type='result' from='localhost'>"
|
||||
"<query xmlns='http://jabber.org/protocol/disco#info'>"
|
||||
"<identity category='server' type='im' name='Prosody'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
);
|
||||
|
||||
prof_connect();
|
||||
|
||||
prof_input("/ping");
|
||||
assert_true(prof_output_exact("Server does not support ping requests."));
|
||||
}
|
||||
|
||||
void
|
||||
ping_responds(void **state)
|
||||
{
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
void ping_multiple(void **state);
|
||||
void ping_not_supported(void **state);
|
||||
void ping_responds(void **state);
|
||||
|
||||
Reference in New Issue
Block a user