Added test for message when no connected /otr gen
This commit is contained in:
@@ -263,6 +263,21 @@ void cmd_otr_libver_shows_libotr_version(void **state)
|
|||||||
g_string_free(message, TRUE);
|
g_string_free(message, TRUE);
|
||||||
free(help);
|
free(help);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmd_otr_gen_shows_message_when_not_connected(void **state)
|
||||||
|
{
|
||||||
|
mock_cons_show();
|
||||||
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
|
gchar *args[] = { "gen", NULL };
|
||||||
|
|
||||||
|
mock_connection_status(JABBER_DISCONNECTED);
|
||||||
|
expect_cons_show("You must be connected with an account to load OTR information.");
|
||||||
|
|
||||||
|
gboolean result = cmd_otr(args, *help);
|
||||||
|
assert_true(result);
|
||||||
|
|
||||||
|
free(help);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
void cmd_otr_shows_message_when_otr_unsupported(void **state)
|
void cmd_otr_shows_message_when_otr_unsupported(void **state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ void cmd_otr_warn_shows_usage_when_invalid_arg(void **state);
|
|||||||
void cmd_otr_warn_on_enables_unencrypted_warning(void **state);
|
void cmd_otr_warn_on_enables_unencrypted_warning(void **state);
|
||||||
void cmd_otr_warn_off_disables_unencrypted_warning(void **state);
|
void cmd_otr_warn_off_disables_unencrypted_warning(void **state);
|
||||||
void cmd_otr_libver_shows_libotr_version(void **state);
|
void cmd_otr_libver_shows_libotr_version(void **state);
|
||||||
|
void cmd_otr_gen_shows_message_when_not_connected(void **state);
|
||||||
#else
|
#else
|
||||||
void cmd_otr_shows_message_when_otr_unsupported(void **state);
|
void cmd_otr_shows_message_when_otr_unsupported(void **state);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -456,6 +456,7 @@ int main(int argc, char* argv[]) {
|
|||||||
load_preferences,
|
load_preferences,
|
||||||
close_preferences),
|
close_preferences),
|
||||||
unit_test(cmd_otr_libver_shows_libotr_version),
|
unit_test(cmd_otr_libver_shows_libotr_version),
|
||||||
|
unit_test(cmd_otr_gen_shows_message_when_not_connected),
|
||||||
#else
|
#else
|
||||||
unit_test(cmd_otr_shows_message_when_otr_unsupported),
|
unit_test(cmd_otr_shows_message_when_otr_unsupported),
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user