fix(clang-cl): reduce warnings in tests (#6331)
This commit is contained in:
@@ -77,6 +77,7 @@
|
|||||||
- Dev: Refactored `OnceFlag`. (#6237, #6316)
|
- Dev: Refactored `OnceFlag`. (#6237, #6316)
|
||||||
- Dev: Bumped clang-format requirement to 19. (#6236)
|
- Dev: Bumped clang-format requirement to 19. (#6236)
|
||||||
- Dev: Factored out AUMID to `Version`. (#6321)
|
- Dev: Factored out AUMID to `Version`. (#6321)
|
||||||
|
- Dev: Silenced some warnings when compiling with clang-cl. (#6331)
|
||||||
|
|
||||||
## 2.5.3
|
## 2.5.3
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,17 @@ if(CHATTERINO_TEST_USE_PUBLIC_HTTPBIN)
|
|||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_TEST_USE_PUBLIC_HTTPBIN)
|
target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_TEST_USE_PUBLIC_HTTPBIN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||||
|
# The warnings are stateful, options from target_compile_options get placed
|
||||||
|
# before the cxx flags. /W4 enables the initializer warnings.
|
||||||
|
string(REGEX REPLACE "/W4\\b" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
/W4
|
||||||
|
-Wno-missing-designated-field-initializers
|
||||||
|
-Wno-missing-field-initializers
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_target_properties(${PROJECT_NAME}
|
set_target_properties(${PROJECT_NAME}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
AUTORCC ON
|
AUTORCC ON
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ TEST(ChatterSet, MaxSize)
|
|||||||
EXPECT_TRUE(set.contains("Pajlada"));
|
EXPECT_TRUE(set.contains("Pajlada"));
|
||||||
|
|
||||||
// After adding CHATTER_LIMIT-1 additional chatters, pajlada should still be in the set
|
// After adding CHATTER_LIMIT-1 additional chatters, pajlada should still be in the set
|
||||||
for (auto i = 0; i < ChatterSet::CHATTER_LIMIT - 1; ++i)
|
for (size_t i = 0; i < ChatterSet::CHATTER_LIMIT - 1; ++i)
|
||||||
{
|
{
|
||||||
set.addRecentChatter(QString("%1").arg(i));
|
set.addRecentChatter(QString("%1").arg(i));
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ TEST(ChatterSet, MaxSizeLastUsed)
|
|||||||
EXPECT_TRUE(set.contains("Pajlada"));
|
EXPECT_TRUE(set.contains("Pajlada"));
|
||||||
|
|
||||||
// After adding CHATTER_LIMIT-1 additional chatters, pajlada should still be in the set
|
// After adding CHATTER_LIMIT-1 additional chatters, pajlada should still be in the set
|
||||||
for (auto i = 0; i < ChatterSet::CHATTER_LIMIT - 1; ++i)
|
for (size_t i = 0; i < ChatterSet::CHATTER_LIMIT - 1; ++i)
|
||||||
{
|
{
|
||||||
set.addRecentChatter(QString("%1").arg(i));
|
set.addRecentChatter(QString("%1").arg(i));
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ TEST(ChatterSet, MaxSizeLastUsed)
|
|||||||
set.addRecentChatter("pajlada");
|
set.addRecentChatter("pajlada");
|
||||||
|
|
||||||
// After another CHATTER_LIMIT-1 additional chatters, pajlada should still be there
|
// After another CHATTER_LIMIT-1 additional chatters, pajlada should still be there
|
||||||
for (auto i = 0; i < ChatterSet::CHATTER_LIMIT - 1; ++i)
|
for (size_t i = 0; i < ChatterSet::CHATTER_LIMIT - 1; ++i)
|
||||||
{
|
{
|
||||||
set.addRecentChatter(QString("new-%1").arg(i));
|
set.addRecentChatter(QString("new-%1").arg(i));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ TEST(TwitchPubSubClient, ExceedTopicLimit)
|
|||||||
ASSERT_EQ(pubSub.diag.connectionsFailed, 0);
|
ASSERT_EQ(pubSub.diag.connectionsFailed, 0);
|
||||||
ASSERT_EQ(pubSub.diag.messagesReceived, 0);
|
ASSERT_EQ(pubSub.diag.messagesReceived, 0);
|
||||||
|
|
||||||
for (auto i = 0; i < PubSubClient::MAX_LISTENS; ++i)
|
for (size_t i = 0; i < PubSubClient::MAX_LISTENS; ++i)
|
||||||
{
|
{
|
||||||
pubSub.listenToChannelPointRewards(QString("1%1").arg(i));
|
pubSub.listenToChannelPointRewards(QString("1%1").arg(i));
|
||||||
}
|
}
|
||||||
@@ -231,7 +231,7 @@ TEST(TwitchPubSubClient, ExceedTopicLimit)
|
|||||||
ASSERT_EQ(pubSub.diag.connectionsClosed, 0);
|
ASSERT_EQ(pubSub.diag.connectionsClosed, 0);
|
||||||
ASSERT_EQ(pubSub.diag.connectionsFailed, 0);
|
ASSERT_EQ(pubSub.diag.connectionsFailed, 0);
|
||||||
|
|
||||||
for (auto i = 0; i < PubSubClient::MAX_LISTENS; ++i)
|
for (size_t i = 0; i < PubSubClient::MAX_LISTENS; ++i)
|
||||||
{
|
{
|
||||||
pubSub.listenToChannelPointRewards(QString("2%1").arg(i));
|
pubSub.listenToChannelPointRewards(QString("2%1").arg(i));
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@ TEST(TwitchPubSubClient, ExceedTopicLimitSingleStep)
|
|||||||
ASSERT_EQ(pubSub.diag.connectionsFailed, 0);
|
ASSERT_EQ(pubSub.diag.connectionsFailed, 0);
|
||||||
ASSERT_EQ(pubSub.diag.messagesReceived, 0);
|
ASSERT_EQ(pubSub.diag.messagesReceived, 0);
|
||||||
|
|
||||||
for (auto i = 0; i < PubSubClient::MAX_LISTENS * 2; ++i)
|
for (size_t i = 0; i < PubSubClient::MAX_LISTENS * 2; ++i)
|
||||||
{
|
{
|
||||||
pubSub.listenToChannelPointRewards("123456");
|
pubSub.listenToChannelPointRewards("123456");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user