about summary refs log tree commit diff stats
path: root/tests/ui/mock_ui.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-20 18:40:48 +0000
committerJames Booth <boothj5@gmail.com>2014-01-20 18:40:48 +0000
commita7a28506376ff3ddf9eef5a6b3b140f8cb9c1da7 (patch)
tree606d671d0280b7c79104de31be3696a2c5d9ce55 /tests/ui/mock_ui.c
parent3f0addbc99bb7bf29c9a2b3b122200b8d4be7e23 (diff)
downloadprofani-tty-a7a28506376ff3ddf9eef5a6b3b140f8cb9c1da7.tar.gz
WIP - /statuses command options
Diffstat (limited to 'tests/ui/mock_ui.c')
-rw-r--r--tests/ui/mock_ui.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c
index 83119910..cd6c62ff 100644
--- a/tests/ui/mock_ui.c
+++ b/tests/ui/mock_ui.c
@@ -45,6 +45,14 @@ void _stub_cons_show(const char * const msg, ...)
 }
 
 static
+void _mock_cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity)
+{
+    check_expected(contact);
+    check_expected(resource);
+    check_expected(last_activity);
+}
+
+static
 void _mock_cons_show_error(const char * const msg, ...)
 {
     va_list args;
@@ -78,6 +86,11 @@ char * _stub_ui_ask_password(void)
     return NULL;
 }
 
+static
+void _stub_ui_chat_win_contact_online(PContact contact, Resource *resource, GDateTime *last_activity)
+{
+}
+
 void
 mock_cons_show(void)
 {
@@ -86,6 +99,18 @@ mock_cons_show(void)
 }
 
 void
+mock_cons_show_contact_online(void)
+{
+    cons_show_contact_online = _mock_cons_show_contact_online;
+}
+
+void
+stub_ui_chat_win_contact_online(void)
+{
+    ui_chat_win_contact_online = _stub_ui_chat_win_contact_online;
+}
+
+void
 mock_cons_show_error(void)
 {
     cons_show_error = _mock_cons_show_error;
@@ -153,6 +178,18 @@ expect_cons_show_account_list(gchar **accounts)
 }
 
 void
+expect_cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity)
+{
+    expect_memory(_mock_cons_show_contact_online, contact, contact, sizeof(contact));
+    expect_memory(_mock_cons_show_contact_online, resource, resource, sizeof(Resource));
+    if (last_activity == NULL) {
+        expect_any(_mock_cons_show_contact_online, last_activity);
+    } else {
+        expect_memory(_mock_cons_show_contact_online, last_activity, last_activity, sizeof(last_activity));
+    }
+}
+
+void
 mock_ui_ask_password_returns(char *password)
 {
     will_return(_mock_ui_ask_password, strdup(password));