Rearrange the skipping of a test to give a better message

When tst_QDateTime::fromStringStringFormat_localTimeZone_data() skips
due to feature timezone being undefined, it should report that as the
issue, rather than claiming the system doesn't support the particular
zones used in the test.

Change-Id: I9837ac95c6d92317fbec7fcca184f7b7e6f81441
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Edward Welbourne 2022-07-18 10:55:30 +02:00
parent 0a36a7c1db
commit a9b46b79dd
1 changed files with 4 additions and 2 deletions

View File

@ -2960,9 +2960,9 @@ 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)
bool lacksRows = true;
// Note that the localTimeZone needn't match the zone used in the string and
// expected date-time; indeed, having them different is probably best.
// Both zones need to be valid; GMT always is, so is a safe one to use for
@ -3005,9 +3005,11 @@ void tst_QDateTime::fromStringStringFormat_localTimeZone_data()
<< QString("210506000000Z") << QString("yyMMddHHmmsst")
<< QDateTime(QDate(1921, 5, 6), QTime(0, 0), Qt::UTC);
}
#endif
if (lacksRows)
QSKIP("Testcases all use zones unsupported on this platform");
#else
QSKIP("Test only possible with timezone support enabled");
#endif
}
void tst_QDateTime::fromStringStringFormat_localTimeZone()