GBA: Fix tests

This commit is contained in:
Vicki Pfau 2019-05-18 19:06:10 -07:00
parent 4a3d042089
commit c18c38b616
2 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@
static int cheatsSetup(void** state) { static int cheatsSetup(void** state) {
struct mCore* core = GBACoreCreate(); struct mCore* core = GBACoreCreate();
core->init(core); core->init(core);
mCoreInitConfig(core, NULL);
core->cheatDevice(core); core->cheatDevice(core);
*state = core; *state = core;
return 0; return 0;
@ -26,6 +27,7 @@ static int cheatsTeardown(void** state) {
return 0; return 0;
} }
struct mCore* core = *state; struct mCore* core = *state;
mCoreConfigDeinit(&core->config);
core->deinit(core); core->deinit(core);
return 0; return 0;
} }

View File

@ -27,7 +27,9 @@ M_TEST_DEFINE(reset) {
struct mCore* core = GBACoreCreate(); struct mCore* core = GBACoreCreate();
assert_non_null(core); assert_non_null(core);
assert_true(core->init(core)); assert_true(core->init(core));
mCoreInitConfig(core, NULL);
core->reset(core); core->reset(core);
mCoreConfigDeinit(&core->config);
core->deinit(core); core->deinit(core);
} }
@ -36,7 +38,9 @@ M_TEST_DEFINE(loadNullROM) {
assert_non_null(core); assert_non_null(core);
assert_true(core->init(core)); assert_true(core->init(core));
assert_false(core->loadROM(core, NULL)); assert_false(core->loadROM(core, NULL));
mCoreInitConfig(core, NULL);
core->reset(core); core->reset(core);
mCoreConfigDeinit(&core->config);
core->deinit(core); core->deinit(core);
} }