From 5243eae4e97f4d4152ea8681f038f8601a3f5715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 18 Jun 2017 16:21:17 +0200 Subject: UnitTests: Use a temporary profile directory This prevents Dolphin from modifying any file in the user directory. --- Source/UnitTests/Core/MMIOTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Source/UnitTests/Core/MMIOTest.cpp') diff --git a/Source/UnitTests/Core/MMIOTest.cpp b/Source/UnitTests/Core/MMIOTest.cpp index f1a414045a..b54d82d27d 100644 --- a/Source/UnitTests/Core/MMIOTest.cpp +++ b/Source/UnitTests/Core/MMIOTest.cpp @@ -3,9 +3,11 @@ // Refer to the license.txt file included. #include +#include #include #include "Common/CommonTypes.h" +#include "Common/FileUtil.h" #include "Core/Config/Config.h" #include "Core/HW/MMIO.h" #include "UICommon/UICommon.h" @@ -31,7 +33,8 @@ TEST(UniqueID, UniqueEnough) TEST(IsMMIOAddress, SpecialAddresses) { - UICommon::SetUserDirectory(""); + const std::string profile_path = File::CreateTempDir(); + UICommon::SetUserDirectory(profile_path); Config::Init(); SConfig::Init(); SConfig::GetInstance().bWii = true; @@ -56,6 +59,7 @@ TEST(IsMMIOAddress, SpecialAddresses) SConfig::Shutdown(); Config::Shutdown(); + File::DeleteDirRecursively(profile_path); } class MappingTest : public testing::Test -- cgit v1.2.3