From eeb1f8d3a41263273f2a509910d5cbe845598545 Mon Sep 17 00:00:00 2001 From: "pschwartau%netscape.com" Date: Tue, 26 Dec 2000 20:02:04 +0000 Subject: [PATCH] Adjusting hard-coded Pacific timezone date testcases to work in any tester's timezone - --- js/tests/ecma/Date/15.9.3.1-1.js | 12 +++++++----- js/tests/ecma/Date/15.9.3.1-2.js | 7 ++++--- js/tests/ecma/Date/15.9.3.1-3.js | 7 ++++--- js/tests/ecma/Date/15.9.3.1-4.js | 7 ++++--- js/tests/ecma/Date/15.9.3.1-5.js | 7 ++++--- js/tests/ecma/Date/15.9.3.2-1.js | 4 ++-- js/tests/ecma/Date/15.9.3.2-2.js | 4 ++-- js/tests/ecma/Date/15.9.3.2-3.js | 4 ++-- js/tests/ecma/Date/15.9.3.2-4.js | 4 ++-- js/tests/ecma/Date/15.9.3.2-5.js | 4 ++-- js/tests/ecma/Date/15.9.3.8-1.js | 7 +++++-- js/tests/ecma/Date/15.9.3.8-2.js | 6 ++++-- js/tests/ecma/Date/15.9.3.8-3.js | 6 ++++-- js/tests/ecma/Date/15.9.3.8-4.js | 6 ++++-- js/tests/ecma/Date/15.9.3.8-5.js | 7 +++++-- 15 files changed, 55 insertions(+), 37 deletions(-) diff --git a/js/tests/ecma/Date/15.9.3.1-1.js b/js/tests/ecma/Date/15.9.3.1-1.js index d711f93d3df..a7ccbe0bbaa 100644 --- a/js/tests/ecma/Date/15.9.3.1-1.js +++ b/js/tests/ecma/Date/15.9.3.1-1.js @@ -85,8 +85,8 @@ test(); function getTestCases( ) { - - var TZ_ADJUST = TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; // Dates around 1970 @@ -129,7 +129,7 @@ function getTestCases( ) { addNewTestCase( new Date(1969,11,31,23,59,59,1000), "new Date(1969,11,31,23,59,59,1000)", [TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] ); -/* + // Dates around 2000 addNewTestCase( new Date( 1999,11,31,15,59,59,999), @@ -202,7 +202,7 @@ function getTestCases( ) { addNewTestCase( new Date(2004,11,31,16,0,0,0), "new Date(2004,11,31,16,0,0,0)", [UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); -*/ + /* This test case is incorrect. Need to fix the DaylightSavings functions in shell.js for this to work properly. @@ -232,7 +232,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); var item = testcases.length; @@ -258,6 +259,7 @@ function addNewTestCase( DateCase, DateString, ResultArray ) { testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); } + function test() { for( tc = 0; tc < testcases.length; tc++ ) { diff --git a/js/tests/ecma/Date/15.9.3.1-2.js b/js/tests/ecma/Date/15.9.3.1-2.js index cb770a76641..c268aa3b85f 100644 --- a/js/tests/ecma/Date/15.9.3.1-2.js +++ b/js/tests/ecma/Date/15.9.3.1-2.js @@ -85,8 +85,8 @@ test(); function getTestCases( ) { - - var TZ_ADJUST = TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; // Dates around 2000 @@ -190,7 +190,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); var item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.1-3.js b/js/tests/ecma/Date/15.9.3.1-3.js index deaf042a7f7..7dcd8ce76ea 100644 --- a/js/tests/ecma/Date/15.9.3.1-3.js +++ b/js/tests/ecma/Date/15.9.3.1-3.js @@ -85,8 +85,8 @@ test(); function getTestCases( ) { - - var TZ_ADJUST = TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; // Dates around 29 Feb 2000 @@ -168,7 +168,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); var item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.1-4.js b/js/tests/ecma/Date/15.9.3.1-4.js index f1dd562f870..31f07cb7a1f 100644 --- a/js/tests/ecma/Date/15.9.3.1-4.js +++ b/js/tests/ecma/Date/15.9.3.1-4.js @@ -85,8 +85,8 @@ test(); function getTestCases( ) { - - var TZ_ADJUST = TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; // Dates around 1900 @@ -152,7 +152,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); var item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.1-5.js b/js/tests/ecma/Date/15.9.3.1-5.js index d874488890d..32fd9c42036 100644 --- a/js/tests/ecma/Date/15.9.3.1-5.js +++ b/js/tests/ecma/Date/15.9.3.1-5.js @@ -85,8 +85,8 @@ test(); function getTestCases( ) { - - var TZ_ADJUST = TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = TZ_PST * msPerHour; // Dates around 2005 @@ -129,7 +129,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); var item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.2-1.js b/js/tests/ecma/Date/15.9.3.2-1.js index 120e360c909..6b86e815e0f 100644 --- a/js/tests/ecma/Date/15.9.3.2-1.js +++ b/js/tests/ecma/Date/15.9.3.2-1.js @@ -199,8 +199,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.2-2.js b/js/tests/ecma/Date/15.9.3.2-2.js index 893a61fd9d6..76d7084b8cf 100644 --- a/js/tests/ecma/Date/15.9.3.2-2.js +++ b/js/tests/ecma/Date/15.9.3.2-2.js @@ -177,8 +177,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.2-3.js b/js/tests/ecma/Date/15.9.3.2-3.js index 70054c3ab4b..c0cbbbc3677 100644 --- a/js/tests/ecma/Date/15.9.3.2-3.js +++ b/js/tests/ecma/Date/15.9.3.2-3.js @@ -163,8 +163,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.2-4.js b/js/tests/ecma/Date/15.9.3.2-4.js index 1237ed47a3e..36aaa6d2407 100644 --- a/js/tests/ecma/Date/15.9.3.2-4.js +++ b/js/tests/ecma/Date/15.9.3.2-4.js @@ -146,8 +146,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.2-5.js b/js/tests/ecma/Date/15.9.3.2-5.js index 846c1764f23..02dc72f96b7 100644 --- a/js/tests/ecma/Date/15.9.3.2-5.js +++ b/js/tests/ecma/Date/15.9.3.2-5.js @@ -128,8 +128,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray); item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.8-1.js b/js/tests/ecma/Date/15.9.3.8-1.js index 24e05317aec..06e3ed7828a 100644 --- a/js/tests/ecma/Date/15.9.3.8-1.js +++ b/js/tests/ecma/Date/15.9.3.8-1.js @@ -90,7 +90,9 @@ test(); function getTestCases( ) { - var TZ_ADJUST = -TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; + // Dates around 1970 addNewTestCase( new Date(0), @@ -257,7 +259,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.8-2.js b/js/tests/ecma/Date/15.9.3.8-2.js index f71f2b8269b..47c1f95b64f 100644 --- a/js/tests/ecma/Date/15.9.3.8-2.js +++ b/js/tests/ecma/Date/15.9.3.8-2.js @@ -90,7 +90,8 @@ test(); function getTestCases( ) { - var TZ_ADJUST = -TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; addNewTestCase( new Date((new Date(0)).toUTCString()), "new Date(\""+ (new Date(0)).toUTCString()+"\" )", @@ -233,7 +234,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.8-3.js b/js/tests/ecma/Date/15.9.3.8-3.js index 492a3945812..d3965f74858 100644 --- a/js/tests/ecma/Date/15.9.3.8-3.js +++ b/js/tests/ecma/Date/15.9.3.8-3.js @@ -90,7 +90,8 @@ test(); function getTestCases( ) { - var TZ_ADJUST = -TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; // Dates around 2000 @@ -211,7 +212,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.8-4.js b/js/tests/ecma/Date/15.9.3.8-4.js index 3111301de0b..49d9ee7beb5 100644 --- a/js/tests/ecma/Date/15.9.3.8-4.js +++ b/js/tests/ecma/Date/15.9.3.8-4.js @@ -90,7 +90,8 @@ test(); function getTestCases( ) { - var TZ_ADJUST = -TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; // Dates around Feb 29, 2000 @@ -180,7 +181,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); item = testcases.length; diff --git a/js/tests/ecma/Date/15.9.3.8-5.js b/js/tests/ecma/Date/15.9.3.8-5.js index 622d7116e76..bb7bef502ad 100644 --- a/js/tests/ecma/Date/15.9.3.8-5.js +++ b/js/tests/ecma/Date/15.9.3.8-5.js @@ -90,7 +90,9 @@ test(); function getTestCases( ) { - var TZ_ADJUST = -TZ_DIFF * msPerHour; + // all the "ResultArrays" below are hard-coded to Pacific Standard Time values - + var TZ_ADJUST = -TZ_PST * msPerHour; + // Dates around 1900 @@ -147,7 +149,8 @@ function getTestCases( ) { } function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; + //adjust hard-coded ResultArray for tester's timezone instead of PST + adjustResultArray(ResultArray, 'msMode'); item = testcases.length;