summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-11-16 12:06:23 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2020-11-17 19:55:04 +0100
commitc0829d6131709f00ca5957a85850ec07d7fa256d (patch)
tree1c31d18d8fdfe8bc469951d88e9371f59d39fb7a /tests
parent17701a95f8612865191f7719df1879c4114d8f6c (diff)
Improve qFloatDistance() test coverage
Four code-paths that weren't tested are simply those with the parameters swapped from code-paths we did test. In any case, the float-distance between values should be symmetric, so test that. Task-number: QTBUG-88183 Change-Id: I2060eb77b1abada5b0fd5f4557dbb1761c5cfd02 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
index 9dc2c02c3b..526fbbabb2 100644
--- a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
+++ b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
@@ -370,6 +370,7 @@ void tst_QNumeric::distance()
QEXPECT_FAIL("denormal", "See QTBUG-37094", Continue);
#endif
QCOMPARE(qFloatDistance(from, stop), expectedDistance);
+ QCOMPARE(qFloatDistance(stop, from), expectedDistance);
}
// Whole number tests: