Browse Source

Merge pull request #746 from lioncash/tests

tests/arm_test_common: Minor changes
nce_cpp
bunnei 8 years ago
committed by GitHub
parent
commit
09837fe5ff
  1. 9
      src/tests/core/arm/arm_test_common.cpp
  2. 7
      src/tests/core/arm/arm_test_common.h

9
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;
}

7
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
Loading…
Cancel
Save