Browse Source
Merge pull request #746 from lioncash/tests
tests/arm_test_common: Minor changes
pull/15/merge
bunnei
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
4 deletions
-
src/tests/core/arm/arm_test_common.cpp
-
src/tests/core/arm/arm_test_common.h
|
|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -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 |