From 331fdee9dd930878f245f09a155da60742bae45e Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 14 Dec 2020 12:23:34 +0200 Subject: [PATCH] qRound: do not expect failure on ARM64 Amend aa136d46e100e65f0d9326ac9319de95673cd6d7 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 --- tests/auto/corelib/global/qglobal/tst_qglobal.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp index 032567cd39..1f64fca3dc 100644 --- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp +++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp @@ -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); }