Fix C4389 msvc warning

'==': signed/unsigned mismatch
post_malone
elsid 3 years ago
parent 2eae3227ba
commit e074ebde96
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -78,7 +78,7 @@ namespace
const std::map<TilePosition, ChangeType> changedTiles {{TilePosition {0, 0}, ChangeType::add}};
updater.post(mAgentBounds, navMeshCacheItem, mPlayerTile, mWorldspace, changedTiles);
updater.wait(mListener, WaitConditionType::allJobsDone);
EXPECT_NE(navMeshCacheItem->lockConst()->getImpl().getTileRefAt(0, 0, 0), 0);
EXPECT_NE(navMeshCacheItem->lockConst()->getImpl().getTileRefAt(0, 0, 0), 0u);
}
TEST_F(DetourNavigatorAsyncNavMeshUpdaterTest, repeated_post_should_lead_to_cache_hit)
@ -240,12 +240,12 @@ namespace
const std::map<TilePosition, ChangeType> changedTilesAdd {{TilePosition {0, 0}, ChangeType::add}};
updater.post(mAgentBounds, navMeshCacheItem, mPlayerTile, mWorldspace, changedTilesAdd);
updater.wait(mListener, WaitConditionType::allJobsDone);
ASSERT_NE(navMeshCacheItem->lockConst()->getImpl().getTileRefAt(0, 0, 0), 0);
ASSERT_NE(navMeshCacheItem->lockConst()->getImpl().getTileRefAt(0, 0, 0), 0u);
const std::map<TilePosition, ChangeType> changedTilesRemove {{TilePosition {0, 0}, ChangeType::remove}};
const TilePosition playerTile(100, 100);
updater.post(mAgentBounds, navMeshCacheItem, playerTile, mWorldspace, changedTilesRemove);
updater.wait(mListener, WaitConditionType::allJobsDone);
EXPECT_EQ(navMeshCacheItem->lockConst()->getImpl().getTileRefAt(0, 0, 0), 0);
EXPECT_EQ(navMeshCacheItem->lockConst()->getImpl().getTileRefAt(0, 0, 0), 0u);
}
TEST_F(DetourNavigatorAsyncNavMeshUpdaterTest, should_stop_writing_to_db_when_size_limit_is_reached)

@ -236,7 +236,7 @@ namespace
{
sol::table data = LuaUtil::deserialize(lua.lua_state(), loadedCfg.mScripts[1].mRefs[1].mInitializationData, &serializer);
ESM::RefNum adjustedRef = data["fargoth"].get<ESM::RefNum>();
EXPECT_EQ(adjustedRef.mIndex, 128964);
EXPECT_EQ(adjustedRef.mIndex, 128964u);
EXPECT_EQ(adjustedRef.mContentFile, 2);
}
}

@ -31,24 +31,24 @@ TEST_F(EndiannessTest, test_swap_endianness_inplace2)
uint16_t fortytwo = 0x0042;
Misc::swapEndiannessInplace(zero);
EXPECT_EQ(zero, 0x0000);
EXPECT_EQ(zero, 0x0000u);
Misc::swapEndiannessInplace(zero);
EXPECT_EQ(zero, 0x0000);
EXPECT_EQ(zero, 0x0000u);
Misc::swapEndiannessInplace(ffff);
EXPECT_EQ(ffff, 0xFFFF);
EXPECT_EQ(ffff, 0xFFFFu);
Misc::swapEndiannessInplace(ffff);
EXPECT_EQ(ffff, 0xFFFF);
EXPECT_EQ(ffff, 0xFFFFu);
Misc::swapEndiannessInplace(n12);
EXPECT_EQ(n12, 0x0201);
EXPECT_EQ(n12, 0x0201u);
Misc::swapEndiannessInplace(n12);
EXPECT_EQ(n12, 0x0102);
EXPECT_EQ(n12, 0x0102u);
Misc::swapEndiannessInplace(fortytwo);
EXPECT_EQ(fortytwo, 0x4200);
EXPECT_EQ(fortytwo, 0x4200u);
Misc::swapEndiannessInplace(fortytwo);
EXPECT_EQ(fortytwo, 0x0042);
EXPECT_EQ(fortytwo, 0x0042u);
}
TEST_F(EndiannessTest, test_swap_endianness_inplace4)
@ -58,19 +58,19 @@ TEST_F(EndiannessTest, test_swap_endianness_inplace4)
uint32_t ffff = 0xFFFFFFFF;
Misc::swapEndiannessInplace(zero);
EXPECT_EQ(zero, 0x00000000);
EXPECT_EQ(zero, 0x00000000u);
Misc::swapEndiannessInplace(zero);
EXPECT_EQ(zero, 0x00000000);
EXPECT_EQ(zero, 0x00000000u);
Misc::swapEndiannessInplace(n1234);
EXPECT_EQ(n1234, 0x04030201);
EXPECT_EQ(n1234, 0x04030201u);
Misc::swapEndiannessInplace(n1234);
EXPECT_EQ(n1234, 0x01020304);
EXPECT_EQ(n1234, 0x01020304u);
Misc::swapEndiannessInplace(ffff);
EXPECT_EQ(ffff, 0xFFFFFFFF);
EXPECT_EQ(ffff, 0xFFFFFFFFu);
Misc::swapEndiannessInplace(ffff);
EXPECT_EQ(ffff, 0xFFFFFFFF);
EXPECT_EQ(ffff, 0xFFFFFFFFu);
}
TEST_F(EndiannessTest, test_swap_endianness_inplace8)
@ -80,19 +80,19 @@ TEST_F(EndiannessTest, test_swap_endianness_inplace8)
uint64_t ffff = 0xFFFF'FFFF'FFFF'FFFF;
Misc::swapEndiannessInplace(zero);
EXPECT_EQ(zero, 0x0000'0000'0000'0000);
EXPECT_EQ(zero, 0x0000'0000'0000'0000u);
Misc::swapEndiannessInplace(zero);
EXPECT_EQ(zero, 0x0000'0000'0000'0000);
EXPECT_EQ(zero, 0x0000'0000'0000'0000u);
Misc::swapEndiannessInplace(ffff);
EXPECT_EQ(ffff, 0xFFFF'FFFF'FFFF'FFFF);
EXPECT_EQ(ffff, 0xFFFF'FFFF'FFFF'FFFFu);
Misc::swapEndiannessInplace(ffff);
EXPECT_EQ(ffff, 0xFFFF'FFFF'FFFF'FFFF);
EXPECT_EQ(ffff, 0xFFFF'FFFF'FFFF'FFFFu);
Misc::swapEndiannessInplace(n1234);
EXPECT_EQ(n1234, 0x0807'0605'0403'0201);
EXPECT_EQ(n1234, 0x0807'0605'0403'0201u);
Misc::swapEndiannessInplace(n1234);
EXPECT_EQ(n1234, 0x0102'0304'0506'0708);
EXPECT_EQ(n1234, 0x0102'0304'0506'0708u);
}
TEST_F(EndiannessTest, test_swap_endianness_inplace_float)

@ -24,7 +24,7 @@ namespace
std::uint32_t result = 0;
const TestFormat<Mode::Read> format;
binaryReader(format, result);
EXPECT_EQ(result, 42);
EXPECT_EQ(result, 42u);
}
TEST(DetourNavigatorSerializationBinaryReaderTest, shouldReadArithmeticTypeRangeValue)

Loading…
Cancel
Save