about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-02-16 20:15:10 +0000
committerJames Booth <boothj5@gmail.com>2014-02-16 20:15:10 +0000
commit6e58d95469d289058b4d5bf6325ade01caf40ca3 (patch)
tree5b80397a512da02a1474e84fab6fa1c76fde7a0c
parent880d5c62639e2b885a441f01631eaab27b9c19a8 (diff)
downloadprofani-tty-6e58d95469d289058b4d5bf6325ade01caf40ca3.tar.gz
Added connection status tests for /otr myfp
-rw-r--r--tests/test_cmd_otr.c26
-rw-r--r--tests/test_cmd_otr.h5
-rw-r--r--tests/testsuite.c5
3 files changed, 36 insertions, 0 deletions
diff --git a/tests/test_cmd_otr.c b/tests/test_cmd_otr.c
index a3fbd132..f4469ae5 100644
--- a/tests/test_cmd_otr.c
+++ b/tests/test_cmd_otr.c
@@ -341,6 +341,32 @@ void cmd_otr_gen_generates_key_for_connected_account(void **state)
 
     free(help);
 }
+
+void cmd_otr_myfp_shows_message_when_disconnected(void **state)
+{
+    test_with_command_and_connection_status("myfp", JABBER_DISCONNECTED);
+}
+
+void cmd_otr_myfp_shows_message_when_undefined(void **state)
+{
+    test_with_command_and_connection_status("myfp", JABBER_UNDEFINED);
+}
+
+void cmd_otr_myfp_shows_message_when_started(void **state)
+{
+    test_with_command_and_connection_status("myfp", JABBER_STARTED);
+}
+
+void cmd_otr_myfp_shows_message_when_connecting(void **state)
+{
+    test_with_command_and_connection_status("myfp", JABBER_CONNECTING);
+}
+
+void cmd_otr_myfp_shows_message_when_disconnecting(void **state)
+{
+    test_with_command_and_connection_status("myfp", JABBER_DISCONNECTING);
+}
+
 #else
 void cmd_otr_shows_message_when_otr_unsupported(void **state)
 {
diff --git a/tests/test_cmd_otr.h b/tests/test_cmd_otr.h
index 224b7bd6..e645867d 100644
--- a/tests/test_cmd_otr.h
+++ b/tests/test_cmd_otr.h
@@ -22,6 +22,11 @@ void cmd_otr_gen_shows_message_when_undefined(void **state);
 void cmd_otr_gen_shows_message_when_started(void **state);
 void cmd_otr_gen_shows_message_when_connecting(void **state);
 void cmd_otr_gen_shows_message_when_disconnecting(void **state);
+void cmd_otr_myfp_shows_message_when_disconnected(void **state);
+void cmd_otr_myfp_shows_message_when_undefined(void **state);
+void cmd_otr_myfp_shows_message_when_started(void **state);
+void cmd_otr_myfp_shows_message_when_connecting(void **state);
+void cmd_otr_myfp_shows_message_when_disconnecting(void **state);
 #else
 void cmd_otr_shows_message_when_otr_unsupported(void **state);
 #endif
diff --git a/tests/testsuite.c b/tests/testsuite.c
index 4c539d2c..e1b95b2e 100644
--- a/tests/testsuite.c
+++ b/tests/testsuite.c
@@ -463,6 +463,11 @@ int main(int argc, char* argv[]) {
         unit_test(cmd_otr_gen_shows_message_when_started),
         unit_test(cmd_otr_gen_shows_message_when_connecting),
         unit_test(cmd_otr_gen_shows_message_when_disconnecting),
+        unit_test(cmd_otr_myfp_shows_message_when_disconnected),
+        unit_test(cmd_otr_myfp_shows_message_when_undefined),
+        unit_test(cmd_otr_myfp_shows_message_when_started),
+        unit_test(cmd_otr_myfp_shows_message_when_connecting),
+        unit_test(cmd_otr_myfp_shows_message_when_disconnecting),
 #else
         unit_test(cmd_otr_shows_message_when_otr_unsupported),
 #endif