Autotest: fix the QTimeZone::tzTest failure when database contains LMT
On some operating systems, tzdata files carry the Local Mean Time (LMT) for the city in question, which better represents how time was tracked before standard, hourly timezones were introduced in the early 20th century. The test was asking for the data for 1653-02-09 and assumed that it would find the first Central European Time (CET) rule, which Germany didn't start using until 1893-04-01. This fix allows us to remove the blacklist that had been applied to this test without investigation. It wasn't related to OpenSUSE, aside from the fact that OpenSUSE tzdata carries the LMT data. Change-Id: Id5480807d25e49e78b79ffff1449bdaf46901367 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
This commit is contained in:
parent
89d1c7c179
commit
ab2f768a8f
@ -1,2 +0,0 @@
|
||||
[tzTest]
|
||||
opensuse-13.1
|
@ -767,16 +767,22 @@ void tst_QTimeZone::tzTest()
|
||||
// Warning: This could vary depending on age of TZ file!
|
||||
|
||||
// Test low date uses first rule found
|
||||
// Note: Depending on the OS in question, the database may be carrying the
|
||||
// Local Mean Time. which for Berlin is 0:53:28
|
||||
QTimeZonePrivate::Data dat = tzp.data(-9999999999999);
|
||||
QCOMPARE(dat.atMSecsSinceEpoch, (qint64)-9999999999999);
|
||||
QCOMPARE(dat.standardTimeOffset, 3600);
|
||||
QCOMPARE(dat.daylightTimeOffset, 0);
|
||||
if (dat.abbreviation == "LMT") {
|
||||
QCOMPARE(dat.standardTimeOffset, 3208);
|
||||
} else {
|
||||
QCOMPARE(dat.standardTimeOffset, 3600);
|
||||
|
||||
// Test previous to low value is invalid
|
||||
dat = tzp.previousTransition(-9999999999999);
|
||||
QCOMPARE(dat.atMSecsSinceEpoch, std::numeric_limits<qint64>::min());
|
||||
QCOMPARE(dat.standardTimeOffset, std::numeric_limits<int>::min());
|
||||
QCOMPARE(dat.daylightTimeOffset, std::numeric_limits<int>::min());
|
||||
}
|
||||
|
||||
dat = tzp.nextTransition(-9999999999999);
|
||||
QCOMPARE(dat.atMSecsSinceEpoch, (qint64)-2422054408000);
|
||||
|
Loading…
Reference in New Issue
Block a user