tst_QDateTime: remove silly test for timezone date too early
Let's not try to to compare our QTimeZone handling with the system one. Our handling goes beyond the range of the POSIX APIs, so that's a recipe for error. Change-Id: Iee8cbc07c4434ce9b560ffff13ca4a4f335bdbae Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
c87f8a3797
commit
6272f01617
@ -611,13 +611,11 @@ void tst_QDateTime::setMSecsSinceEpoch()
|
||||
dt2.setTimeZone(europe);
|
||||
dt2.setMSecsSinceEpoch(msecs);
|
||||
QCOMPARE(dt2.date(), european.date());
|
||||
#ifdef Q_OS_MAC
|
||||
// NSTimeZone doesn't apply DST to high values
|
||||
if (msecs < (Q_INT64_C(123456) << 32))
|
||||
#else
|
||||
// Linux and Win are OK except when they overflow
|
||||
if (msecs != std::numeric_limits<qint64>::max())
|
||||
#endif
|
||||
|
||||
// don't compare the time if the date is too early or too late: prior
|
||||
// to 1916, timezones in Europe were not standardised and some OS APIs
|
||||
// have hard limits. Let's restrict it to the 32-bit Unix range
|
||||
if (dt2.date().year() >= 1970 && dt2.date().year() <= 2037)
|
||||
QCOMPARE(dt2.time(), european.time());
|
||||
QCOMPARE(dt2.timeSpec(), Qt::TimeZone);
|
||||
QCOMPARE(dt2.timeZone(), europe);
|
||||
|
Loading…
Reference in New Issue
Block a user