From 8784a4a46ea1357bde546c9a1c88bd060e863f30 Mon Sep 17 00:00:00 2001 From: John Layt Date: Tue, 3 Sep 2013 20:40:49 +0200 Subject: [PATCH] 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 --- tests/auto/qml/qqmllocale/data/timeZoneUpdated.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/qml/qqmllocale/data/timeZoneUpdated.qml b/tests/auto/qml/qqmllocale/data/timeZoneUpdated.qml index cc6e143..ba34e00 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 } -- 2.7.4