1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-12-23 07:30:31 +00:00
rk65c02/test/test_stepping.c

41 lines
625 B
C
Raw Normal View History

2017-01-26 22:22:40 +00:00
#include <atf-c.h>
#include <stdio.h>
#include "bus.h"
#include "rk65c02.h"
#include "log.h"
2017-01-26 22:22:40 +00:00
#include "utils.h"
ATF_TC_WITHOUT_HEAD(step1);
ATF_TC_BODY(step1, tc)
{
rk65c02emu_t e;
bus_t b;
rk65c02_loglevel_set(LOG_TRACE);
b = bus_init_with_default_devs();
2017-01-26 22:22:40 +00:00
e = rk65c02_init(&b);
2017-01-26 22:27:54 +00:00
e.regs.PC = ROM_LOAD_ADDR;
2017-01-26 22:22:40 +00:00
2017-01-26 22:27:54 +00:00
ATF_REQUIRE(bus_load_file(&b, ROM_LOAD_ADDR,
rom_path("test_stepping_step1.rom", tc)));
2017-01-26 22:22:40 +00:00
2017-01-26 22:27:54 +00:00
rk65c02_step(&e, 1);
ATF_CHECK(e.regs.PC == ROM_LOAD_ADDR+1);
rk65c02_step(&e, 1);
ATF_CHECK(e.regs.PC == ROM_LOAD_ADDR+2);
2017-01-26 22:22:40 +00:00
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, step1);
return (atf_no_error());
}