diff options
author | John Layt <jlayt@kde.org> | 2013-09-03 20:40:49 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-05 10:41:56 +0200 |
commit | 8784a4a46ea1357bde546c9a1c88bd060e863f30 (patch) | |
tree | 66f8e2689b08da3d03592bc3906c4778e58efef4 /tests/auto | |
parent | 87ccf530772caa5d388d97b556183fb20930ef38 (diff) |
Fix qqmllocale test to use correct spec and time zone
By including the +10:00 offset in the date strings the test is actually
creating Qt::OffsetFromUTC datetimes, not QT::LocalTime datetimes. The
only reason the test currently passes is due to a bug in the QLocale
datetime formatter which uses the current system daylight time
abbreviation in all cases regardless of the datetime spec or if
daylight or standard time. Change 61774 fixes this bug but cannot
be merged as this test now fails. This change fixes the bug by
removing the offset, causing Qt:LocalTime datetimes to be created
which pass the test both before and after change 61774.
See https://codereview.qt-project.org/#change,61774
Change-Id: I1642ab7c8aa516b703216f3791e2fc60866d1895
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qqmllocale/data/timeZoneUpdated.qml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/qml/qqmllocale/data/timeZoneUpdated.qml b/tests/auto/qml/qqmllocale/data/timeZoneUpdated.qml index cc6e1437ab..ba34e005d0 100644 --- a/tests/auto/qml/qqmllocale/data/timeZoneUpdated.qml +++ b/tests/auto/qml/qqmllocale/data/timeZoneUpdated.qml @@ -13,11 +13,11 @@ Item { if (localDate.getTimezoneOffset() != -600) return - if (localDate.toLocaleString() != getLocalizedForm('2012-06-01T02:15:30+10:00')) return + if (localDate.toLocaleString() != getLocalizedForm('2012-06-01T02:15:30')) return if (localDate.toISOString() != "2012-05-31T16:15:30.000Z") return if (utcDate.toISOString() != "2012-06-01T02:15:30.000Z") return - if (utcDate.toLocaleString() != getLocalizedForm('2012-06-01T12:15:30+10:00')) return + if (utcDate.toLocaleString() != getLocalizedForm('2012-06-01T12:15:30')) return success = true } @@ -30,21 +30,21 @@ Item { if (localDate.getTimezoneOffset() != -330) return - if (localDate.toLocaleString() != getLocalizedForm('2012-06-01T02:15:30+05:30')) return + if (localDate.toLocaleString() != getLocalizedForm('2012-06-01T02:15:30')) return if (localDate.toISOString() != "2012-05-31T20:45:30.000Z") return if (utcDate.toISOString() != "2012-06-01T06:45:30.000Z") return - if (utcDate.toLocaleString() != getLocalizedForm("2012-06-01T12:15:30+05:30")) return + if (utcDate.toLocaleString() != getLocalizedForm("2012-06-01T12:15:30")) return // Create new dates in this timezone localDate = new Date(2012, 6-1, 1, 2, 15, 30) utcDate = new Date(Date.UTC(2012, 6-1, 1, 2, 15, 30)) - if (localDate.toLocaleString() != getLocalizedForm("2012-06-01T02:15:30+05:30")) return + if (localDate.toLocaleString() != getLocalizedForm("2012-06-01T02:15:30")) return if (localDate.toISOString() != "2012-05-31T20:45:30.000Z") return if (utcDate.toISOString() != "2012-06-01T02:15:30.000Z") return - if (utcDate.toLocaleString() != getLocalizedForm("2012-06-01T07:45:30+05:30")) return + if (utcDate.toLocaleString() != getLocalizedForm("2012-06-01T07:45:30")) return success = true } |