diff options
Diffstat (limited to 'tests/auto/gui/painting/qpathclipper')
5 files changed, 30 insertions, 22 deletions
diff --git a/tests/auto/gui/painting/qpathclipper/CMakeLists.txt b/tests/auto/gui/painting/qpathclipper/CMakeLists.txt index 191b1b8a93..2cf25cfdf2 100644 --- a/tests/auto/gui/painting/qpathclipper/CMakeLists.txt +++ b/tests/auto/gui/painting/qpathclipper/CMakeLists.txt @@ -1,4 +1,11 @@ -# Generated from qpathclipper.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qpathclipper LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() if(NOT QT_FEATURE_private_tests) return() @@ -14,18 +21,15 @@ qt_internal_add_test(tst_qpathclipper tst_qpathclipper.cpp INCLUDE_DIRECTORIES . - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::GuiPrivate ) -#### Keys ignored in scope 1:.:.:qpathclipper.pro:<TRUE>: -# _REQUIREMENTS = "qtConfig(private_tests)" - ## Scopes: ##################################################################### qt_internal_extend_target(tst_qpathclipper CONDITION UNIX AND NOT APPLE AND NOT HAIKU AND NOT INTEGRITY - PUBLIC_LIBRARIES + LIBRARIES m ) diff --git a/tests/auto/gui/painting/qpathclipper/pathcompare.h b/tests/auto/gui/painting/qpathclipper/pathcompare.h index d1207cfdc0..593176686e 100644 --- a/tests/auto/gui/painting/qpathclipper/pathcompare.h +++ b/tests/auto/gui/painting/qpathclipper/pathcompare.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef PATHCOMPARE_H #define PATHCOMPARE_H diff --git a/tests/auto/gui/painting/qpathclipper/paths.cpp b/tests/auto/gui/painting/qpathclipper/paths.cpp index e6be402df7..7b1486152b 100644 --- a/tests/auto/gui/painting/qpathclipper/paths.cpp +++ b/tests/auto/gui/painting/qpathclipper/paths.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "paths.h" QPainterPath Paths::rect() diff --git a/tests/auto/gui/painting/qpathclipper/paths.h b/tests/auto/gui/painting/qpathclipper/paths.h index 8c421dec2e..73b41d324a 100644 --- a/tests/auto/gui/painting/qpathclipper/paths.h +++ b/tests/auto/gui/painting/qpathclipper/paths.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef PATHS_H #define PATHS_H diff --git a/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp b/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp index e93d0f4ba1..c5ef8373fd 100644 --- a/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp +++ b/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "private/qpathclipper_p.h" #include "paths.h" #include "pathcompare.h" @@ -470,15 +470,19 @@ void tst_QPathClipper::clipTest(int subjectIndex, int clipIndex, QPathClipper::O break; } - if (expected != inResult) { - char str[256]; - const char *opStr = - op == QPathClipper::BoolAnd ? "and" : - op == QPathClipper::BoolOr ? "or" : "sub"; - sprintf(str, "Expected: %d, actual: %d, subject: %d, clip: %d, op: %s\n", - int(expected), int(inResult), subjectIndex, clipIndex, opStr); - QFAIL(str); - } + auto failLogger = qScopeGuard([&]{ + qCritical().noquote().nospace() + << "\n\tExpected: " << expected + << "\n\tActual: " << inResult + << "\n\tSubject: " << subjectIndex + << "\n\tClip: " << clipIndex + << "\n\tOp: " << (op == QPathClipper::BoolAnd + ? "and" + : op == QPathClipper::BoolOr + ? "or" : "sub"); + }); + QCOMPARE(inResult, expected); + failLogger.dismiss(); } } @@ -772,7 +776,7 @@ void tst_QPathClipper::testIntersections7() void tst_QPathClipper::testIntersections8() { QPainterPath path1 = Paths::node() * QTransform().translate(100, 50); - QPainterPath path2 = Paths::node() * QTransform().translate(150, 50);; + QPainterPath path2 = Paths::node() * QTransform().translate(150, 50); QVERIFY(path1.intersects(path2)); QVERIFY(path2.intersects(path1)); @@ -820,7 +824,7 @@ void tst_QPathClipper::testIntersections9() QVERIFY(path1.intersects(path2)); QVERIFY(path2.intersects(path1)); - path1 = QPainterPath();; + path1 = QPainterPath(); path2 = QPainterPath(); path1.addRect(QRectF(-1,191, 136, 106)); @@ -828,7 +832,7 @@ void tst_QPathClipper::testIntersections9() QVERIFY(path1.intersects(path2)); QVERIFY(path2.intersects(path1)); - path1 = QPainterPath();; + path1 = QPainterPath(); path2 = QPainterPath(); path1.moveTo(-1 , 143); |