From a7a28506376ff3ddf9eef5a6b3b140f8cb9c1da7 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 20 Jan 2014 18:40:48 +0000 Subject: WIP - /statuses command options --- tests/ui/mock_ui.c | 37 +++++++++++++++++++++++++++++++++++++ tests/ui/mock_ui.h | 4 ++++ 2 files changed, 41 insertions(+) (limited to 'tests/ui') 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 @@ -44,6 +44,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, ...) { @@ -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) { @@ -85,6 +98,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) { @@ -152,6 +177,18 @@ expect_cons_show_account_list(gchar **accounts) expect_memory(_mock_cons_show_account_list, accounts, accounts, sizeof(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) { diff --git a/tests/ui/mock_ui.h b/tests/ui/mock_ui.h index 2833be29..6f6d34d7 100644 --- a/tests/ui/mock_ui.h +++ b/tests/ui/mock_ui.h @@ -11,6 +11,10 @@ void mock_cons_show(void); void expect_cons_show(char *output); void expect_cons_show_calls(int n); +void mock_cons_show_contact_online(void); +void expect_cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity); +void stub_ui_chat_win_contact_online(void); + void mock_cons_show_error(void); void expect_cons_show_error(char *output); -- cgit 1.4.1-2-gfad0