summaryrefslogtreecommitdiff
path: root/Source/UnitTests/Common
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2014-09-02 07:40:49 +0200
committerPierre Bourdon <delroth@gmail.com>2014-09-02 07:40:49 +0200
commit5941653d474ba27ed40250028e03425cb5c2be5f (patch)
tree51538037d9cd4f0ac6d7d096cd940c97756b64a3 /Source/UnitTests/Common
parent9b10d36a85bb27681f5d48e3ced9c142a1ac6b47 (diff)
parent839cace5ff15b56afa3a72c86b379c6abc4c0bf6 (diff)
Merge pull request #920 from shuffle2/msvc-gtest
Provide a way to build and run unittests on Windows
Diffstat (limited to 'Source/UnitTests/Common')
-rw-r--r--Source/UnitTests/Common/BitFieldTest.cpp3
-rw-r--r--Source/UnitTests/Common/CommonFuncsTest.cpp3
-rw-r--r--Source/UnitTests/Common/FlagTest.cpp4
3 files changed, 7 insertions, 3 deletions
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());