From 37b0a4d2e14ea167eff5f43ef374defb9a17c3d0 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 21 Jul 2017 14:48:10 +0200 Subject: 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 --- tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp index 714eb8a22a..ccad9299d3 100644 --- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp @@ -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); -- cgit v1.2.3