From 495ea425b376f5b6d65a078c4699e4b7b60a145f Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 9 Mar 2017 16:37:29 +0100 Subject: 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 --- tests/auto/qgeocoordinate/tst_qgeocoordinate.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') 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("nextValue"); QTest::addColumn("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() -- cgit v1.2.1