aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/tests/testmemory.cpp
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-04-05 11:41:50 +0200
committerKarel Kočí <cynerd@email.cz>2018-04-05 11:41:50 +0200
commitff03a2f7b16ee43a591e0747621862c9ef75f41d (patch)
tree33aced95d2fcdda0208da2245a5113475f54c746 /qtmips_machine/tests/testmemory.cpp
parent3230238711ad444a8172b45a516a3205494d13d9 (diff)
downloadqtmips-ff03a2f7b16ee43a591e0747621862c9ef75f41d.tar.gz
qtmips-ff03a2f7b16ee43a591e0747621862c9ef75f41d.tar.bz2
qtmips-ff03a2f7b16ee43a591e0747621862c9ef75f41d.zip
Use whole words in memory
Diffstat (limited to 'qtmips_machine/tests/testmemory.cpp')
-rw-r--r--qtmips_machine/tests/testmemory.cpp6
1 files changed, 3 insertions, 3 deletions
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);