diff options
author | James Booth <boothj5@gmail.com> | 2014-01-28 22:37:50 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-01-28 22:37:50 +0000 |
commit | 5afb296e67785725e4462358fcc227e5f28b1a46 (patch) | |
tree | b6aa5b3d87369a9680df51a6f09037d22a3a9faf /tests/ui | |
parent | b231133f9b07e76eb7c3d6df4f01ceb14bcc3cd5 (diff) | |
download | profani-tty-5afb296e67785725e4462358fcc227e5f28b1a46.tar.gz |
Moved error handling logic to server_events
Diffstat (limited to 'tests/ui')
-rw-r--r-- | tests/ui/mock_ui.c | 18 | ||||
-rw-r--r-- | tests/ui/mock_ui.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c index e03b77c5..5e2be5f6 100644 --- a/tests/ui/mock_ui.c +++ b/tests/ui/mock_ui.c @@ -93,6 +93,12 @@ char * _stub_ui_ask_password(void) } static +void _mock_ui_handle_error(const char * const err_msg) +{ + check_expected(err_msg); +} + +static void _stub_ui_chat_win_contact_online(PContact contact, Resource *resource, GDateTime *last_activity) { } @@ -160,6 +166,12 @@ stub_cons_show(void) } void +mock_ui_handle_error(void) +{ + ui_handle_error = _mock_ui_handle_error; +} + +void expect_cons_show(char *output) { expect_string(_mock_cons_show, output, output); @@ -213,3 +225,9 @@ mock_ui_ask_password_returns(char *password) { will_return(_mock_ui_ask_password, strdup(password)); } + +void +expect_ui_handle_error(char *err_msg) +{ + expect_string(_mock_ui_handle_error, err_msg, err_msg); +} diff --git a/tests/ui/mock_ui.h b/tests/ui/mock_ui.h index b0a5a80d..a7a53e53 100644 --- a/tests/ui/mock_ui.h +++ b/tests/ui/mock_ui.h @@ -18,6 +18,9 @@ void stub_ui_chat_win_contact_online(void); void mock_cons_show_error(void); void expect_cons_show_error(char *output); +void mock_ui_handle_error(void); +void expect_ui_handle_error(char *err_msg); + void mock_cons_show_account(void); void expect_cons_show_account(ProfAccount *account); |