From 5d4dffdc890c1b7085e917d4954d4ee129f89436 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 21 Jun 2023 15:00:41 +0200 Subject: [PATCH] UnitTests: Remove unused matcher There are no clang test anymore. Change-Id: I2140c4ff97e0351d627ec7b0f7306e0158fb95ca Reviewed-by: Qt CI Bot Reviewed-by: Burak Hancerli Reviewed-by: Reviewed-by: Thomas Hartmann --- tests/unit/tests/matchers/CMakeLists.txt | 1 - ...micastmatcherdiagnosticcontainer-matcher.h | 62 ------------------- 2 files changed, 63 deletions(-) delete mode 100644 tests/unit/tests/matchers/dynamicastmatcherdiagnosticcontainer-matcher.h diff --git a/tests/unit/tests/matchers/CMakeLists.txt b/tests/unit/tests/matchers/CMakeLists.txt index 79e8e34d479..2aebc0bc58b 100644 --- a/tests/unit/tests/matchers/CMakeLists.txt +++ b/tests/unit/tests/matchers/CMakeLists.txt @@ -5,6 +5,5 @@ add_qtc_library(TestMatchers OBJECT DEPENDS Googletest Utils SOURCES - dynamicastmatcherdiagnosticcontainer-matcher.h unittest-matchers.h ) diff --git a/tests/unit/tests/matchers/dynamicastmatcherdiagnosticcontainer-matcher.h b/tests/unit/tests/matchers/dynamicastmatcherdiagnosticcontainer-matcher.h deleted file mode 100644 index 50c642c8a69..00000000000 --- a/tests/unit/tests/matchers/dynamicastmatcherdiagnosticcontainer-matcher.h +++ /dev/null @@ -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); -} - -}