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
+4 -3
View File
@@ -1,5 +1,7 @@
#include "util/XDGHelper.hpp"
#include "TestHelpers.hpp"
#include <gtest/gtest.h>
#include <QDebug>
@@ -57,9 +59,8 @@ TEST(XDGHelper, ParseDesktopExecProgram)
auto output = parseDesktopExecProgram(test.input);
EXPECT_EQ(output, test.expectedOutput)
<< "Input '" << test.input.toStdString() << "' failed. Expected '"
<< test.expectedOutput.toStdString() << "' but got '"
<< output.toStdString() << "'";
<< "Input '" << test.input << "' failed. Expected '"
<< test.expectedOutput << "' but got '" << output << "'";
}
}