Commit 73cee4d6 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

Clang: Tests: Mini refactorings



Change-Id: I4a058d4c68c126d74badfc699a239ef9b2790f3a
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@theqtcompany.com>
parent e8041f22
......@@ -71,10 +71,15 @@ using namespace ClangCodeModel::Internal;
namespace {
QString _(const char text[]) { return QString::fromUtf8(text); }
QString _(const char text[])
{ return QString::fromUtf8(text); }
QString qrcPath(const QByteArray relativeFilePath)
{ return QLatin1String(":/unittests/ClangCodeModel/") + QString::fromUtf8(relativeFilePath); }
QString fileName(const QString &filePath)
{ return QFileInfo(filePath).fileName(); }
struct LogOutput
{
LogOutput(const QString &text) : text(text.toUtf8()) {}
......@@ -260,8 +265,8 @@ QString toString(const FileContainer &fileContainer)
{
QString out;
QTextStream ts(&out);
ts << " Path: " << QFileInfo(fileContainer.filePath().toString()).fileName()
<< " ProjectPart: " << fileContainer.projectPartId().toString() << "\n";
ts << " Path: " << fileName(fileContainer.filePath().toString())
<< " ProjectPart: " << fileName(fileContainer.projectPartId().toString()) << "\n";
return out;
}
......@@ -279,7 +284,7 @@ QString toString(const ProjectPartContainer &projectPartContainer)
QString out;
QTextStream ts(&out);
ts << " ProjectPartContainer"
<< " id: " << QFileInfo(projectPartContainer.projectPartId().toString()).fileName();
<< " id: " << fileName(projectPartContainer.projectPartId().toString());
return out;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment