diff options
Diffstat (limited to 'tests/ui')
-rw-r--r-- | tests/ui/mock_ui.c | 20 | ||||
-rw-r--r-- | tests/ui/mock_ui.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c index 67eb51e8..5dc52a10 100644 --- a/tests/ui/mock_ui.c +++ b/tests/ui/mock_ui.c @@ -177,6 +177,13 @@ void _mock_cons_show_roster(GSList *list) check_expected(list); } +static +gboolean _mock_ui_win_exists(int index) +{ + check_expected(index); + return (gboolean)mock(); +} + // bind mocks and stubs void @@ -288,6 +295,12 @@ mock_cons_show_roster(void) cons_show_roster = _mock_cons_show_roster; } +void +mock_ui_win_exists(void) +{ + ui_win_exists = _mock_ui_win_exists; +} + // expectations void @@ -438,3 +451,10 @@ cons_show_roster_expect(GSList *list) { expect_any(_mock_cons_show_roster, list); } + +void +ui_win_exists_expect_and_return(int given_index, gboolean result) +{ + expect_value(_mock_ui_win_exists, index, given_index); + will_return(_mock_ui_win_exists, result); +} diff --git a/tests/ui/mock_ui.h b/tests/ui/mock_ui.h index 55b036e6..c939a002 100644 --- a/tests/ui/mock_ui.h +++ b/tests/ui/mock_ui.h @@ -64,4 +64,7 @@ void ui_room_join_expect(char *room); void mock_cons_show_roster(void); void cons_show_roster_expect(GSList *list); +void mock_ui_win_exists(void); +void ui_win_exists_expect_and_return(int given_index, gboolean result); + #endif |