From 7508f02176f317db50f20985205bf64af8134ab6 Mon Sep 17 00:00:00 2001 From: Jani Heikkinen Date: Tue, 19 Dec 2017 13:34:15 +0200 Subject: Fix license headers Old header.LGPL21 header was used at some files. Replase those with new header.LGPL one Task-number: QTBUG-57147 Change-Id: Ib35bd7aa0fd5c5334e35097257ba64ece45bcd5a Reviewed-by: Paolo Angelelli --- tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp | 34 ++++++++++++++---------- tests/plugins/declarativetestplugin/testhelper.h | 34 ++++++++++++++---------- 2 files changed, 40 insertions(+), 28 deletions(-) (limited to 'tests') diff --git a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp index ae0083ba..3843ed8f 100644 --- a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp +++ b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 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:LGPL21$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** 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-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/tests/plugins/declarativetestplugin/testhelper.h b/tests/plugins/declarativetestplugin/testhelper.h index 3b9f376e..4ec9a975 100644 --- a/tests/plugins/declarativetestplugin/testhelper.h +++ b/tests/plugins/declarativetestplugin/testhelper.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 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:LGPL21$ +** $QT_BEGIN_LICENSE:LGPL$ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** 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-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** -- cgit v1.2.1 From c5e81e73702fc963861c2fc0bf56fb553d81c5a9 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Fri, 24 Nov 2017 15:34:41 +0100 Subject: Fix NmeaPositionInfoSource not combining sentences - simulation mode This patch is the first half of a fix to prevent NmeaPositionInfoSource to push an update per sentence instead of combining all sentences with the same timestamp into one QGeoPositionInfo. This patch fixes only the source in simulation mode. Additional work is needed for standard mode. Task-number: QTBUG-64699 Change-Id: I39d9905331c5a1f646b7465f4d7d155834bec815 Reviewed-by: Alex Blasche --- .../tst_qnmeapositioninfosource.cpp | 57 +++++++++++++--------- 1 file changed, 34 insertions(+), 23 deletions(-) (limited to 'tests') diff --git a/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp b/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp index 8305dc1d..c77e465d 100644 --- a/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp +++ b/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp @@ -212,7 +212,7 @@ void tst_QNmeaPositionInfoSource::beginWithBufferedData_data() QTest::newRow("requestUpdate(), 1 update in buffer") << dateTimes << RequestUpdatesMethod; for (int i=1; i<3; i++) - dateTimes << dateTimes[0].addDays(i); + dateTimes << dateTimes[0].addMSecs(i * 100); QTest::newRow("startUpdates(), multiple updates in buffer") << dateTimes << StartUpdatesMethod; QTest::newRow("requestUpdate(), multiple updates in buffer") << dateTimes << RequestUpdatesMethod; } @@ -356,8 +356,10 @@ void tst_QNmeaPositionInfoSource::startUpdates_waitForValidDateTime() QNmeaPositionInfoSourceProxy *proxy = static_cast(factory.createProxy(&source)); QSignalSpy spy(proxy->source(), SIGNAL(positionUpdated(QGeoPositionInfo))); + QObject::connect(proxy->source(), &QNmeaPositionInfoSource::positionUpdated, [](const QGeoPositionInfo &info) { + qDebug() << info.timestamp(); + }); proxy->source()->startUpdates(); - proxy->feedBytes(bytes); QTRY_COMPARE(spy.count(), dateTimes.count()); @@ -373,7 +375,7 @@ void tst_QNmeaPositionInfoSource::startUpdates_waitForValidDateTime() if (pInfo.hasAttribute(QGeoPositionInfo::HorizontalAccuracy)) QVERIFY(qFuzzyCompare(pInfo.attribute(QGeoPositionInfo::HorizontalAccuracy), 35.7)); - // Generate GSA sentences have hard coded VDOP of 4.0, which corrisponds to a vertical + // Generated GSA sentences have hard coded VDOP of 4.0, which corrisponds to a vertical // accuracy of 40.8, for the user equivalent range error of 5.1 set above. QCOMPARE(pInfo.hasAttribute(QGeoPositionInfo::VerticalAccuracy), expectVerticalAccuracy[i]); @@ -393,45 +395,54 @@ void tst_QNmeaPositionInfoSource::startUpdates_waitForValidDateTime_data() QByteArray bytes; // should only receive RMC sentence and the GGA sentence *after* it - bytes += QLocationTestUtils::createGgaSentence(dt.addSecs(1).time()).toLatin1(); - bytes += QLocationTestUtils::createRmcSentence(dt.addSecs(2)).toLatin1(); - bytes += QLocationTestUtils::createGgaSentence(dt.addSecs(3).time()).toLatin1(); + bytes += QLocationTestUtils::createGgaSentence(dt.addMSecs(100).time()).toLatin1(); + bytes += QLocationTestUtils::createRmcSentence(dt.addMSecs(200)).toLatin1(); + bytes += QLocationTestUtils::createGgaSentence(dt.addMSecs(300).time()).toLatin1(); QTest::newRow("Feed GGA,RMC,GGA; expect RMC, second GGA only") - << bytes << (QList() << dt.addSecs(2) << dt.addSecs(3)) - << (QList() << true << true) + << bytes << (QList() << dt.addMSecs(200) << dt.addMSecs(300)) + << (QList() << true << true) // accuracies are currently cached and injected in QGeoPositionInfos that do not have it << (QList() << false << false); // should not receive ZDA (has no coordinates) but should get the GGA // sentence after it since it got the date/time from ZDA bytes.clear(); - bytes += QLocationTestUtils::createGgaSentence(dt.addSecs(1).time()).toLatin1(); - bytes += QLocationTestUtils::createZdaSentence(dt.addSecs(2)).toLatin1(); - bytes += QLocationTestUtils::createGgaSentence(dt.addSecs(3).time()).toLatin1(); + bytes += QLocationTestUtils::createGgaSentence(dt.addMSecs(100).time()).toLatin1(); + bytes += QLocationTestUtils::createZdaSentence(dt.addMSecs(200)).toLatin1(); + bytes += QLocationTestUtils::createGgaSentence(dt.addMSecs(300).time()).toLatin1(); QTest::newRow("Feed GGA,ZDA,GGA; expect second GGA only") - << bytes << (QList() << dt.addSecs(3)) + << bytes << (QList() << dt.addMSecs(300)) << (QList() << true) << (QList() << false); // Feed ZDA,GGA,GSA,GGA; expect vertical accuracy from second GGA. bytes.clear(); - bytes += QLocationTestUtils::createZdaSentence(dt.addSecs(1)).toLatin1(); - bytes += QLocationTestUtils::createGgaSentence(dt.addSecs(2).time()).toLatin1(); + bytes += QLocationTestUtils::createZdaSentence(dt.addMSecs(100)).toLatin1(); + bytes += QLocationTestUtils::createGgaSentence(dt.addMSecs(200).time()).toLatin1(); bytes += QLocationTestUtils::createGsaSentence().toLatin1(); - bytes += QLocationTestUtils::createGgaSentence(dt.addSecs(3).time()).toLatin1(); - QTest::newRow("Feed ZDA,GGA,GSA,GGA; expect vertical accuracy from second GGA") - << bytes << (QList() << dt.addSecs(2) << dt.addSecs(3)) - << (QList() << true << true) - << (QList() << false << true); + bytes += QLocationTestUtils::createGgaSentence(dt.addMSecs(300).time()).toLatin1(); + if (m_mode == QNmeaPositionInfoSource::SimulationMode) { + QTest::newRow("Feed ZDA,GGA,GSA,GGA; expect vertical accuracy from second GGA") + << bytes << (QList() << dt.addMSecs(200) << dt.addMSecs(300)) + << (QList() << true << true) + << (QList() << true << true); // First GGA gets VDOP from GSA bundled into previous, as it has no timestamp, second GGA gets the cached value. + } else { + // FixMe: remove else block once NMEA realtime mode supports timestamp-based combination of nmea sentences + QTest::newRow("Feed ZDA,GGA,GSA,GGA; expect vertical accuracy from second GGA") + << bytes << (QList() << dt.addMSecs(200) << dt.addMSecs(300)) + << (QList() << true << true) + << (QList() << false << true); + + } if (m_mode == QNmeaPositionInfoSource::SimulationMode) { // In sim m_mode, should ignore sentence with a date/time before the known date/time // (in real time m_mode, everything is passed on regardless) bytes.clear(); - bytes += QLocationTestUtils::createRmcSentence(dt.addSecs(1)).toLatin1(); - bytes += QLocationTestUtils::createRmcSentence(dt.addSecs(-2)).toLatin1(); - bytes += QLocationTestUtils::createRmcSentence(dt.addSecs(2)).toLatin1(); + bytes += QLocationTestUtils::createRmcSentence(dt.addMSecs(100)).toLatin1(); + bytes += QLocationTestUtils::createRmcSentence(dt.addMSecs(-200)).toLatin1(); + bytes += QLocationTestUtils::createRmcSentence(dt.addMSecs(200)).toLatin1(); QTest::newRow("Feed good RMC, RMC with bad date/time, good RMC; expect first and third RMC only") - << bytes << (QList() << dt.addSecs(1) << dt.addSecs(2)) + << bytes << (QList() << dt.addMSecs(100) << dt.addMSecs(200)) << (QList() << false << false) << (QList() << false << false); } -- cgit v1.2.1