Merge pull request #5545 from shuffle2/fix-unittests

unittests: set user directory
This commit is contained in:
shuffle2 2017-06-07 21:20:38 -07:00 committed by GitHub
commit c7316c89db
4 changed files with 8 additions and 1 deletions

View File

@ -16,7 +16,7 @@ macro(add_dolphin_test target)
$<TARGET_OBJECTS:unittests_stubhost>
)
set_target_properties(${target} PROPERTIES FOLDER Tests)
target_link_libraries(${target} core gtest_main)
target_link_libraries(${target} core uicommon gtest_main)
add_dependencies(unittests ${target})
add_test(NAME ${target} COMMAND ${target})
endmacro()

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;

View File

@ -81,6 +81,9 @@
<ProjectReference Include="$(CoreDir)VideoBackends\Vulkan\Vulkan.vcxproj">
<Project>{29F29A19-F141-45AD-9679-5A2923B49DA3}</Project>
</ProjectReference>
<ProjectReference Include="$(CoreDir)UICommon\UICommon.vcxproj">
<Project>{604c8368-f34a-4d55-82c8-cc92a0c13254}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">