summaryrefslogtreecommitdiff
path: root/tests/auto/qgeocoordinate
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2017-03-09 16:37:29 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-03-09 23:16:59 +0000
commit495ea425b376f5b6d65a078c4699e4b7b60a145f (patch)
treea324a95a611ab4a49ed33abb0243734eaaceadd8 /tests/auto/qgeocoordinate
parent40dbadbb7f6c863553c5474e1dcf8a4d7388a99f (diff)
downloadqtlocation-495ea425b376f5b6d65a078c4699e4b7b60a145f.tar.gz
Increase the QGeoCoordinate debug operator precision
The current precision of 6 digits only ever guarantees 110m on Earth. That's not sufficient for some use cases. A precision of 11 guarantees at least 8 digits after the comma since there are at most three digits before the comma. The 8th digit reflects a geographical precision of 1.1 mm on earth. More precision for navigation purposes is not needed. Task-number: QTBUG-59259 Change-Id: I4f59c152171c3a71f22aa7520718d0fcb611b697 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'tests/auto/qgeocoordinate')
-rw-r--r--tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp b/tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp
index fa9fd5c5..1b30f647 100644
--- a/tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp
+++ b/tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp
@@ -894,16 +894,17 @@ private slots:
QTest::addColumn<int>("nextValue");
QTest::addColumn<QByteArray>("debugString");
-
QTest::newRow("uninitialized") << QGeoCoordinate() << 45
<< QByteArray("QGeoCoordinate(?, ?) 45");
QTest::newRow("initialized without altitude") << BRISBANE << 45
- << (QString("QGeoCoordinate(%1, %2) 45").arg(BRISBANE.latitude())
- .arg(BRISBANE.longitude())).toLatin1();
+ << (QString("QGeoCoordinate(%1, %2) 45").arg(BRISBANE.latitude(), 0, 'g', 9)
+ .arg(BRISBANE.longitude(), 0, 'g', 9)).toLatin1();
QTest::newRow("invalid initialization") << QGeoCoordinate(-100,-200) << 45
<< QByteArray("QGeoCoordinate(?, ?) 45");
QTest::newRow("initialized with altitude") << QGeoCoordinate(1,2,3) << 45
<< QByteArray("QGeoCoordinate(1, 2, 3) 45");
+ QTest::newRow("extra long coordinates") << QGeoCoordinate(89.123412341, 179.123412341)
+ << 45 << QByteArray("QGeoCoordinate(89.123412341, 179.12341234) 45");
}
void hash()