aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2017-12-28 22:07:28 +0100
committerMarco Bubke <marco.bubke@qt.io>2018-01-16 14:01:01 +0000
commit15ed2691bf62a24be9cf15be6e5b2afa1fb0a102 (patch)
treec13ad13e600bb0f9ac57102890f43e8467c51ad8 /tests
parent640575640c9c223a9f13abaf95903ad86f263cdf (diff)
UnitTests: Fix printing of text
Change-Id: I7e8ebc2932be6e01d7776e58e462935ff857b0e5 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/unittest/gtest-creator-printing.cpp20
-rw-r--r--tests/unit/unittest/gtest-creator-printing.h9
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/unit/unittest/gtest-creator-printing.cpp b/tests/unit/unittest/gtest-creator-printing.cpp
index 4d463682c3..16e5133c56 100644
--- a/tests/unit/unittest/gtest-creator-printing.cpp
+++ b/tests/unit/unittest/gtest-creator-printing.cpp
@@ -49,6 +49,11 @@
#include <coreplugin/find/searchresultitem.h>
+void PrintTo(const Utf8String &text, ::std::ostream *os)
+{
+ *os << text;
+}
+
namespace Core {
namespace Search {
@@ -113,6 +118,11 @@ void PrintTo(const Utils::SmallString &text, ::std::ostream *os)
*os << text;
}
+void PrintTo(const Utils::PathString &text, ::std::ostream *os)
+{
+ *os << text;
+}
+
} // namespace Utils
namespace ClangBackEnd {
@@ -731,6 +741,16 @@ std::ostream &operator<<(std::ostream &out, const FilePath &filePath)
return out << "(" << filePath.path() << ", " << filePath.slashIndex() << ")";
}
+void PrintTo(const FilePath &filePath, ::std::ostream *os)
+{
+ *os << filePath;
+}
+
+void PrintTo(const FilePathView &filePathView, ::std::ostream *os)
+{
+ *os << filePathView;
+}
+
namespace V2 {
std::ostream &operator<<(std::ostream &os, const FileContainer &container)
diff --git a/tests/unit/unittest/gtest-creator-printing.h b/tests/unit/unittest/gtest-creator-printing.h
index 7fc9e15bf4..072719ff6d 100644
--- a/tests/unit/unittest/gtest-creator-printing.h
+++ b/tests/unit/unittest/gtest-creator-printing.h
@@ -33,6 +33,11 @@
#include <iosfwd>
+#include <gtest/gtest-printers.h>
+
+class Utf8String;
+void PrintTo(const Utf8String &text, ::std::ostream *os);
+
namespace Core {
namespace Search {
@@ -57,6 +62,7 @@ std::ostream &operator<<(std::ostream &out, const Macro &macro);
namespace Utils {
void PrintTo(const Utils::SmallString &text, ::std::ostream *os);
+void PrintTo(const Utils::PathString &text, ::std::ostream *os);
} // namespace ProjectExplorer
namespace ClangBackEnd {
@@ -177,6 +183,9 @@ std::ostream &operator<<(std::ostream &out, const TokenInfos &tokenInfos);
std::ostream &operator<<(std::ostream &out, const FilePathView &filePathView);
std::ostream &operator<<(std::ostream &out, const NativeFilePathView &nativeFilePathView);
+void PrintTo(const FilePath &filePath, ::std::ostream *os);
+void PrintTo(const FilePathView &filePathView, ::std::ostream *os);
+
namespace V2 {
class FileContainer;
class ProjectPartContainer;