qRound: do not expect failure on ARM64

Amend aa136d46e1 that changed qRound()
implementation to use __builtin_round() functions on ARM64 which do
not fail "round largest representable float less than 0.5" test,
unlike the simple version of qRound() used elsewhere.

Change-Id: Ic66cb0f826d91cd6a85ad72b646c79ded1c0eeca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
bb10
Samuli Piippo 2020-12-14 12:23:34 +02:00
parent 1461df2ce4
commit 331fdee9dd
1 changed files with 8 additions and 0 deletions

View File

@ -623,14 +623,18 @@ void tst_QGlobal::qRoundFloats() {
QFETCH(float, actual);
QFETCH(float, expected);
#if !(defined(Q_PROCESSOR_ARM_64) && (__has_builtin(__builtin_round) || defined(Q_CC_GNU)) && !defined(Q_CC_CLANG))
QEXPECT_FAIL("round largest representable float less than 0.5",
"We know qRound fails in this case, but decided that we value simplicity over correctness",
Continue);
#endif
QCOMPARE(qRound(actual), expected);
#if !(defined(Q_PROCESSOR_ARM_64) && (__has_builtin(__builtin_round) || defined(Q_CC_GNU)) && !defined(Q_CC_CLANG))
QEXPECT_FAIL("round largest representable float less than 0.5",
"We know qRound fails in this case, but decided that we value simplicity over correctness",
Continue);
#endif
QCOMPARE(qRound64(actual), expected);
}
@ -648,14 +652,18 @@ void tst_QGlobal::qRoundDoubles() {
QFETCH(double, actual);
QFETCH(double, expected);
#if !(defined(Q_PROCESSOR_ARM_64) && (__has_builtin(__builtin_round) || defined(Q_CC_GNU)) && !defined(Q_CC_CLANG))
QEXPECT_FAIL("round largest representable double less than 0.5",
"We know qRound fails in this case, but decided that we value simplicity over correctness",
Continue);
#endif
QCOMPARE(qRound(actual), expected);
#if !(defined(Q_PROCESSOR_ARM_64) && (__has_builtin(__builtin_round) || defined(Q_CC_GNU)) && !defined(Q_CC_CLANG))
QEXPECT_FAIL("round largest representable double less than 0.5",
"We know qRound fails in this case, but decided that we value simplicity over correctness",
Continue);
#endif
QCOMPARE(qRound64(actual), expected);
}