Use will_return instead of mock values

This commit is contained in:
James Booth
2014-12-23 21:42:01 +00:00
parent 69fe6c4d21
commit 8c01021ab9
11 changed files with 30 additions and 125 deletions

View File

@@ -1,24 +1,11 @@
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include "common.h"
#include "config/account.h"
// mock state
static ProfAccount *account = NULL;
void
reset_account_mocks(void)
{
account = NULL;
}
void
mock_accounts_get_account(ProfAccount *given_account)
{
account = given_account;
}
// stubs
void accounts_load(void) {}
void accounts_close(void) {}
@@ -47,7 +34,7 @@ gchar** accounts_get_list(void)
ProfAccount* accounts_get_account(const char * const name)
{
return account;
return (ProfAccount*)mock();
}
gboolean accounts_enable(const char * const name)

View File

@@ -1,2 +0,0 @@
void reset_account_mocks(void);
void mock_accounts_get_account(ProfAccount *given_account);