fix QCOMPARE_WITH_ABS_ERROR for floats

This commit is contained in:
Andrew Meadows 2015-08-10 14:45:57 -07:00
parent 6db47e773f
commit 4a8baafdd2

View file

@ -168,7 +168,7 @@ bool QTest_compareWithAbsError(
int line, const char* file,
const V& epsilon
) {
if (abs(getErrorDifference(actual, expected)) > abs(epsilon)) {
if (fabsf(getErrorDifference(actual, expected)) > fabsf(epsilon)) {
QTest_failWithMessage(
"Compared values are not the same (fuzzy compare)",
actual, expected, actual_expr, expected_expr, line, file,