summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qglobal
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2020-12-14 12:23:34 +0200
committerSamuli Piippo <samuli.piippo@qt.io>2020-12-17 18:29:48 +0000
commit331fdee9dd930878f245f09a155da60742bae45e (patch)
treee0e2a374e8292755510d6e553da65a38d7a71e22 /tests/auto/corelib/global/qglobal
parent1461df2ce4ea0283759e653612208c8729a03d7a (diff)
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 <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/corelib/global/qglobal')
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp8
1 files changed, 8 insertions, 0 deletions
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);
}