Skip to content

Commit 49dee12

Browse files
committed
Add missing test in RandomAccessMemoryTest
1 parent 79e18c1 commit 49dee12

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/core/RandomAccessMemoryTest.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ TEST_SUITE("RandomAccessMemoryTest") {
4141
}
4242
}
4343

44+
SUBCASE("memory should be programmable manually 2") {
45+
// Add a test where opcode and operand are different
46+
mar.registerValueChanged(1);
47+
ram.program(std::bitset<4>("1010"), std::bitset<4>("0011"));
48+
ram.out();
49+
50+
CHECK_EQ(bus->read(), std::bitset<8>("10100011").to_ulong());
51+
}
52+
4453
SUBCASE("reset() should reset address but not memory content") {
4554
// Set a value of 10 at memory location 0
4655
ram.program(Utils::to4bits(0), Utils::to4bits(10));

0 commit comments

Comments
 (0)