From a8bb1eb39fe2cf62545798a493f6350c3d1d5728 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 20 Jul 2018 17:51:29 -0400 Subject: arm_test_common: Make file static variable a member variable of the testing environment Gets rid of file-static behavior. --- src/tests/core/arm/arm_test_common.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/tests/core/arm/arm_test_common.cpp') diff --git a/src/tests/core/arm/arm_test_common.cpp b/src/tests/core/arm/arm_test_common.cpp index 7f9f27e19..2af487b6a 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(this)) { -- cgit v1.2.3 From 48733744bb38d3a18af9713096f6e9b729944bb2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 20 Jul 2018 17:53:50 -0400 Subject: arm_test_common: Get rid of truncation warnings Explicitly cast the value to a u8 to show that this is intentional. --- src/tests/core/arm/arm_test_common.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/tests/core/arm/arm_test_common.cpp') diff --git a/src/tests/core/arm/arm_test_common.cpp b/src/tests/core/arm/arm_test_common.cpp index 2af487b6a..539746246 100644 --- a/src/tests/core/arm/arm_test_common.cpp +++ b/src/tests/core/arm/arm_test_common.cpp @@ -65,10 +65,13 @@ boost::optional TestEnvironment::TestMemory::IsValidAddress(VAddr addr) { } boost::optional 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(addr); } + return iter->second; } -- cgit v1.2.3