diff options
author | James Booth <boothj5@gmail.com> | 2014-12-23 21:42:01 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-12-23 21:42:01 +0000 |
commit | 8c01021ab9ae719c398e6c4a3e87ab98a5d6ac0e (patch) | |
tree | 6e5be41da643e09d10e3bdcc9951b7ab34da5d8e /tests/config/stub_accounts.c | |
parent | 69fe6c4d21d885f1397172605e8babe639a945c5 (diff) | |
download | profani-tty-8c01021ab9ae719c398e6c4a3e87ab98a5d6ac0e.tar.gz |
Use will_return instead of mock values
Diffstat (limited to 'tests/config/stub_accounts.c')
-rw-r--r-- | tests/config/stub_accounts.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/tests/config/stub_accounts.c b/tests/config/stub_accounts.c index 001be6d8..fe76f40c 100644 --- a/tests/config/stub_accounts.c +++ b/tests/config/stub_accounts.c @@ -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) |