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:
pajlada
2024-04-21 22:52:44 +02:00
committed by GitHub
parent dfa929e207
commit 4a1ce2a3b3
5 changed files with 47 additions and 22 deletions
+3 -3
View File
@@ -1,6 +1,7 @@
#include "providers/emoji/Emojis.hpp"
#include "common/Literals.hpp"
#include "TestHelpers.hpp"
#include <gtest/gtest.h>
#include <QDebug>
@@ -53,7 +54,7 @@ TEST(Emojis, ShortcodeParsing)
}
EXPECT_EQ(output, test.expectedOutput)
<< "Input " << test.input.toStdString() << " failed";
<< "Input " << test.input << " failed";
}
}
@@ -165,8 +166,7 @@ TEST(Emojis, Parse)
// can't use EXPECT_EQ because EmotePtr can't be printed
if (output != test.expectedOutput)
{
EXPECT_TRUE(false)
<< "Input " << test.input.toStdString() << " failed";
EXPECT_TRUE(false) << "Input " << test.input << " failed";
}
}
}