summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting/qpathclipper
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/painting/qpathclipper')
-rw-r--r--tests/auto/gui/painting/qpathclipper/CMakeLists.txt16
-rw-r--r--tests/auto/gui/painting/qpathclipper/pathcompare.h29
-rw-r--r--tests/auto/gui/painting/qpathclipper/paths.cpp29
-rw-r--r--tests/auto/gui/painting/qpathclipper/paths.h29
-rw-r--r--tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp57
5 files changed, 34 insertions, 126 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 4f855194a4..593176686e 100644
--- a/tests/auto/gui/painting/qpathclipper/pathcompare.h
+++ b/tests/auto/gui/painting/qpathclipper/pathcompare.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// 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 a814958394..7b1486152b 100644
--- a/tests/auto/gui/painting/qpathclipper/paths.cpp
+++ b/tests/auto/gui/painting/qpathclipper/paths.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// 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 61daa0c3a4..73b41d324a 100644
--- a/tests/auto/gui/painting/qpathclipper/paths.h
+++ b/tests/auto/gui/painting/qpathclipper/paths.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// 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 83a8d6bd47..c5ef8373fd 100644
--- a/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
+++ b/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "private/qpathclipper_p.h"
#include "paths.h"
#include "pathcompare.h"
@@ -495,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();
}
}
@@ -797,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));
@@ -845,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));
@@ -853,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);