unittests: set user directory so SYSCONF does not get created at the drive root

This commit is contained in:
Shawn Hoffman
2017-06-04 19:56:28 -07:00
parent 096399d371
commit a2358786dc
4 changed files with 8 additions and 1 deletions

View File

@ -12,6 +12,7 @@
#include "Core/Core.h"
#include "Core/CoreTiming.h"
#include "Core/PowerPC/PowerPC.h"
#include "UICommon/UICommon.h"
// Numbers are chosen randomly to make sure the correct one is given.
static constexpr std::array<u64, 5> CB_IDS{{42, 144, 93, 1026, UINT64_C(0xFFFF7FFFF7FFFF)}};
@ -37,6 +38,7 @@ public:
ScopeInit()
{
Core::DeclareAsCPUThread();
UICommon::SetUserDirectory("");
Config::Init();
SConfig::Init();
PowerPC::Init(PowerPC::CORE_INTERPRETER);

View File

@ -8,6 +8,7 @@
#include "Common/CommonTypes.h"
#include "Core/Config/Config.h"
#include "Core/HW/MMIO.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.
@ -30,6 +31,7 @@ TEST(UniqueID, UniqueEnough)
TEST(IsMMIOAddress, SpecialAddresses)
{
UICommon::SetUserDirectory("");
Config::Init();
SConfig::Init();
SConfig::GetInstance().bWii = true;