summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp')
-rw-r--r--tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp57
1 files changed, 18 insertions, 39 deletions
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);