about summary refs log tree commit diff stats
path: root/tests/functionaltests/test_ping.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2017-06-15 23:27:30 +0100
committerJames Booth <boothj5@gmail.com>2017-06-15 23:27:30 +0100
commit6511d61b139d95851620052f7734703817cdec46 (patch)
tree148e933a74118aa3a91b1f79b694e06a320509c4 /tests/functionaltests/test_ping.c
parentcbaa419a3174ced94ec5071dcd01a2da68500fce (diff)
downloadprofani-tty-6511d61b139d95851620052f7734703817cdec46.tar.gz
Show message when server does not support ping
Diffstat (limited to 'tests/functionaltests/test_ping.c')
-rw-r--r--tests/functionaltests/test_ping.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/functionaltests/test_ping.c b/tests/functionaltests/test_ping.c
index ecbbfee1..99b0c7ce 100644
--- a/tests/functionaltests/test_ping.c
+++ b/tests/functionaltests/test_ping.c
@@ -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'/>"
     );
@@ -41,6 +50,23 @@ ping_multiple(void **state)
 }
 
 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)
 {
     prof_connect();