diff options
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/core/arm/arm_test_common.cpp | 9 | ||||
-rw-r--r-- | src/tests/core/arm/arm_test_common.h | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/tests/core/arm/arm_test_common.cpp b/src/tests/core/arm/arm_test_common.cpp index 7f9f27e19..539746246 100644 --- a/src/tests/core/arm/arm_test_common.cpp +++ b/src/tests/core/arm/arm_test_common.cpp @@ -10,8 +10,6 @@ namespace ArmTests { -static Memory::PageTable* page_table = nullptr; - TestEnvironment::TestEnvironment(bool mutable_memory_) : mutable_memory(mutable_memory_), test_memory(std::make_shared<TestMemory>(this)) { @@ -67,10 +65,13 @@ boost::optional<bool> TestEnvironment::TestMemory::IsValidAddress(VAddr addr) { } boost::optional<u8> TestEnvironment::TestMemory::Read8(VAddr addr) { - auto iter = data.find(addr); + const auto iter = data.find(addr); + if (iter == data.end()) { - return addr; // Some arbitrary data + // Some arbitrary data + return static_cast<u8>(addr); } + return iter->second; } diff --git a/src/tests/core/arm/arm_test_common.h b/src/tests/core/arm/arm_test_common.h index b66922d61..7fdbda494 100644 --- a/src/tests/core/arm/arm_test_common.h +++ b/src/tests/core/arm/arm_test_common.h @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#pragma once + #include <tuple> #include <unordered_map> #include <vector> @@ -9,6 +11,10 @@ #include "common/common_types.h" #include "core/memory_hook.h" +namespace Memory { +struct PageTable; +} + namespace ArmTests { struct WriteRecord { @@ -79,6 +85,7 @@ private: bool mutable_memory; std::shared_ptr<TestMemory> test_memory; std::vector<WriteRecord> write_records; + Memory::PageTable* page_table = nullptr; }; } // namespace ArmTests |