forked from qt-creator/qt-creator
UnitTests: Move printing functions to creator printing file
Change-Id: I09043347370d4fad623f8e803d4ef0f147fffa21 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -62,17 +62,6 @@ bool operator==(const SuspendResumeJobsEntry &a, const SuspendResumeJobsEntry &b
|
||||
&& a.preferredTranslationUnit == b.preferredTranslationUnit;
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const SuspendResumeJobsEntry &entry)
|
||||
{
|
||||
os << "SuspendResumeJobsEntry("
|
||||
<< entry.document.filePath() << ", "
|
||||
<< entry.jobRequestType << ", "
|
||||
<< entry.preferredTranslationUnit
|
||||
<< ")";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
} // ClangBackEnd
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -58,21 +58,6 @@ using References = QVector<SourceRangeContainer>;
|
||||
|
||||
namespace {
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const ReferencesResult &value)
|
||||
{
|
||||
os << "ReferencesResult(";
|
||||
os << value.isLocalVariable << ", {";
|
||||
for (const SourceRangeContainer &r : value.references) {
|
||||
os << r.start.line << ",";
|
||||
os << r.start.column << ",";
|
||||
QTC_CHECK(r.start.line == r.end.line);
|
||||
os << r.end.column - r.start.column << ",";
|
||||
}
|
||||
os << "})";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
struct Data {
|
||||
ProjectPart projectPart{
|
||||
Utf8StringLiteral("projectPartId"),
|
||||
|
||||
@@ -28,13 +28,16 @@
|
||||
#include "gtest-qt-printing.h"
|
||||
|
||||
#include <gtest/gtest-printers.h>
|
||||
#include <gmock/gmock-matchers.h>
|
||||
|
||||
#include <sourcelocations.h>
|
||||
|
||||
#include <clangcodemodelclientmessages.h>
|
||||
#include <clangcodemodelservermessages.h>
|
||||
#include <clangdocumentsuspenderresumer.h>
|
||||
#include <clangpathwatcher.h>
|
||||
#include <clangrefactoringmessages.h>
|
||||
#include <clangreferencescollector.h>
|
||||
#include <filestatus.h>
|
||||
#include <filepath.h>
|
||||
#include <fulltokeninfo.h>
|
||||
@@ -996,6 +999,30 @@ std::ostream &operator<<(std::ostream &out, const RemoveGeneratedFilesMessage &m
|
||||
return out << "(" << message.generatedFiles << ")";
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const SuspendResumeJobsEntry &entry)
|
||||
{
|
||||
return out << "("
|
||||
<< entry.document.filePath() << ", "
|
||||
<< entry.jobRequestType << ", "
|
||||
<< entry.preferredTranslationUnit
|
||||
<< ")";
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const ReferencesResult &value)
|
||||
{
|
||||
os << "ReferencesResult(";
|
||||
os << value.isLocalVariable << ", {";
|
||||
for (const SourceRangeContainer &r : value.references) {
|
||||
os << r.start.line << ",";
|
||||
os << r.start.column << ",";
|
||||
EXPECT_THAT(r.start.line, testing::Eq(r.end.line));
|
||||
os << r.end.column - r.start.column << ",";
|
||||
}
|
||||
os << "})";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
void PrintTo(const FilePath &filePath, ::std::ostream *os)
|
||||
{
|
||||
*os << filePath;
|
||||
|
||||
@@ -169,6 +169,8 @@ enum class SymbolTag : uchar;
|
||||
using SymbolTags = Utils::SizedArray<SymbolTag, 7>;
|
||||
class UpdateGeneratedFilesMessage;
|
||||
class RemoveGeneratedFilesMessage;
|
||||
class SuspendResumeJobsEntry;
|
||||
class ReferencesResult;
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const SourceLocationEntry &entry);
|
||||
std::ostream &operator<<(std::ostream &out, const IdPaths &idPaths);
|
||||
@@ -248,6 +250,8 @@ std::ostream &operator<<(std::ostream &out, SymbolTag symbolTag);
|
||||
std::ostream &operator<<(std::ostream &out, SymbolTags symbolTags);
|
||||
std::ostream &operator<<(std::ostream &out, const UpdateGeneratedFilesMessage &message);
|
||||
std::ostream &operator<<(std::ostream &out, const RemoveGeneratedFilesMessage &message);
|
||||
std::ostream &operator<<(std::ostream &os, const SuspendResumeJobsEntry &entry);
|
||||
std::ostream &operator<<(std::ostream &os, const ReferencesResult &value);
|
||||
|
||||
void PrintTo(const FilePath &filePath, ::std::ostream *os);
|
||||
void PrintTo(const FilePathView &filePathView, ::std::ostream *os);
|
||||
|
||||
Reference in New Issue
Block a user