Added test for /otr theirfp when in other non chat windows

This commit is contained in:
James Booth
2014-02-17 22:44:27 +00:00
parent 4afec6ab5e
commit a25714b6dc
3 changed files with 29 additions and 2 deletions

View File

@@ -387,12 +387,13 @@ void cmd_otr_myfp_shows_my_fingerprint(void **state)
free(help);
}
void cmd_otr_theirfp_shows_message_when_in_console(void **state)
static void
test_cmd_otr_theirfp_from_wintype(win_type_t wintype)
{
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { "theirfp", NULL };
mock_connection_status(JABBER_CONNECTED);
mock_current_win_type(WIN_CONSOLE);
mock_current_win_type(wintype);
mock_ui_current_print_line();
ui_current_print_line_expect("You must be in a regular chat window to view a recipient's fingerprint.");
@@ -403,6 +404,26 @@ void cmd_otr_theirfp_shows_message_when_in_console(void **state)
free(help);
}
void cmd_otr_theirfp_shows_message_when_in_console(void **state)
{
test_cmd_otr_theirfp_from_wintype(WIN_CONSOLE);
}
void cmd_otr_theirfp_shows_message_when_in_muc(void **state)
{
test_cmd_otr_theirfp_from_wintype(WIN_MUC);
}
void cmd_otr_theirfp_shows_message_when_in_private(void **state)
{
test_cmd_otr_theirfp_from_wintype(WIN_PRIVATE);
}
void cmd_otr_theirfp_shows_message_when_in_duck(void **state)
{
test_cmd_otr_theirfp_from_wintype(WIN_DUCK);
}
#else
void cmd_otr_shows_message_when_otr_unsupported(void **state)
{