Added cmd_win test

This commit is contained in:
James Booth
2014-04-01 23:14:53 +01:00
parent 404dde2810
commit 96e32fe178
4 changed files with 27 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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