summaryrefslogtreecommitdiff
path: root/Source/UnitTests/Core/MMIOTest.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2017-06-18 16:21:17 +0200
committerLéo Lam <leo@innovatetechnologi.es>2017-06-18 16:23:09 +0200
commit5243eae4e97f4d4152ea8681f038f8601a3f5715 (patch)
tree496aa152d8bd89f28eb9812f83cca66ace24bfd2 /Source/UnitTests/Core/MMIOTest.cpp
parent09457d3a4245ec9d4f2fdac3d1d0873a3354b858 (diff)
UnitTests: Use a temporary profile directory
This prevents Dolphin from modifying any file in the user directory.
Diffstat (limited to 'Source/UnitTests/Core/MMIOTest.cpp')
-rw-r--r--Source/UnitTests/Core/MMIOTest.cpp6
1 files changed, 5 insertions, 1 deletions
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 <gtest/gtest.h>
+#include <string>
#include <unordered_set>
#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