mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 22:46:21 +00:00
Use will_return instead of mock values
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
void reset_account_mocks(void);
|
||||
void mock_accounts_get_account(ProfAccount *given_account);
|
||||
Reference in New Issue
Block a user