summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-07-09 15:30:49 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-07-09 15:38:31 +0000
commitad8df7215608b69bf2371dbdea36f93886d49f7d (patch)
tree99bd6eab6db86f79505e270173aa73f13512cc19 /tests/auto/corelib/tools
parent8c680ab4694052a957887b57fcc324b7b40a8b3f (diff)
Fix regression in QPointF::operator==
Handle hard zero independently in each coordinate, otherwise hard zero is never equal to anything but itself. Task-number: QTBUG-69368 Change-Id: I8b1131472bb92efc706a04e0b067e2211a5ccb0c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qpointf/tst_qpointf.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp b/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp
index 579991a912..d4ccdf7ba6 100644
--- a/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp
+++ b/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp
@@ -450,6 +450,9 @@ void tst_QPointF::compare()
p3 -= QPointF(0.1, 0.1);
QVERIFY(p3 == QPointF());
+
+ // Test we can compare one dimension with hard zero
+ QVERIFY(QPointF(1.9543e-14, -32.0) == QPointF(0.0, -32.0));
}
QTEST_MAIN(tst_QPointF)