diff options
author | James Booth <boothj5@gmail.com> | 2014-02-17 21:52:42 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-02-17 21:52:42 +0000 |
commit | 82ad0cd306968ae6821127829e9d52f01932e82e (patch) | |
tree | 2f51ef1906072a784d57685d3d836307960260d8 /tests/ui/mock_ui.c | |
parent | 6e58d95469d289058b4d5bf6325ade01caf40ca3 (diff) | |
download | profani-tty-82ad0cd306968ae6821127829e9d52f01932e82e.tar.gz |
Added /otr myfp test
Diffstat (limited to 'tests/ui/mock_ui.c')
-rw-r--r-- | tests/ui/mock_ui.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c index 7175d2b9..af9d1a6b 100644 --- a/tests/ui/mock_ui.c +++ b/tests/ui/mock_ui.c @@ -159,6 +159,18 @@ void _stub_ui_current_refresh(void) { } +static +void _mock_ui_current_print_formatted_line(const char show_char, int attrs, const char * const msg, ...) +{ + check_expected(show_char); + check_expected(attrs); + va_list args; + va_start(args, msg); + vsnprintf(output, sizeof(output), msg, args); + check_expected(output); + va_end(args); +} + // bind mocks and stubs void @@ -252,6 +264,12 @@ stub_ui_current_refresh(void) ui_current_refresh = _stub_ui_current_refresh; } +void +mock_ui_current_print_formatted_line(void) +{ + ui_current_print_formatted_line = _mock_ui_current_print_formatted_line; +} + // expectations void @@ -368,3 +386,11 @@ ui_current_recipient_returns(char *jid) { will_return(_mock_ui_current_recipeint, jid); } + +void +ui_current_print_formatted_line_expect(char show_char, int attrs, char *message) +{ + expect_value(_mock_ui_current_print_formatted_line, show_char, show_char); + expect_value(_mock_ui_current_print_formatted_line, attrs, attrs); + expect_string(_mock_ui_current_print_formatted_line, output, message); +} |