1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-11-18 21:07:00 +00:00
rk65c02/test/test_bus.c

42 lines
556 B
C
Raw Normal View History

2017-01-16 21:54:51 +00:00
#include <atf-c.h>
#include <stdio.h>
#include <string.h>
#include "bus.h"
ATF_TC_WITHOUT_HEAD(bus_init);
ATF_TC_BODY(bus_init, tc)
2017-01-16 21:54:51 +00:00
{
bus_t b;
b = bus_init();
ATF_CHECK(b.space != NULL);
bus_finish(&b);
}
ATF_TC_WITHOUT_HEAD(bus_load_file);
ATF_TC_BODY(bus_load_file, tc)
2017-01-16 21:54:51 +00:00
{
bus_t b;
b = bus_init();
ATF_REQUIRE(bus_load_file(&b, 0xC000, "test_emulation_nop.rom"));
ATF_CHECK(b.space[0xC000] == 0xEA);
bus_finish(&b);
2017-01-16 21:54:51 +00:00
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, bus_init);
ATF_TP_ADD_TC(tp, bus_load_file);
2017-01-16 21:54:51 +00:00
return (atf_no_error());
}