summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-07-16 15:30:08 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-07-27 11:26:08 +0200
commitf4323889f117a1b474a3c7613858aa8e959ccb4c (patch)
tree5d686bd522580c4e95b3f35c4cd9dd82eb4f94ec /tests
parentd3c8757731d0b0d9e7a6448f1d1c21997136a19d (diff)
QLine: purge deprecated API
Since 5.14: intersect(), angle(). Also removed definition of M_2PI from test, since its last use was in the tests being removed. Change-Id: Ie3a12247e3760e8bfdd3a659cd06245c86b198c2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/tools/qline/tst_qline.cpp65
1 files changed, 1 insertions, 64 deletions
diff --git a/tests/auto/corelib/tools/qline/tst_qline.cpp b/tests/auto/corelib/tools/qline/tst_qline.cpp
index 2707dea146..4f3be0f3d9 100644
--- a/tests/auto/corelib/tools/qline/tst_qline.cpp
+++ b/tests/auto/corelib/tools/qline/tst_qline.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -30,10 +30,6 @@
#include <qline.h>
#include <qmath.h>
-#ifndef M_2PI
-#define M_2PI 6.28318530717958647692528676655900576
-#endif
-
class tst_QLine : public QObject
{
Q_OBJECT
@@ -53,11 +49,6 @@ private slots:
void testNormalVector();
void testNormalVector_data();
-#if QT_DEPRECATED_SINCE(5, 14)
- void testAngle();
- void testAngle_data();
-#endif
-
void testAngle2();
void testAngle2_data();
@@ -202,9 +193,6 @@ void tst_QLine::testIntersection()
QPointF ip;
QLineF::IntersectionType itype = a.intersects(b, &ip);
-#if QT_DEPRECATED_SINCE(5, 14)
- QCOMPARE(a.intersect(b, &ip), itype);
-#endif
QCOMPARE(int(itype), type);
if (type != QLineF::NoIntersection) {
@@ -377,57 +365,6 @@ void tst_QLine::testNormalVector()
QCOMPARE(n.dy(), qreal(nvy));
}
-#if QT_DEPRECATED_SINCE(5, 14)
-void tst_QLine::testAngle_data()
-{
- QTest::addColumn<double>("xa1");
- QTest::addColumn<double>("ya1");
- QTest::addColumn<double>("xa2");
- QTest::addColumn<double>("ya2");
- QTest::addColumn<double>("xb1");
- QTest::addColumn<double>("yb1");
- QTest::addColumn<double>("xb2");
- QTest::addColumn<double>("yb2");
- QTest::addColumn<double>("angle");
-
- QTest::newRow("parallel") << 1.0 << 1.0 << 3.0 << 4.0
- << 5.0 << 6.0 << 7.0 << 9.0
- << 0.0;
- QTest::newRow("[4,4]-[4,0]") << 1.0 << 1.0 << 5.0 << 5.0
- << 0.0 << 4.0 << 3.0 << 4.0
- << 45.0;
- QTest::newRow("[4,4]-[-4,0]") << 1.0 << 1.0 << 5.0 << 5.0
- << 3.0 << 4.0 << 0.0 << 4.0
- << 135.0;
-
- for (int i=0; i<180; ++i) {
- QTest::newRow(("angle:" + QByteArray::number(i)).constData())
- << 0.0 << 0.0 << double(cos(i*M_2PI/360)) << double(sin(i*M_2PI/360))
- << 0.0 << 0.0 << 1.0 << 0.0
- << double(i);
- }
-}
-
-void tst_QLine::testAngle()
-{
- QFETCH(double, xa1);
- QFETCH(double, ya1);
- QFETCH(double, xa2);
- QFETCH(double, ya2);
- QFETCH(double, xb1);
- QFETCH(double, yb1);
- QFETCH(double, xb2);
- QFETCH(double, yb2);
- QFETCH(double, angle);
-
- QLineF a(xa1, ya1, xa2, ya2);
- QLineF b(xb1, yb1, xb2, yb2);
-
- double resultAngle = a.angle(b);
- QCOMPARE(qRound(resultAngle), qRound(angle));
-}
-#endif
-
void tst_QLine::testAngle2_data()
{
QTest::addColumn<qreal>("x1");