From c0829d6131709f00ca5957a85850ec07d7fa256d Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 16 Nov 2020 12:06:23 +0100 Subject: Improve qFloatDistance() test coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Thiago Macieira --- tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp') 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: -- cgit v1.2.3