vgbc/tests/cpu/test_cpu_exception.cpp

14 lines
278 B
C++

#include "doctest.h"
#include <cpu/cpu.h>
#include <memory/ram.h>
#include <iostream>
TEST_CASE("Undefined instructions throw exception")
{
u8 test_mem[] = { 0xd3, 0x00, 0x00, 0x00 };
RAM r(test_mem, 0x4, true);
Cpu c(&r);
REQUIRE_THROWS_AS(c.step(), CpuException);
}