Fix memory leaks & data races in tests (#4772)
* Add a few pre-made sanitizer suppressions * Test Sanitization: Fix threading issues * Test Sanitization: Allow deletion of PubSub We still don't delete it in main code, but this allows us to try deleting it in tests. * Test Sanitization: Fix some memory leaks * fix gtest clang-tidy warning * const emojis test :-)
This commit is contained in:
@@ -154,7 +154,7 @@ TEST(TwitchMessageBuilder, BadgeInfoParsing)
|
||||
|
||||
for (const auto &test : testCases)
|
||||
{
|
||||
auto privmsg =
|
||||
auto *privmsg =
|
||||
Communi::IrcPrivateMessage::fromData(test.input, nullptr);
|
||||
|
||||
auto outputBadgeInfo =
|
||||
@@ -166,6 +166,8 @@ TEST(TwitchMessageBuilder, BadgeInfoParsing)
|
||||
SharedMessageBuilder::parseBadgeTag(privmsg->tags());
|
||||
EXPECT_EQ(outputBadges, test.expectedBadges)
|
||||
<< "Input for badges " << test.input.toStdString() << " failed";
|
||||
|
||||
delete privmsg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,5 +345,7 @@ TEST_F(TestTwitchMessageBuilder, ParseTwitchEmotes)
|
||||
EXPECT_EQ(actualTwitchEmotes, test.expectedTwitchEmotes)
|
||||
<< "Input for twitch emotes " << test.input.toStdString()
|
||||
<< " failed";
|
||||
|
||||
delete privmsg;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user