refactor: clean up toStdString usages in tests (#5346)
* tests: Add QString/QStringView << operators for std::ostream This makes it easier to print QString/QStringView's in ASSERT_EQ outputs * tests: clean up toStdString usages * fix: use QByteArray.toStdString instead
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "providers/seventv/SeventvBadges.hpp"
|
||||
#include "providers/twitch/TwitchBadge.hpp"
|
||||
#include "singletons/Emotes.hpp"
|
||||
#include "TestHelpers.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <IrcConnection>
|
||||
@@ -147,7 +148,7 @@ TEST(TwitchMessageBuilder, CommaSeparatedListTagParsing)
|
||||
auto output = TwitchMessageBuilder::slashKeyValue(test.input);
|
||||
|
||||
EXPECT_EQ(output, test.expectedOutput)
|
||||
<< "Input " << test.input.toStdString() << " failed";
|
||||
<< "Input " << test.input << " failed";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,12 +231,12 @@ TEST(TwitchMessageBuilder, BadgeInfoParsing)
|
||||
auto outputBadgeInfo =
|
||||
TwitchMessageBuilder::parseBadgeInfoTag(privmsg->tags());
|
||||
EXPECT_EQ(outputBadgeInfo, test.expectedBadgeInfo)
|
||||
<< "Input for badgeInfo " << test.input.toStdString() << " failed";
|
||||
<< "Input for badgeInfo " << test.input << " failed";
|
||||
|
||||
auto outputBadges =
|
||||
SharedMessageBuilder::parseBadgeTag(privmsg->tags());
|
||||
EXPECT_EQ(outputBadges, test.expectedBadges)
|
||||
<< "Input for badges " << test.input.toStdString() << " failed";
|
||||
<< "Input for badges " << test.input << " failed";
|
||||
|
||||
delete privmsg;
|
||||
}
|
||||
@@ -413,8 +414,7 @@ TEST_F(TestTwitchMessageBuilder, ParseTwitchEmotes)
|
||||
privmsg->tags(), originalMessage, 0);
|
||||
|
||||
EXPECT_EQ(actualTwitchEmotes, test.expectedTwitchEmotes)
|
||||
<< "Input for twitch emotes " << test.input.toStdString()
|
||||
<< " failed";
|
||||
<< "Input for twitch emotes " << test.input << " failed";
|
||||
|
||||
delete privmsg;
|
||||
}
|
||||
@@ -617,11 +617,11 @@ TEST_F(TestTwitchMessageBuilder, IgnoresReplace)
|
||||
emotes);
|
||||
|
||||
EXPECT_EQ(message, test.expectedMessage)
|
||||
<< "Message not equal for input '" << test.input.toStdString()
|
||||
<< "' - expected: '" << test.expectedMessage.toStdString()
|
||||
<< "' got: '" << message.toStdString() << "'";
|
||||
<< "Message not equal for input '" << test.input
|
||||
<< "' - expected: '" << test.expectedMessage << "' got: '"
|
||||
<< message << "'";
|
||||
EXPECT_EQ(emotes, test.expectedTwitchEmotes)
|
||||
<< "Twitch emotes not equal for input '" << test.input.toStdString()
|
||||
<< "' and output '" << message.toStdString() << "'";
|
||||
<< "Twitch emotes not equal for input '" << test.input
|
||||
<< "' and output '" << message << "'";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user