summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-21 19:55:29 +0200
committerGitHub <noreply@github.com>2018-07-21 19:55:29 +0200
commit1c7c1347d8defb8e8721bb078c80293465b0365e (patch)
tree93ea9301e85a66e7d51742043f4bb173de6ce100 /src
parentMerge pull request #747 from lioncash/unimplemented (diff)
parentarm_test_common: Get rid of truncation warnings (diff)
downloadyuzu-1c7c1347d8defb8e8721bb078c80293465b0365e.tar
yuzu-1c7c1347d8defb8e8721bb078c80293465b0365e.tar.gz
yuzu-1c7c1347d8defb8e8721bb078c80293465b0365e.tar.bz2
yuzu-1c7c1347d8defb8e8721bb078c80293465b0365e.tar.lz
yuzu-1c7c1347d8defb8e8721bb078c80293465b0365e.tar.xz
yuzu-1c7c1347d8defb8e8721bb078c80293465b0365e.tar.zst
yuzu-1c7c1347d8defb8e8721bb078c80293465b0365e.zip
Diffstat (limited to 'src')
-rw-r--r--src/tests/core/arm/arm_test_common.cpp9
-rw-r--r--src/tests/core/arm/arm_test_common.h7
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