summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qlocale
diff options
context:
space:
mode:
authorTatiana Borisova <tatiana.borisova@qt.io>2022-02-01 13:26:17 +0200
committerTatiana Borisova <tatiana.borisova@qt.io>2022-02-15 00:48:23 +0200
commit23fd249b85f6fd5e6c51b7f969460dab60c2554a (patch)
tree139b03ffed21fd578fdcfdf3c3c7a9e5c30e0d85 /tests/auto/corelib/text/qlocale
parent7794421bea8550d16ad6209536909931709045bb (diff)
Exclude denormal test cases if system doesn't support it
- current INTEGRITY development pack don't support denormals for float and double. All values are rounded to 0. Task-number: QTBUG-99123 Pick-to: 6.2 6.3 Change-Id: Iaaacdc4210c7ac2ec3ec337c61164a1ade0efb01 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/text/qlocale')
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
index 52224701f6..7b9934dec1 100644
--- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
@@ -998,10 +998,24 @@ void tst_QLocale::stringToFloat()
QLocale locale(locale_name);
QCOMPARE(locale.name(), locale_name);
+ if constexpr (std::numeric_limits<float>::has_denorm != std::denorm_present) {
+ if (qstrcmp(QTest::currentDataTag(), "C float -min") == 0
+ || qstrcmp(QTest::currentDataTag(), "C float min") == 0)
+ QSKIP("Skipping 'denorm' as this type lacks denormals on this system");
+ }
bool ok;
float f = locale.toFloat(num_str, &ok);
QCOMPARE(ok, good);
+ if constexpr (std::numeric_limits<double>::has_denorm != std::denorm_present) {
+ if (qstrcmp(QTest::currentDataTag(), "C double min") == 0
+ || qstrcmp(QTest::currentDataTag(), "C double -min") == 0
+ || qstrcmp(QTest::currentDataTag(), "C tiny") == 0
+ || qstrcmp(QTest::currentDataTag(), "C -tiny") == 0) {
+ QSKIP("Skipping 'denorm' as this type lacks denormals on this system");
+ }
+ }
+
{
// Make sure result is independent of locale:
TransientLocale ignoreme(LC_ALL, "ar_SA.UTF-8");