about summary refs log tree commit diff stats
path: root/tests/unittests/test_cmd_connect.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-05-05 23:51:49 +0100
committerJames Booth <boothj5@gmail.com>2016-05-05 23:51:49 +0100
commit3bb1f1241050d227932d5153abf49fdce9939efb (patch)
tree9c8f317581a7aac2d7ab914a454eaf80cd21d643 /tests/unittests/test_cmd_connect.c
parentf6fa63b374cdc07084a472a2067546879809ec89 (diff)
downloadprofani-tty-3bb1f1241050d227932d5153abf49fdce9939efb.tar.gz
Add session.c
Diffstat (limited to 'tests/unittests/test_cmd_connect.c')
-rw-r--r--tests/unittests/test_cmd_connect.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/unittests/test_cmd_connect.c b/tests/unittests/test_cmd_connect.c
index 53c4c940..3e592e11 100644
--- a/tests/unittests/test_cmd_connect.c
+++ b/tests/unittests/test_cmd_connect.c
@@ -18,7 +18,7 @@
 
 static void test_with_connection_status(jabber_conn_status_t status)
 {
-    will_return(jabber_get_connection_status, status);
+    will_return(connection_get_status, status);
 
     expect_cons_show("You are either connected already, or a login is in process.");
 
@@ -50,7 +50,7 @@ void cmd_connect_when_no_account(void **state)
 {
     gchar *args[] = { "user@server.org", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(accounts_get_account, name, "user@server.org");
     will_return(accounts_get_account, NULL);
@@ -73,7 +73,7 @@ void cmd_connect_fail_message(void **state)
 {
     gchar *args[] = { "user@server.org", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_any(accounts_get_account, name);
     will_return(accounts_get_account, NULL);
@@ -98,7 +98,7 @@ void cmd_connect_lowercases_argument(void **state)
 {
     gchar *args[] = { "USER@server.ORG", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(accounts_get_account, name, "user@server.org");
     will_return(accounts_get_account, NULL);
@@ -123,7 +123,7 @@ void cmd_connect_asks_password_when_not_in_account(void **state)
     ProfAccount *account = account_new("jabber_org", "me@jabber.org", NULL, NULL,
         TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_any(accounts_get_account, name);
     will_return(accounts_get_account, account);
@@ -143,7 +143,7 @@ void cmd_connect_shows_usage_when_no_server_value(void **state)
 {
     gchar *args[] = { "user@server.org", "server", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
     expect_cons_show("");
@@ -156,7 +156,7 @@ void cmd_connect_shows_usage_when_server_no_port_value(void **state)
 {
     gchar *args[] = { "user@server.org", "server", "aserver", "port", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
     expect_cons_show("");
@@ -169,7 +169,7 @@ void cmd_connect_shows_usage_when_no_port_value(void **state)
 {
     gchar *args[] = { "user@server.org", "port", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
     expect_cons_show("");
@@ -182,7 +182,7 @@ void cmd_connect_shows_usage_when_port_no_server_value(void **state)
 {
     gchar *args[] = { "user@server.org", "port", "5678", "server", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
     expect_cons_show("");
@@ -195,7 +195,7 @@ void cmd_connect_shows_message_when_port_0(void **state)
 {
     gchar *args[] = { "user@server.org", "port", "0", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_cons_show("Value 0 out of range. Must be in 1..65535.");
     expect_cons_show("");
@@ -208,7 +208,7 @@ void cmd_connect_shows_message_when_port_minus1(void **state)
 {
     gchar *args[] = { "user@server.org", "port", "-1", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_cons_show("Value -1 out of range. Must be in 1..65535.");
     expect_cons_show("");
@@ -221,7 +221,7 @@ void cmd_connect_shows_message_when_port_65536(void **state)
 {
     gchar *args[] = { "user@server.org", "port", "65536", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_cons_show("Value 65536 out of range. Must be in 1..65535.");
     expect_cons_show("");
@@ -234,7 +234,7 @@ void cmd_connect_shows_message_when_port_contains_chars(void **state)
 {
     gchar *args[] = { "user@server.org", "port", "52f66", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_cons_show("Could not convert \"52f66\" to a number.");
     expect_cons_show("");
@@ -247,7 +247,7 @@ void cmd_connect_shows_usage_when_server_provided_twice(void **state)
 {
     gchar *args[] = { "user@server.org", "server", "server1", "server", "server2", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
     expect_cons_show("");
@@ -260,7 +260,7 @@ void cmd_connect_shows_usage_when_port_provided_twice(void **state)
 {
     gchar *args[] = { "user@server.org", "port", "1111", "port", "1111", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
     expect_cons_show("");
@@ -273,7 +273,7 @@ void cmd_connect_shows_usage_when_invalid_first_property(void **state)
 {
     gchar *args[] = { "user@server.org", "wrong", "server", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
     expect_cons_show("");
@@ -286,7 +286,7 @@ void cmd_connect_shows_usage_when_invalid_second_property(void **state)
 {
     gchar *args[] = { "user@server.org", "server", "aserver", "wrong", "1234", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
     expect_cons_show("");
@@ -299,7 +299,7 @@ void cmd_connect_with_server_when_provided(void **state)
 {
     gchar *args[] = { "user@server.org", "server", "aserver", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(accounts_get_account, name, "user@server.org");
     will_return(accounts_get_account, NULL);
@@ -322,7 +322,7 @@ void cmd_connect_with_port_when_provided(void **state)
 {
     gchar *args[] = { "user@server.org", "port", "5432", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(accounts_get_account, name, "user@server.org");
     will_return(accounts_get_account, NULL);
@@ -345,7 +345,7 @@ void cmd_connect_with_server_and_port_when_provided(void **state)
 {
     gchar *args[] = { "user@server.org", "port", "5432", "server", "aserver", NULL };
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_string(accounts_get_account, name, "user@server.org");
     will_return(accounts_get_account, NULL);
@@ -370,7 +370,7 @@ void cmd_connect_shows_message_when_connecting_with_account(void **state)
     ProfAccount *account = account_new("jabber_org", "user@jabber.org", "password", NULL,
         TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_any(accounts_get_account, name);
     will_return(accounts_get_account, account);
@@ -390,7 +390,7 @@ void cmd_connect_connects_with_account(void **state)
     ProfAccount *account = account_new("jabber_org", "me@jabber.org", "password", NULL,
         TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 
-    will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
+    will_return(connection_get_status, JABBER_DISCONNECTED);
 
     expect_any(accounts_get_account, name);
     will_return(accounts_get_account, account);