diff options
| author | bunnei <bunneidev@gmail.com> | 2018-07-21 10:55:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-21 10:55:29 -0700 |
| commit | 1c7c1347d8defb8e8721bb078c80293465b0365e (patch) | |
| tree | 93ea9301e85a66e7d51742043f4bb173de6ce100 /src/tests/core/arm/arm_test_common.cpp | |
| parent | ff8754f921a0e9f1c7da02b768fad5584d3d22c5 (diff) | |
| parent | 48733744bb38d3a18af9713096f6e9b729944bb2 (diff) | |
Merge pull request #746 from lioncash/tests
tests/arm_test_common: Minor changes
Diffstat (limited to 'src/tests/core/arm/arm_test_common.cpp')
| -rw-r--r-- | src/tests/core/arm/arm_test_common.cpp | 9 |
1 files changed, 5 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; } |
