summaryrefslogtreecommitdiff
path: root/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp')
-rw-r--r--tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp b/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp
index 886d7009..37fe7abc 100644
--- a/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp
+++ b/tests/auto/qnmeapositioninfosource/tst_qnmeapositioninfosource.cpp
@@ -147,13 +147,14 @@ void tst_QNmeaPositionInfoSource::lastKnownPosition()
QList<QDateTime> dateTimes = createDateTimes(5);
for (int i=0; i<dateTimes.count(); i++) {
- proxy->source()->requestUpdate();
+ proxy->source()->requestUpdate(); // Irrelevant for this test
proxy->feedUpdate(dateTimes[i]);
QTRY_COMPARE(proxy->source()->lastKnownPosition().timestamp(), dateTimes[i]);
}
proxy->source()->startUpdates();
- dateTimes = createDateTimes(5);
+ // if dateTimes are older than before, they will be ignored.
+ dateTimes = createDateTimes(dateTimes.last().addMSecs(100), 5);
for (int i=0; i<dateTimes.count(); i++) {
proxy->feedUpdate(dateTimes[i]);
QTRY_COMPARE(proxy->source()->lastKnownPosition().timestamp(), dateTimes[i]);
@@ -358,8 +359,10 @@ void tst_QNmeaPositionInfoSource::startUpdates_waitForValidDateTime()
QObject::connect(proxy->source(), &QNmeaPositionInfoSource::positionUpdated, [](const QGeoPositionInfo &info) {
qDebug() << info.timestamp();
});
+
proxy->source()->startUpdates();
proxy->feedBytes(bytes);
+ QTest::qWait(1000); // default push delay is 20ms
QTRY_COMPARE(spy.count(), dateTimes.count());
for (int i=0; i<spy.count(); i++) {
@@ -397,6 +400,7 @@ void tst_QNmeaPositionInfoSource::startUpdates_waitForValidDateTime_data()
bytes += QLocationTestUtils::createGgaSentence(dt.addMSecs(100).time()).toLatin1();
bytes += QLocationTestUtils::createRmcSentence(dt.addMSecs(200)).toLatin1();
bytes += QLocationTestUtils::createGgaSentence(dt.addMSecs(300).time()).toLatin1();
+ // The first GGA does not have date, and there's no cached date to inject, so that update will be invalid
QTest::newRow("Feed GGA,RMC,GGA; expect RMC, second GGA only")
<< bytes << (QList<QDateTime>() << dt.addMSecs(200) << dt.addMSecs(300))
<< (QList<bool>() << true << true) // accuracies are currently cached and injected in QGeoPositionInfos that do not have it
@@ -424,13 +428,6 @@ void tst_QNmeaPositionInfoSource::startUpdates_waitForValidDateTime_data()
<< bytes << (QList<QDateTime>() << dt.addMSecs(200) << dt.addMSecs(300))
<< (QList<bool>() << true << true)
<< (QList<bool>() << 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<QDateTime>() << dt.addMSecs(200) << dt.addMSecs(300))
- << (QList<bool>() << true << true)
- << (QList<bool>() << false << true);
-
}
if (m_mode == QNmeaPositionInfoSource::SimulationMode) {