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

37 lines
540 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 "utils.h"
ATF_TC_WITHOUT_HEAD(step1);
ATF_TC_BODY(step1, tc)
{
rk65c02emu_t e;
bus_t b;
b = bus_init();
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,
2017-01-26 22:22:40 +00:00
"test_stepping_step1.rom"));
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());
}