mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Added test for valid window switch
This commit is contained in:
parent
96e32fe178
commit
7113b97952
@ -521,6 +521,7 @@ int main(int argc, char* argv[]) {
|
|||||||
unit_test(cmd_roster_clearnick_sends_name_change_request_with_empty_nick),
|
unit_test(cmd_roster_clearnick_sends_name_change_request_with_empty_nick),
|
||||||
|
|
||||||
unit_test(cmd_win_shows_message_when_win_doesnt_exist),
|
unit_test(cmd_win_shows_message_when_win_doesnt_exist),
|
||||||
|
unit_test(cmd_win_switches_to_given_win_when_exists),
|
||||||
};
|
};
|
||||||
|
|
||||||
return run_tests(all_tests);
|
return run_tests(all_tests);
|
||||||
|
@ -184,13 +184,18 @@ gboolean _mock_ui_win_exists(int index)
|
|||||||
return (gboolean)mock();
|
return (gboolean)mock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
void _mock_ui_switch_win(const int i)
|
||||||
|
{
|
||||||
|
check_expected(i);
|
||||||
|
}
|
||||||
|
|
||||||
// bind mocks and stubs
|
// bind mocks and stubs
|
||||||
|
|
||||||
void
|
void
|
||||||
mock_cons_show(void)
|
mock_cons_show(void)
|
||||||
{
|
{
|
||||||
cons_show = _mock_cons_show;
|
cons_show = _mock_cons_show;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -458,3 +463,10 @@ ui_win_exists_expect_and_return(int given_index, gboolean result)
|
|||||||
expect_value(_mock_ui_win_exists, index, given_index);
|
expect_value(_mock_ui_win_exists, index, given_index);
|
||||||
will_return(_mock_ui_win_exists, result);
|
will_return(_mock_ui_win_exists, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ui_switch_win_expect(int given_i)
|
||||||
|
{
|
||||||
|
ui_switch_win = _mock_ui_switch_win;
|
||||||
|
expect_value(_mock_ui_switch_win, i, given_i);
|
||||||
|
}
|
||||||
|
@ -67,4 +67,6 @@ void cons_show_roster_expect(GSList *list);
|
|||||||
void mock_ui_win_exists(void);
|
void mock_ui_win_exists(void);
|
||||||
void ui_win_exists_expect_and_return(int given_index, gboolean result);
|
void ui_win_exists_expect_and_return(int given_index, gboolean result);
|
||||||
|
|
||||||
|
void ui_switch_win_expect(int given_i);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user