From d782df48612a932f03a579c889670d34c26e9574 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 28 Jul 2020 11:46:30 +0200 Subject: Make qfloat16 helper functions consistent with float/double versions Infinite is only when the mantissa is 0, everything else is NaN. std::isnormal returns false on zero. Pick-to: 5.15 Change-Id: I897fc0dc3b8a9c557bb1922ea7ca8df501e91859 Reviewed-by: Thiago Macieira --- tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/corelib') diff --git a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp index a661b0388e..99f539f341 100644 --- a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp +++ b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp @@ -423,7 +423,7 @@ void tst_qfloat16::finite() { QFETCH(qfloat16, value); QFETCH(int, mode); - QCOMPARE(value.isNormal(), mode != FP_SUBNORMAL); + QCOMPARE(value.isNormal(), mode == FP_NORMAL); QCOMPARE(value, value); // Fuzzy QVERIFY(value == value); // Exact QVERIFY(qIsFinite(value)); -- cgit v1.2.3