From ff03a2f7b16ee43a591e0747621862c9ef75f41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 5 Apr 2018 11:41:50 +0200 Subject: Use whole words in memory --- qtmips_machine/tests/testmemory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qtmips_machine/tests') diff --git a/qtmips_machine/tests/testmemory.cpp b/qtmips_machine/tests/testmemory.cpp index bef1a59..545364c 100644 --- a/qtmips_machine/tests/testmemory.cpp +++ b/qtmips_machine/tests/testmemory.cpp @@ -54,9 +54,9 @@ void MachineTests::memory_section() { // Write some data to memory m.write_byte(address, 0x42); // Read it trough section (mask bits outside of the memory section) - QCOMPARE(s->read_byte(address & ((1 << MEMORY_SECTION_BITS) - 1)), (std::uint8_t)0x42); + QCOMPARE(s->read_byte(address & 0xFF), (std::uint8_t)0x42); // Write some other data trough section - s->write_byte(address & ((1 << MEMORY_SECTION_BITS) - 1), 0x66); + s->write_byte(address & 0xFF, 0x66); // Read trough memory QCOMPARE(m.read_byte(address), (std::uint8_t)0x66); } @@ -64,7 +64,7 @@ void MachineTests::memory_section() { void MachineTests::memory_endian() { Memory m; - // Memory should be little endian so write bytes from most significant byte + // Memory should be big endian so write bytes from most significant byte m.write_byte(0x00, 0x12); m.write_byte(0x01, 0x34); m.write_byte(0x02, 0x56); -- cgit v1.2.3