Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.11, 5.12
-
None
-
Reproducible on Linux, not sure about others. CI only runs those tests on Linux.
-
fb20d2f7b149725b0fcc8e5bbb377cd6dababc9b
Description
The ch15/15.9/15.9.5/15.9.5.43/15.9.5.43-0-8 test from the ES5 tests began failing on March 11th when the US time zones enter summer time daylight savings.
Reduced test-case (can be reduced further of course):
function runTestCase(testcase) { if (testcase() !== true) { print("Test case returned non-true value!"); } } function testcase() { var timeZoneMinutes = new Date().getTimezoneOffset() * (-1); var date, dateStr; try { if (timeZoneMinutes > 0) { date = new Date(1970, 0, -99999999, 0, 0, 0, -1); } else { date = new Date(1970, 0, -99999999, 0, 0 + timeZoneMinutes - 60, 0, -1); } dateStr = date.toISOString(); return false; } catch (e) { return e instanceof RangeError; } } runTestCase(testcase);
Run with qmljs test.js and observe how with TZ="America/Vancouver" qmljs test.js it fails (on Linux box configured to CET).
When "passes" we run into the first if() and the resulting date object is a NaN because the intermediate double value crosses the 8.64e15 threshold in TimeClip, causing the toISOString() call to throw the expected range error.
When it "fails" we have timeZoneMinutes == -420 and end up with -480 as value for the minutes parameter to the Date constructor. The resulting intermediate double value passed to TimeClip is just below the 8.64e15 threshold and we don't generate a NaN date.
Attachments
Issue Links
- resulted from
-
QTBUG-56787 V4's Date constructor fails to take account of variations in time-zone offset
- Closed
For Gerrit Dashboard: QTBUG-67010 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
222906,2 | Change number of days in test to make date actually out of range | snapshot-20150317-8f6a508-based | qt/qtdeclarative-testsuites | Status: MERGED | +2 | 0 |
222909,3 | Fix failing ch15.9.5.43-0-8 after US summer time change | 5.11 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
226899,2 | Use Los Angeles to represent PST8PDT, not Vancouver | 5.11 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
227095,2 | Update submodule now that I've fixed the actual bug here | 5.11 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
257789,1 | Fix failing ch15.9.5.43-0-8 after US summer time change | 5.9.8 | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
257865,3 | Use Los Angeles to represent PST8PDT, not Vancouver | 5.9.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |