forked from qt-creator/qt-creator
UnitTests: Remove unused matcher
There are no clang test anymore. Change-Id: I2140c4ff97e0351d627ec7b0f7306e0158fb95ca Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Burak Hancerli <burak.hancerli@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -5,6 +5,5 @@ add_qtc_library(TestMatchers OBJECT
|
|||||||
DEPENDS
|
DEPENDS
|
||||||
Googletest Utils
|
Googletest Utils
|
||||||
SOURCES
|
SOURCES
|
||||||
dynamicastmatcherdiagnosticcontainer-matcher.h
|
|
||||||
unittest-matchers.h
|
unittest-matchers.h
|
||||||
)
|
)
|
||||||
|
@@ -1,62 +0,0 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "../utils/googletest.h"
|
|
||||||
|
|
||||||
using testing::PrintToString;
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
MATCHER_P5(HasDiagnosticMessage, errorTypeText, startLine, startColumn, endLine, endColumn,
|
|
||||||
std::string(negation ? "isn't " : "is ")
|
|
||||||
+ "{" + PrintToString(errorTypeText)
|
|
||||||
+ ": (" + PrintToString(startLine)
|
|
||||||
+ ", " + PrintToString(startColumn)
|
|
||||||
+ "), (" + PrintToString(endLine)
|
|
||||||
+ ", " + PrintToString(endColumn)
|
|
||||||
+ ")}"
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (!arg.empty() && arg.front().messages.empty()) {
|
|
||||||
*result_listener << "no messages";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto message = arg.front().messages.front();
|
|
||||||
auto sourceRange = message.sourceRange;
|
|
||||||
|
|
||||||
return message.errorTypeText() == errorTypeText
|
|
||||||
&& sourceRange.start.line == uint(startLine)
|
|
||||||
&& sourceRange.start.column == uint(startColumn)
|
|
||||||
&& sourceRange.end.line == uint(endLine)
|
|
||||||
&& sourceRange.end.column == uint(endColumn);
|
|
||||||
}
|
|
||||||
|
|
||||||
MATCHER_P5(HasDiagnosticContext, contextTypeText, startLine, startColumn, endLine, endColumn,
|
|
||||||
std::string(negation ? "isn't " : "is ")
|
|
||||||
+ "{" + PrintToString(contextTypeText)
|
|
||||||
+ ": (" + PrintToString(startLine)
|
|
||||||
+ ", " + PrintToString(startColumn)
|
|
||||||
+ "), (" + PrintToString(endLine)
|
|
||||||
+ ", " + PrintToString(endColumn)
|
|
||||||
+ ")}"
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (!arg.empty() && arg.front().messages.empty()) {
|
|
||||||
*result_listener << "no context";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto context = arg.front().contexts.front();
|
|
||||||
auto sourceRange = context.sourceRange;
|
|
||||||
|
|
||||||
return context.contextTypeText() == contextTypeText
|
|
||||||
&& sourceRange.start.line == uint(startLine)
|
|
||||||
&& sourceRange.start.column == uint(startColumn)
|
|
||||||
&& sourceRange.end.line == uint(endLine)
|
|
||||||
&& sourceRange.end.column == uint(endColumn);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Reference in New Issue
Block a user