vgbc/tests/test_bus.cpp

16 lines
272 B
C++

#include "doctest.h"
#include <memory/bus.h>
#include <memory/ram.h>
TEST_CASE("Bus can map same device twice")
{
RAM r(0x1000);
Bus b;
b.map_device(0x0000, 0x0FFF, &r);
b.map_device(0x2000, 0x2FFF, &r);
b.write8(0x60, 42);
CHECK(b.read8(0x2060) == 42);
}