diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2024-01-31 02:56:56 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2024-01-31 12:54:07 +0100 |
| commit | 9a3e770c23312f61848adefc7202cb1b800cadff (patch) | |
| tree | 601445f63b85a19940e72f12df130076bb6315cc /Source/UnitTests/Core | |
| parent | 8d515d407c8b51c8887e2766fb2494aad3f91a1e (diff) | |
Migrate SConfig::bWii to System.
Diffstat (limited to 'Source/UnitTests/Core')
| -rw-r--r-- | Source/UnitTests/Core/MMIOTest.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/Source/UnitTests/Core/MMIOTest.cpp b/Source/UnitTests/Core/MMIOTest.cpp index 428621cc99..cdc751fe92 100644 --- a/Source/UnitTests/Core/MMIOTest.cpp +++ b/Source/UnitTests/Core/MMIOTest.cpp @@ -4,16 +4,12 @@ #include <gtest/gtest.h> #include <memory> -#include <string> #include <unordered_set> #include "Common/CommonTypes.h" -#include "Common/Config/Config.h" -#include "Common/FileUtil.h" #include "Core/HW/GPFifo.h" #include "Core/HW/MMIO.h" #include "Core/System.h" -#include "UICommon/UICommon.h" // Tests that the UniqueID function returns a "unique enough" identifier // number: that is, it is unique in the address ranges we care about. @@ -36,34 +32,25 @@ TEST(UniqueID, UniqueEnough) TEST(IsMMIOAddress, SpecialAddresses) { - const std::string profile_path = File::CreateTempDir(); - ASSERT_FALSE(profile_path.empty()); - UICommon::SetUserDirectory(profile_path); - Config::Init(); - SConfig::Init(); - SConfig::GetInstance().bWii = true; + constexpr bool is_wii = true; // WG Pipe address, should not be handled by MMIO. - EXPECT_FALSE(MMIO::IsMMIOAddress(GPFifo::GATHER_PIPE_PHYSICAL_ADDRESS)); + EXPECT_FALSE(MMIO::IsMMIOAddress(GPFifo::GATHER_PIPE_PHYSICAL_ADDRESS, is_wii)); // Locked L1 cache allocation. - EXPECT_FALSE(MMIO::IsMMIOAddress(0xE0000000)); + EXPECT_FALSE(MMIO::IsMMIOAddress(0xE0000000, is_wii)); // Uncached mirror of MEM1, shouldn't be handled by MMIO - EXPECT_FALSE(MMIO::IsMMIOAddress(0xC0000000)); + EXPECT_FALSE(MMIO::IsMMIOAddress(0xC0000000, is_wii)); // Effective address of an MMIO register; MMIO only deals with physical // addresses. - EXPECT_FALSE(MMIO::IsMMIOAddress(0xCC0000E0)); + EXPECT_FALSE(MMIO::IsMMIOAddress(0xCC0000E0, is_wii)); // And let's check some valid addresses too - EXPECT_TRUE(MMIO::IsMMIOAddress(0x0C0000E0)); // GameCube MMIOs - EXPECT_TRUE(MMIO::IsMMIOAddress(0x0D00008C)); // Wii MMIOs - EXPECT_TRUE(MMIO::IsMMIOAddress(0x0D800F10)); // Mirror of Wii MMIOs - - SConfig::Shutdown(); - Config::Shutdown(); - File::DeleteDirRecursively(profile_path); + EXPECT_TRUE(MMIO::IsMMIOAddress(0x0C0000E0, is_wii)); // GameCube MMIOs + EXPECT_TRUE(MMIO::IsMMIOAddress(0x0D00008C, is_wii)); // Wii MMIOs + EXPECT_TRUE(MMIO::IsMMIOAddress(0x0D800F10, is_wii)); // Mirror of Wii MMIOs } class MappingTest : public testing::Test |
