diff --git a/Source/Core/Common/CommonFuncs.h b/Source/Core/Common/CommonFuncs.h index eb26364d51..cf197ef660 100644 --- a/Source/Core/Common/CommonFuncs.h +++ b/Source/Core/Common/CommonFuncs.h @@ -161,6 +161,12 @@ extern "C" __declspec(dllimport) void __stdcall DebugBreak(void); } #define Crash() {DebugBreak();} + + #if (_MSC_VER > 1800) + #error alignof compat can be removed + #else + #define alignof(x) __alignof(x) + #endif #endif // WIN32 ndef // Generic function to get last error message. diff --git a/Source/Core/DolphinWX/DolphinWX.vcxproj b/Source/Core/DolphinWX/DolphinWX.vcxproj index ea06cd5b53..848e36f114 100644 --- a/Source/Core/DolphinWX/DolphinWX.vcxproj +++ b/Source/Core/DolphinWX/DolphinWX.vcxproj @@ -209,7 +209,7 @@ - + diff --git a/Source/UnitTests/Common/BitFieldTest.cpp b/Source/UnitTests/Common/BitFieldTest.cpp index aa98352272..ff317649e6 100644 --- a/Source/UnitTests/Common/BitFieldTest.cpp +++ b/Source/UnitTests/Common/BitFieldTest.cpp @@ -139,7 +139,8 @@ TEST(BitField, Alignment) GC_ALIGNED16(OddlyAlignedTestStruct test_struct); TestUnion& object = test_struct.obj; - static_assert(alignof(test_struct.obj.signed_1bit) == 1, "Incorrect variable alignment"); + static_assert(alignof(decltype(test_struct.obj.signed_1bit)) == 1, + "Incorrect variable alignment"); for (u64 val : table) { diff --git a/Source/UnitTests/Common/CommonFuncsTest.cpp b/Source/UnitTests/Common/CommonFuncsTest.cpp index 5fced4c5aa..e9b39b320e 100644 --- a/Source/UnitTests/Common/CommonFuncsTest.cpp +++ b/Source/UnitTests/Common/CommonFuncsTest.cpp @@ -13,6 +13,9 @@ TEST(CommonFuncs, ArraySizeMacro) EXPECT_EQ(4u, ArraySize(test)); EXPECT_EQ(42u, ArraySize(test2)); + + (void)test; + (void)test2; } TEST(CommonFuncs, RoundUpPow2Macro) diff --git a/Source/UnitTests/Common/FlagTest.cpp b/Source/UnitTests/Common/FlagTest.cpp index a3a0c3d929..2c087fd739 100644 --- a/Source/UnitTests/Common/FlagTest.cpp +++ b/Source/UnitTests/Common/FlagTest.cpp @@ -37,7 +37,7 @@ TEST(Flag, MultiThreaded) int count = 0; const int ITERATIONS_COUNT = 100000; - auto setter = [&f]() { + auto setter = [&]() { for (int i = 0; i < ITERATIONS_COUNT; ++i) { while (f.IsSet()); @@ -45,7 +45,7 @@ TEST(Flag, MultiThreaded) } }; - auto clearer = [&f, &count]() { + auto clearer = [&]() { for (int i = 0; i < ITERATIONS_COUNT; ++i) { while (!f.IsSet()); diff --git a/Source/UnitTests/TestUtils/StubHost.cpp b/Source/UnitTests/TestUtils/StubHost.cpp index e0363843aa..e55db7bb75 100644 --- a/Source/UnitTests/TestUtils/StubHost.cpp +++ b/Source/UnitTests/TestUtils/StubHost.cpp @@ -19,6 +19,7 @@ void Host_UpdateDisasmDialog() {} void Host_UpdateMainFrame() {} void Host_GetRenderWindowSize(int&, int&, int&, int&) {} void Host_RequestRenderWindowSize(int, int) {} +void Host_RequestFullscreen(bool) {} void Host_SetStartupDebuggingParameters() {} bool Host_UIHasFocus() { return false; } bool Host_RendererHasFocus() { return false; } diff --git a/Source/UnitTests/UnitTests.vcxproj b/Source/UnitTests/UnitTests.vcxproj new file mode 100644 index 0000000000..a67c8e5ac0 --- /dev/null +++ b/Source/UnitTests/UnitTests.vcxproj @@ -0,0 +1,112 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {474661E7-C73A-43A6-AFEE-EE1EC433D49E} + + + + Application + v120 + Unicode + + + true + + + false + + + + + + + + + + + + + + $(ExternalsDir)gtest\include;$(ExternalsDir)gtest;%(AdditionalIncludeDirectories) + + + + 0x00400000 + false + true + + $(ExternalsDir)OpenAL\$(PlatformName);%(AdditionalLibraryDirectories) + iphlpapi.lib;winmm.lib;setupapi.lib;vfw32.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;%(AdditionalDependencies) + Console + + + + + + + + + + + + + + + {E54CF649-140E-4255-81A5-30A673C1FB36} + + + {96020103-4ba5-4fd2-b4aa-5b6d24492d4e} + + + {ec1a314c-5588-4506-9c1e-2e58e5817f75} + + + {a4c423aa-f57c-46c7-a172-d1a777017d29} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/UnitTests/UnitTests.vcxproj.user b/Source/UnitTests/UnitTests.vcxproj.user new file mode 100644 index 0000000000..e472aa9c6d --- /dev/null +++ b/Source/UnitTests/UnitTests.vcxproj.user @@ -0,0 +1,9 @@ + + + + + + $(BinaryOutputDir) + WindowsLocalDebugger + + \ No newline at end of file diff --git a/Source/VSProps/Base.props b/Source/VSProps/Base.props index a0ca4838bb..32b4ebd75e 100644 --- a/Source/VSProps/Base.props +++ b/Source/VSProps/Base.props @@ -6,10 +6,11 @@ D - $(SolutionDir)..\Build\ - $(SolutionDir)..\Binary\ + $(SolutionDir)..\ + $(DolphinRootDir)Build\ + $(DolphinRootDir)Binary\ $(BinaryRootDir)$(Platform)\ - $(SolutionDir)..\Externals\ + $(DolphinRootDir)Externals\ $(SolutionDir)Core\ diff --git a/Source/dolphin-emu.sln b/Source/dolphin-emu.sln index 8eef6fcced..141580ca87 100644 --- a/Source/dolphin-emu.sln +++ b/Source/dolphin-emu.sln @@ -61,6 +61,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Video Backends", "Video Bac EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pch", "PCH\pch.vcxproj", "{76563A7F-1011-4EAD-B667-7BB18D09568E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTests", "UnitTests\UnitTests.vcxproj", "{474661E7-C73A-43A6-AFEE-EE1EC433D49E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -171,6 +173,10 @@ Global {76563A7F-1011-4EAD-B667-7BB18D09568E}.Debug|x64.Build.0 = Debug|x64 {76563A7F-1011-4EAD-B667-7BB18D09568E}.Release|x64.ActiveCfg = Release|x64 {76563A7F-1011-4EAD-B667-7BB18D09568E}.Release|x64.Build.0 = Release|x64 + {474661E7-C73A-43A6-AFEE-EE1EC433D49E}.Debug|x64.ActiveCfg = Debug|x64 + {474661E7-C73A-43A6-AFEE-EE1EC433D49E}.Debug|x64.Build.0 = Debug|x64 + {474661E7-C73A-43A6-AFEE-EE1EC433D49E}.Release|x64.ActiveCfg = Release|x64 + {474661E7-C73A-43A6-AFEE-EE1EC433D49E}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE