mirror of https://github.com/mgba-emu/mgba.git
GB Test: Fix tests
This commit is contained in:
parent
5c90abd294
commit
558a3ab037
|
@ -14,7 +14,6 @@
|
||||||
struct GBRTCTest {
|
struct GBRTCTest {
|
||||||
struct mRTCSource d;
|
struct mRTCSource d;
|
||||||
struct mCore* core;
|
struct mCore* core;
|
||||||
struct VFile* fakeROM;
|
|
||||||
time_t nextTime;
|
time_t nextTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -51,10 +50,10 @@ M_TEST_SUITE_SETUP(GBRTC) {
|
||||||
struct VFile* vf = VFileMemChunk(NULL, 2048);
|
struct VFile* vf = VFileMemChunk(NULL, 2048);
|
||||||
GBSynthesizeROM(vf);
|
GBSynthesizeROM(vf);
|
||||||
test->core->loadROM(test->core, vf);
|
test->core->loadROM(test->core, vf);
|
||||||
test->core->setRTC(test->core, &test->d);
|
mCoreSetRTC(test->core, &test->d);
|
||||||
|
|
||||||
struct GB* gb = test->core->board;
|
struct GB* gb = test->core->board;
|
||||||
struct GBCartridge* cart = (struct GBCartridge*) &gb->memory.rom[0x100];
|
gb->memory.mbcType = GB_MBC3_RTC;
|
||||||
cart->type = 0x0F;
|
|
||||||
|
|
||||||
*state = test;
|
*state = test;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -77,6 +76,7 @@ M_TEST_DEFINE(create) {
|
||||||
|
|
||||||
uint8_t expected[sizeof(gb->memory.rtcRegs)] = { 0, 0, 0, 0, 0 };
|
uint8_t expected[sizeof(gb->memory.rtcRegs)] = { 0, 0, 0, 0, 0 };
|
||||||
assert_memory_equal(gb->memory.rtcRegs, expected, sizeof(expected));
|
assert_memory_equal(gb->memory.rtcRegs, expected, sizeof(expected));
|
||||||
|
assert_int_equal(gb->memory.mbcType, GB_MBC3_RTC);
|
||||||
}
|
}
|
||||||
|
|
||||||
M_TEST_DEFINE(tickSecond) {
|
M_TEST_DEFINE(tickSecond) {
|
||||||
|
|
Loading…
Reference in New Issue