From f4323889f117a1b474a3c7613858aa8e959ccb4c Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 16 Jul 2020 15:30:08 +0200 Subject: 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 --- tests/auto/corelib/tools/qline/tst_qline.cpp | 65 +--------------------------- 1 file changed, 1 insertion(+), 64 deletions(-) (limited to 'tests') 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 #include -#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("xa1"); - QTest::addColumn("ya1"); - QTest::addColumn("xa2"); - QTest::addColumn("ya2"); - QTest::addColumn("xb1"); - QTest::addColumn("yb1"); - QTest::addColumn("xb2"); - QTest::addColumn("yb2"); - QTest::addColumn("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("x1"); -- cgit v1.2.3