diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-11-24 17:25:45 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-11-26 02:14:52 +0100 |
commit | 6437bd240f64a60e376ff3c5432c9d7e53072782 (patch) | |
tree | 27c4916e5c482f952a30e640c568cc1a11bb3ee3 /tests | |
parent | 297f9aa6c8cd3d7f4c2e7f4e283ca44bd6c5a9a9 (diff) |
Skip test if it has no data-rows
On QNX, tst_QDateTime::fromStringStringFormat_localTimeZone_data()
failed to set up any rows for the data-driven tests to fetch, leading
to an assertion failure on trying to fetch a row.
Change-Id: I7c405b1142a8cb6d445b501ea44fe3d440570cf3
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index ef0be8a97c..b8f61ea8fd 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -2902,10 +2902,12 @@ void tst_QDateTime::fromStringStringFormat_localTimeZone_data() QTest::addColumn<QString>("string"); QTest::addColumn<QString>("format"); QTest::addColumn<QDateTime>("expected"); + bool lacksRows = true; #if QT_CONFIG(timezone) QTimeZone etcGmtWithOffset("Etc/GMT+3"); if (etcGmtWithOffset.isValid()) { + lacksRows = false; QTest::newRow("local-timezone-with-offset:Etc/GMT+3") << QByteArrayLiteral("GMT") << QString("2008-10-13 Etc/GMT+3 11.50") << QString("yyyy-MM-dd t hh.mm") << QDateTime(QDate(2008, 10, 13), QTime(11, 50), etcGmtWithOffset); @@ -2916,18 +2918,21 @@ void tst_QDateTime::fromStringStringFormat_localTimeZone_data() } QTimeZone gmtWithOffset("GMT-2"); if (gmtWithOffset.isValid()) { + lacksRows = false; QTest::newRow("local-timezone-with-offset:GMT-2") << QByteArrayLiteral("GMT") << QString("2008-10-13 GMT-2 11.50") << QString("yyyy-MM-dd t hh.mm") << QDateTime(QDate(2008, 10, 13), QTime(11, 50), gmtWithOffset); } QTimeZone gmt("GMT"); if (gmt.isValid()) { + lacksRows = false; QTest::newRow("local-timezone-with-offset:GMT") << QByteArrayLiteral("GMT") << QString("2008-10-13 GMT 11.50") << QString("yyyy-MM-dd t hh.mm") << QDateTime(QDate(2008, 10, 13), QTime(11, 50), gmt); } QTimeZone helsinki("Europe/Helsinki"); if (helsinki.isValid()) { + lacksRows = false; // QTBUG-96861: QAsn1Element::toDateTime() tripped over an assert in // QTimeZonePrivate::dataForLocalTime() on macOS and iOS. // The first 20m 11s of 1921-05-01 were skipped, so the parser's attempt @@ -2939,6 +2944,8 @@ void tst_QDateTime::fromStringStringFormat_localTimeZone_data() << QDateTime(QDate(1921, 5, 6), QTime(0, 0), Qt::UTC); } #endif + if (lacksRows) + QSKIP("Testcases all use zones unsupported on this platform"); } void tst_QDateTime::fromStringStringFormat_localTimeZone() |