cmd_account_shows_account_when_connected_and_no_args

This commit is contained in:
James Booth
2014-12-23 19:51:12 +00:00
parent 5be9ac3243
commit 69fe6c4d21
10 changed files with 73 additions and 14 deletions

View File

@@ -11,11 +11,13 @@
// mock state
static gboolean mock_cons_show = FALSE;
static gboolean mock_cons_show_account = FALSE;
static char output[256];
void reset_ui_mocks(void)
{
mock_cons_show = FALSE;
mock_cons_show_account = FALSE;
}
void
@@ -25,6 +27,13 @@ expect_cons_show(char *expected)
expect_string(cons_show, output, expected);
}
void
expect_cons_show_account(ProfAccount *account)
{
mock_cons_show_account = TRUE;
expect_memory(cons_show_account, account, account, sizeof(ProfAccount));
}
// stubs
void ui_init(void) {}
@@ -303,7 +312,14 @@ void cons_show_log_prefs(void) {}
void cons_show_presence_prefs(void) {}
void cons_show_connection_prefs(void) {}
void cons_show_otr_prefs(void) {}
void cons_show_account(ProfAccount *account) {}
void cons_show_account(ProfAccount *account)
{
if (mock_cons_show_account) {
check_expected(account);
}
}
void cons_debug(const char * const msg, ...) {}
void cons_show_time(void) {}
void cons_show_word(const char * const word) {}

View File

@@ -1,4 +1,7 @@
#include <glib.h>
#include "config/account.h"
void expect_cons_show(char *expected);
void expect_cons_show_account(ProfAccount *account);
void reset_ui_mocks(void);