vgbc/tests/cpu/test_cpu_exception.cpp

14 lines
278 B
C++
Raw Permalink Normal View History

2023-09-01 15:11:27 +02:00
#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);
}