1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-12-04 19:50:19 +00:00

Add test case for bus_load_buf().

This commit is contained in:
Radosław Kujawa 2017-02-03 22:37:48 +01:00
parent 51b47d707b
commit 4ed2016621

View File

@ -36,10 +36,28 @@ ATF_TC_BODY(bus_load_file, tc)
bus_finish(&b);
}
ATF_TC_WITHOUT_HEAD(bus_load_buf);
ATF_TC_BODY(bus_load_buf, tc)
{
bus_t b;
uint8_t buf[] = { 0xEA, 0xDB };
b = bus_init();
ATF_REQUIRE(bus_load_buf(&b, 0xC000, buf, 2));
ATF_CHECK(b.space[0xC000] == 0xEA);
ATF_CHECK(b.space[0xC001] == 0xDB);
bus_finish(&b);
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, bus_init);
ATF_TP_ADD_TC(tp, bus_load_file);
ATF_TP_ADD_TC(tp, bus_load_buf);
return (atf_no_error());
}