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>
This commit is contained in:
Edward Welbourne 2020-11-16 12:06:23 +01:00
parent 17701a95f8
commit c0829d6131

View File

@ -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: