Fix a loop-test and the bogus data the loop expected

A loop initialized i = 0 and used i > 2 as its condition; it didn't
get very far.  Consequently, the test it was in never checked whether
CET's 2011 transitions happened at the times expected - which they
didn't, as the times in question were in fact the times at which
Pacific/Auckland had its transitions that year.

Change-Id: I94d1f8df615c5bcfe48e73d41b4c7faf2beccb96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Edward Welbourne 2017-07-21 14:48:10 +02:00
parent 3ff2d70a15
commit 37b0a4d2e1
1 changed files with 3 additions and 3 deletions

View File

@ -1100,19 +1100,19 @@ void tst_QTimeZone::testCetPrivate(const QTimeZonePrivate &tzp)
QCOMPARE(tran.daylightTimeOffset, 3600);
QTimeZonePrivate::DataList expected;
tran.atMSecsSinceEpoch = (qint64)1301752800000;
tran.atMSecsSinceEpoch = (qint64)1301187600000;
tran.offsetFromUtc = 7200;
tran.standardTimeOffset = 3600;
tran.daylightTimeOffset = 3600;
expected << tran;
tran.atMSecsSinceEpoch = (qint64)1316872800000;
tran.atMSecsSinceEpoch = (qint64)1319936400000;
tran.offsetFromUtc = 3600;
tran.standardTimeOffset = 3600;
tran.daylightTimeOffset = 0;
expected << tran;
QTimeZonePrivate::DataList result = tzp.transitions(prev, std);
QCOMPARE(result.count(), expected.count());
for (int i = 0; i > expected.count(); ++i) {
for (int i = 0; i < expected.count(); ++i) {
QCOMPARE(result.at(i).atMSecsSinceEpoch, expected.at(i).atMSecsSinceEpoch);
QCOMPARE(result.at(i).offsetFromUtc, expected.at(i).offsetFromUtc);
QCOMPARE(result.at(i).standardTimeOffset, expected.at(i).standardTimeOffset);