Pass system into arm interpreter; fix tests

This commit is contained in:
Weiyi Wang
2018-11-21 17:14:42 -05:00
parent c6b3186475
commit e87dc17da2
12 changed files with 48 additions and 38 deletions

View File

@@ -20,7 +20,8 @@ TestEnvironment::TestEnvironment(bool mutable_memory_)
// so we need to create the kernel object there.
// Change this when all global states are eliminated.
Core::System::GetInstance().timing = std::make_unique<Core::Timing>();
Memory::MemorySystem memory;
Core::System::GetInstance().memory = std::make_unique<Memory::MemorySystem>();
Memory::MemorySystem& memory = *Core::System::GetInstance().memory;
Core::System::GetInstance().kernel = std::make_unique<Kernel::KernelSystem>(memory, 0);
kernel = Core::System::GetInstance().kernel.get();

View File

@@ -3,8 +3,8 @@
// Refer to the license.txt file included.
#include <catch2/catch.hpp>
#include "core/arm/dyncom/arm_dyncom.h"
#include "core/core.h"
#include "core/core_timing.h"
#include "tests/core/arm/arm_test_common.h"
@@ -23,7 +23,7 @@ TEST_CASE("ARM_DynCom (vfp): vadd", "[arm_dyncom]") {
test_env.SetMemory32(0, 0xEE321A03); // vadd.f32 s2, s4, s6
test_env.SetMemory32(4, 0xEAFFFFFE); // b +#0
ARM_DynCom dyncom(USER32MODE);
ARM_DynCom dyncom(Core::System::GetInstance(), USER32MODE);
std::vector<VfpTestCase> test_cases{{
#include "vfp_vadd_f32.inc"
@@ -47,4 +47,4 @@ TEST_CASE("ARM_DynCom (vfp): vadd", "[arm_dyncom]") {
}
}
} // namespace ArmTests
} // namespace ArmTests