JavaScript Tests - update Daylight Savings Time, other Date related tests, bug 378683

This commit is contained in:
bclary@bclary.com 2007-04-26 09:25:54 -07:00
Родитель 3231a0ee55
Коммит 2b56c0b433
141 изменённых файлов: 810 добавлений и 4294 удалений

Просмотреть файл

@ -67,8 +67,8 @@ new TestCase( SECTION, "Date(1969,11,31,15,59,59,999)", (new Date()).toStrin
new TestCase( SECTION, "Date(1969,11,31,16,0,0,0)", (new Date()).toString(), Date(1969,11,31,16,0,0,0));
new TestCase( SECTION, "Date(1969,11,31,16,0,0,1)", (new Date()).toString(), Date(1969,11,31,16,0,0,1));
// Dates around 2000
new TestCase( SECTION, "Date(1999,11,15,59,59,999)", (new Date()).toString(), Date(1999,11,15,59,59,999));
// Dates around 2000
new TestCase( SECTION, "Date(1999,11,15,59,59,999)", (new Date()).toString(), Date(1999,11,15,59,59,999));
new TestCase( SECTION, "Date(1999,11,16,0,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0,0));
new TestCase( SECTION, "Date(1999,11,31,23,59,59,999)", (new Date()).toString(), Date(1999,11,31,23,59,59,999) );
new TestCase( SECTION, "Date(2000,0,1,0,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0,0) );

Просмотреть файл

@ -63,38 +63,5 @@ new TestCase( SECTION, "Date(1970,0,1,0,0,0)", (new Date()).toString(),
new TestCase( SECTION, "Date(1969,11,31,15,59,59)", (new Date()).toString(), Date(1969,11,31,15,59,59));
new TestCase( SECTION, "Date(1969,11,31,16,0,0)", (new Date()).toString(), Date(1969,11,31,16,0,0));
new TestCase( SECTION, "Date(1969,11,31,16,0,1)", (new Date()).toString(), Date(1969,11,31,16,0,1));
/*
// Dates around 2000
new TestCase( SECTION, "Date(1999,11,15,59,59)", (new Date()).toString(), Date(1999,11,15,59,59));
new TestCase( SECTION, "Date(1999,11,16,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0));
new TestCase( SECTION, "Date(1999,11,31,23,59,59)", (new Date()).toString(), Date(1999,11,31,23,59,59) );
new TestCase( SECTION, "Date(2000,0,1,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0) );
new TestCase( SECTION, "Date(2000,0,1,0,0,1)", (new Date()).toString(), Date(2000,0,0,0,0,1) );
// Dates around 1900
new TestCase( SECTION, "Date(1899,11,31,23,59,59)", (new Date()).toString(), Date(1899,11,31,23,59,59));
new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0) );
new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) );
new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0));
// Dates around feb 29, 2000
new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));
new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));
new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));
// Dates around jan 1, 2005
new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));
new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
// Dates around jan 1, 2032
new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
test();

Просмотреть файл

@ -64,31 +64,4 @@ new TestCase( SECTION, "Date(1999,11,31,23,59,59)", (new Date()).toString(),
new TestCase( SECTION, "Date(2000,0,1,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0) );
new TestCase( SECTION, "Date(2000,0,1,0,0,1)", (new Date()).toString(), Date(2000,0,0,0,0,1) );
/*
// Dates around 1900
new TestCase( SECTION, "Date(1899,11,31,23,59,59)", (new Date()).toString(), Date(1899,11,31,23,59,59));
new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0) );
new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) );
new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0));
// Dates around feb 29, 2000
new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));
new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));
new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));
// Dates around jan 1, 2005
new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));
new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
// Dates around jan 1, 2032
new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
test();

Просмотреть файл

@ -64,24 +64,4 @@ new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(),
new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) );
new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0));
/*
// Dates around feb 29, 2000
new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));
new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));
new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));
// Dates around jan 1, 2005
new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));
new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
// Dates around jan 1, 2032
new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
test();

Просмотреть файл

@ -63,18 +63,4 @@ new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(),
new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));
new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));
/*
// Dates around jan 1, 2005
new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));
new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
// Dates around jan 1, 2032
new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
test();

Просмотреть файл

@ -62,12 +62,5 @@ new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(),
new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
/*
// Dates around jan 1, 2032
new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
test();

Просмотреть файл

@ -94,7 +94,6 @@ var SECONDS = 15;
var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_PST * msPerHour;
// Dates around 1970
@ -104,11 +103,11 @@ addNewTestCase( new Date( 1969,11,31,15,59,59,999),
addNewTestCase( new Date( 1969,11,31,23,59,59,999),
"new Date( 1969,11,31,23,59,59,999)",
[TIME_1970-TZ_ADJUST-1,1970,0,1,4,7,59,59,999,1969,11,31,3,23,59,59,999] );
[TIME_1970-PST_ADJUST-1,1970,0,1,4,7,59,59,999,1969,11,31,3,23,59,59,999] );
addNewTestCase( new Date( 1970,0,1,0,0,0,0),
"new Date( 1970,0,1,0,0,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
[TIME_1970-PST_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date( 1969,11,31,16,0,0,0),
"new Date( 1969,11,31,16,0,0,0)",
@ -116,27 +115,27 @@ addNewTestCase( new Date( 1969,11,31,16,0,0,0),
addNewTestCase( new Date(1969,12,1,0,0,0,0),
"new Date(1969,12,1,0,0,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
[TIME_1970-PST_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date(1969,11,32,0,0,0,0),
"new Date(1969,11,32,0,0,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
[TIME_1970-PST_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date(1969,11,31,24,0,0,0),
"new Date(1969,11,31,24,0,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
[TIME_1970-PST_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date(1969,11,31,23,60,0,0),
"new Date(1969,11,31,23,60,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
[TIME_1970-PST_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date(1969,11,31,23,59,60,0),
"new Date(1969,11,31,23,59,60,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
[TIME_1970-PST_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
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] );
[TIME_1970-PST_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
// Dates around 2000
@ -150,31 +149,29 @@ addNewTestCase( new Date( 1999,11,31,16,0,0,0),
addNewTestCase( new Date( 1999,11,31,23,59,59,999),
"new Date( 1999,11,31,23,59,59,999)",
[TIME_2000-TZ_ADJUST-1,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] );
[TIME_2000-PST_ADJUST-1,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] );
addNewTestCase( new Date( 2000,0,1,0,0,0,0),
"new Date( 2000,0,1,0,0,0,0)",
[TIME_2000-TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
[TIME_2000-PST_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date( 2000,0,1,0,0,0,1),
"new Date( 2000,0,1,0,0,0,1)",
[TIME_2000-TZ_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] );
[TIME_2000-PST_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] );
// Dates around 29 Feb 2000
var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay );
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
[UTC_FEB_29_2000-PST_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,28,24,0,0,0),
"new Date(2000,1,28,24,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
[UTC_FEB_29_2000-PST_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
@ -188,55 +185,25 @@ addNewTestCase( new Date(1899,11,31,15,59,59,999),
addNewTestCase( new Date(1899,11,31,23,59,59,999),
"new Date(1899,11,31,23,59,59,999)",
[TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
[TIME_1900-PST_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
addNewTestCase( new Date(1900,0,1,0,0,0,0),
"new Date(1900,0,1,0,0,0,0)",
[TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
[TIME_1900-PST_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,0,1),
"new Date(1900,0,1,0,0,0,1)",
[TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
[TIME_1900-PST_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
[UTC_JAN_1_2005-PST_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
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.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
[UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
test();

Просмотреть файл

@ -98,7 +98,6 @@ writeHeaderToLog( SECTION + " "+ TITLE);
// all the "ResultArrays" below are hard-coded to Pacific Standard Time values -
var TZ_ADJUST = TZ_PST * msPerHour;
// Dates around 2000
@ -112,93 +111,15 @@ addNewTestCase( new Date( 1999,11,31,16,0,0,0),
addNewTestCase( new Date( 1999,11,31,23,59,59,999),
"new Date( 1999,11,31,23,59,59,999)",
[TIME_2000-TZ_ADJUST-1,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] );
[TIME_2000-PST_ADJUST-1,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] );
addNewTestCase( new Date( 2000,0,1,0,0,0,0),
"new Date( 2000,0,1,0,0,0,0)",
[TIME_2000-TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
[TIME_2000-PST_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date( 2000,0,1,0,0,0,1),
"new Date( 2000,0,1,0,0,0,1)",
[TIME_2000-TZ_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] );
/*
// Dates around 29 Feb 2000
var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay );
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,28,24,0,0,0),
"new Date(2000,1,28,24,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0,0),
"new Date(1899,11,31,16,0,0,0)",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59,999),
"new Date(1899,11,31,15,59,59,999)",
[TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] );
addNewTestCase( new Date(1899,11,31,23,59,59,999),
"new Date(1899,11,31,23,59,59,999)",
[TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
addNewTestCase( new Date(1900,0,1,0,0,0,0),
"new Date(1900,0,1,0,0,0,0)",
[TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,0,1),
"new Date(1900,0,1,0,0,0,1)",
[TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
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.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
[TIME_2000-PST_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] );
test();

Просмотреть файл

@ -97,85 +97,17 @@ var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
// all the "ResultArrays" below are hard-coded to Pacific Standard Time values -
var TZ_ADJUST = TZ_PST * msPerHour;
// Dates around 29 Feb 2000
var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay );
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
[UTC_FEB_29_2000 - PST_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,28,24,0,0,0),
"new Date(2000,1,28,24,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
/*
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0,0),
"new Date(1899,11,31,16,0,0,0)",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59,999),
"new Date(1899,11,31,15,59,59,999)",
[TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] );
addNewTestCase( new Date(1899,11,31,23,59,59,999),
"new Date(1899,11,31,23,59,59,999)",
[TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
addNewTestCase( new Date(1900,0,1,0,0,0,0),
"new Date(1900,0,1,0,0,0,0)",
[TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,0,1),
"new Date(1900,0,1,0,0,0,1)",
[TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
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.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
[UTC_FEB_29_2000 - PST_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
test();

Просмотреть файл

@ -97,7 +97,6 @@ var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
// all the "ResultArrays" below are hard-coded to Pacific Standard Time values -
var TZ_ADJUST = TZ_PST * msPerHour;
// Dates around 1900
@ -111,55 +110,15 @@ addNewTestCase( new Date(1899,11,31,15,59,59,999),
addNewTestCase( new Date(1899,11,31,23,59,59,999),
"new Date(1899,11,31,23,59,59,999)",
[TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
[TIME_1900-PST_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
addNewTestCase( new Date(1900,0,1,0,0,0,0),
"new Date(1900,0,1,0,0,0,0)",
[TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
[TIME_1900-PST_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,0,1),
"new Date(1900,0,1,0,0,0,1)",
[TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
/*
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
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.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
[TIME_1900-PST_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
test();

Просмотреть файл

@ -97,46 +97,16 @@ var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
// all the "ResultArrays" below are hard-coded to Pacific Standard Time values -
var TZ_ADJUST = TZ_PST * msPerHour;
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
[UTC_JAN_1_2005-PST_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
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.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
[UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
test();

Просмотреть файл

@ -116,95 +116,6 @@ addNewTestCase( new Date( 1970, 0, 1, 0, 0, 0),
addNewTestCase( new Date( 1969,11,31,16,0,0),
"new Date( 1969,11,31,16,0,0)",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
/*
// Dates around 2000
addNewTestCase( new Date( 1999,11,31,15,59,59),
"new Date( 1999,11,31,15,59,59)",
[946684799000,1999,11,31,5,23,59,59,0,1999,11,31,5,15,59,59,0] );
addNewTestCase( new Date( 1999,11,31,16,0,0),
"new Date( 1999,11,31,16,0,0)",
[946684800000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] );
addNewTestCase( new Date( 2000,0,1,0,0,0),
"new Date( 2000,0,1,0,0,0)",
[946713600000,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0),
"new Date(1899,11,31,16,0,0)",
[-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59),
"new Date(1899,11,31,15,59,59)",
[-2208988801000,1899,11,31,0,23,59,59,0,1899,11,31,0,15,59,59,0] );
addNewTestCase( new Date(1900,0,1,0,0,0),
"new Date(1900,0,1,0,0,0)",
[-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,1),
"new Date(1900,0,1,0,0,1)",
[-2208959999000,1900,0,1,1,8,0,1,0,1900,0,1,1,0,0,1,0] );
var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
// Dates around Feb 29, 2000
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,24,0,0,0),
"new Date(2000,1,29,24,0,0,0)",
[PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] );
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_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.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();

Просмотреть файл

@ -108,81 +108,6 @@ addNewTestCase( new Date( 1999,11,31,16,0,0),
addNewTestCase( new Date( 2000,0,1,0,0,0),
"new Date( 2000,0,1,0,0,0)",
[946713600000,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
/*
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0),
"new Date(1899,11,31,16,0,0)",
[-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59),
"new Date(1899,11,31,15,59,59)",
[-2208988801000,1899,11,31,0,23,59,59,0,1899,11,31,0,15,59,59,0] );
addNewTestCase( new Date(1900,0,1,0,0,0),
"new Date(1900,0,1,0,0,0)",
[-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,1),
"new Date(1900,0,1,0,0,1)",
[-2208959999000,1900,0,1,1,8,0,1,0,1900,0,1,1,0,0,1,0] );
var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
// Dates around Feb 29, 2000
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,24,0,0,0),
"new Date(2000,1,29,24,0,0,0)",
[PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] );
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_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.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();

Просмотреть файл

@ -112,63 +112,6 @@ addNewTestCase( new Date(1900,0,1,0,0,0),
addNewTestCase( new Date(1900,0,1,0,0,1),
"new Date(1900,0,1,0,0,1)",
[-2208959999000,1900,0,1,1,8,0,1,0,1900,0,1,1,0,0,1,0] );
/*
var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
// Dates around Feb 29, 2000
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,24,0,0,0),
"new Date(2000,1,29,24,0,0,0)",
[PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] );
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_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.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();

Просмотреть файл

@ -95,7 +95,6 @@ var TITLE = "Date( year, month, date, hours, minutes, seconds )";
writeHeaderToLog( SECTION+" " +TITLE );
var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
// Dates around Feb 29, 2000
@ -110,47 +109,6 @@ addNewTestCase( new Date(2000,1,29,0,0,0,0),
addNewTestCase( new Date(2000,1,29,24,0,0,0),
"new Date(2000,1,29,24,0,0,0)",
[PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] );
/*
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_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.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();

Просмотреть файл

@ -97,8 +97,6 @@ writeHeaderToLog( SECTION+" " +TITLE );
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
@ -108,32 +106,6 @@ addNewTestCase( new Date(2005,0,1,0,0,0,0),
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_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.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();

Просмотреть файл

@ -123,148 +123,6 @@ addNewTestCase( new Date(false),
addNewTestCase( new Date( (new Date(0)).toString() ),
"new Date(\""+ (new Date(0)).toString()+"\" )",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
/*
// addNewTestCase( "new Date(\""+ (new Date(0)).toLocaleString()+"\")", [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date((new Date(0)).toUTCString()),
"new Date(\""+ (new Date(0)).toUTCString()+"\" )",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date((new Date(1)).toString()),
"new Date(\""+ (new Date(1)).toString()+"\" )",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date( TZ_ADJUST ),
"new Date(" + TZ_ADJUST+")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date((new Date(TZ_ADJUST)).toString()),
"new Date(\""+ (new Date(TZ_ADJUST)).toString()+"\")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
// addNewTestCase( "new Date(\""+ (new Date(TZ_ADJUST)).toLocaleString()+"\")",[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date( (new Date(TZ_ADJUST)).toUTCString() ),
"new Date(\""+ (new Date(TZ_ADJUST)).toUTCString()+"\")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
// Dates around 2000
addNewTestCase( new Date(TIME_2000+TZ_ADJUST),
"new Date(" +(TIME_2000+TZ_ADJUST)+")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date(TIME_2000),
"new Date(" +TIME_2000+")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date((new Date(TIME_2000)).toString()),
"new Date(\"" +(new Date(TIME_2000)).toString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
// addNewTestCase( "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toLocaleString()+"\")", [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
// addNewTestCase( "new Date(\"" +(new Date(TIME_2000)).toLocaleString()+"\")", [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toUTCString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000)).toUTCString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST;
addNewTestCase( new Date(UTC_FEB_29_2000),
"new Date("+UTC_FEB_29_2000+")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(PST_FEB_29_2000),
"new Date("+PST_FEB_29_2000+")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Parsing toLocaleString() is not guaranteed by ECMA.
// addNewTestCase( "new Date(\""+(new Date(UTC_FEB_29_2000)).toLocaleString()+"\")", [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_FEB_29_2000)).toLocaleString()+"\")", [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
var PST_1900 = TIME_1900 + 8*msPerHour;
addNewTestCase( new Date( TIME_1900 ),
"new Date("+TIME_1900+")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(PST_1900),
"new Date("+PST_1900+")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
"new Date(\""+(new Date(TIME_1900)).toString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
"new Date(\""+(new Date(PST_1900 )).toString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
"new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();

Просмотреть файл

@ -122,124 +122,6 @@ addNewTestCase( new Date((new Date(TZ_ADJUST)).toString()),
addNewTestCase( new Date( (new Date(TZ_ADJUST)).toUTCString() ),
"new Date(\""+ (new Date(TZ_ADJUST)).toUTCString()+"\")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
/*
// Dates around 2000
addNewTestCase( new Date(TIME_2000+TZ_ADJUST),
"new Date(" +(TIME_2000+TZ_ADJUST)+")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date(TIME_2000),
"new Date(" +TIME_2000+")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date((new Date(TIME_2000)).toString()),
"new Date(\"" +(new Date(TIME_2000)).toString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
// addNewTestCase( "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toLocaleString()+"\")", [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
// addNewTestCase( "new Date(\"" +(new Date(TIME_2000)).toLocaleString()+"\")", [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toUTCString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000)).toUTCString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST;
addNewTestCase( new Date(UTC_FEB_29_2000),
"new Date("+UTC_FEB_29_2000+")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(PST_FEB_29_2000),
"new Date("+PST_FEB_29_2000+")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Parsing toLocaleString() is not guaranteed by ECMA.
// addNewTestCase( "new Date(\""+(new Date(UTC_FEB_29_2000)).toLocaleString()+"\")", [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_FEB_29_2000)).toLocaleString()+"\")", [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
var PST_1900 = TIME_1900 + 8*msPerHour;
addNewTestCase( new Date( TIME_1900 ),
"new Date("+TIME_1900+")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(PST_1900),
"new Date("+PST_1900+")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
"new Date(\""+(new Date(TIME_1900)).toString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
"new Date(\""+(new Date(PST_1900 )).toString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
"new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();

Просмотреть файл

@ -130,95 +130,6 @@ addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toUTCString()),
addNewTestCase( new Date( (new Date(TIME_2000)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000)).toUTCString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
/*
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST;
addNewTestCase( new Date(UTC_FEB_29_2000),
"new Date("+UTC_FEB_29_2000+")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(PST_FEB_29_2000),
"new Date("+PST_FEB_29_2000+")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Parsing toLocaleString() is not guaranteed by ECMA.
// addNewTestCase( "new Date(\""+(new Date(UTC_FEB_29_2000)).toLocaleString()+"\")", [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_FEB_29_2000)).toLocaleString()+"\")", [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
var PST_1900 = TIME_1900 + 8*msPerHour;
addNewTestCase( new Date( TIME_1900 ),
"new Date("+TIME_1900+")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(PST_1900),
"new Date("+PST_1900+")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
"new Date(\""+(new Date(TIME_1900)).toString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
"new Date(\""+(new Date(PST_1900 )).toString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
"new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();

Просмотреть файл

@ -105,7 +105,6 @@ var TZ_ADJUST = -TZ_PST * msPerHour;
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST;
addNewTestCase( new Date(UTC_FEB_29_2000),
@ -132,62 +131,6 @@ addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ),
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
/*
// Dates around 1900
var PST_1900 = TIME_1900 + 8*msPerHour;
addNewTestCase( new Date( TIME_1900 ),
"new Date("+TIME_1900+")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(PST_1900),
"new Date("+PST_1900+")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
"new Date(\""+(new Date(TIME_1900)).toString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
"new Date(\""+(new Date(PST_1900 )).toString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
"new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();

Просмотреть файл

@ -132,31 +132,6 @@ addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
test();
function addNewTestCase( DateCase, DateString, ResultArray ) {

Просмотреть файл

@ -156,8 +156,8 @@ addNewTestCase( new Date(-2208959999999),
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
addNewTestCase( new Date(UTC_FEB_29_2000),
"new Date(" + UTC_FEB_29_2000 +")",
[UTC_FEB_29_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
@ -167,8 +167,6 @@ addNewTestCase( new Date(PST_FEB_29_2000),
// Dates around Jan 1 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(UTC_JAN_1_2005),
@ -184,26 +182,8 @@ test();
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
new TestCase( SECTION, "Date.parse(" + DateCase.toString() +")", Math.floor(ResultArray[TIME]/1000)*1000, Date.parse(DateCase.toString()) );
new TestCase( SECTION, "Date.parse(" + DateCase.toGMTString() +")", Math.floor(ResultArray[TIME]/1000)*1000, Date.parse(DateCase.toGMTString()) );
/*
new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() z inutes() );
new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
// new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
// new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
*/
}

Просмотреть файл

@ -36,8 +36,6 @@
*
* ***** END LICENSE BLOCK ***** */
var testcases = new Array();
var SECTION = "15.9.4.3";
var TITLE = "Date.UTC( year, month, date, hours, minutes, seconds, ms )";
@ -121,31 +119,8 @@ test();
function addNewTestCase( DateCase, DateString, ExpectDate) {
DateCase = DateCase;
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString, ExpectDate.value, DateCase );
new TestCase( SECTION, DateString, ExpectDate.value, DateCase );
/*
new TestCase( SECTION, DateString+".getUTCFullYear()", ExpectDate.year, DateCase.getUTCFullYear() );
new TestCase( SECTION, DateString+".getUTCMonth()", ExpectDate.month, DateCase.getUTCMonth() );
new TestCase( SECTION, DateString+".getUTCDate()", ExpectDate.date, DateCase.getUTCDate() );
new TestCase( SECTION, DateString+".getUTCDay()", ExpectDate.day, DateCase.getUTCDay() );
new TestCase( SECTION, DateString+".getUTCHours()", ExpectDate.hours, DateCase.getUTCHours() );
new TestCase( SECTION, DateString+".getUTCMinutes()", ExpectDate.minutes,DateCase.getUTCMinutes() );
new TestCase( SECTION, DateString+".getUTCSeconds()", ExpectDate.seconds,DateCase.getUTCSeconds() );
new TestCase( SECTION, DateString+".getUTCMilliseconds()", ExpectDate.ms, DateCase.getUTCMilliseconds() );
new TestCase( SECTION, DateString+".getFullYear()", ExpectDate.year, DateCase.getFullYear() );
new TestCase( SECTION, DateString+".getMonth()", ExpectDate.month, DateCase.getMonth() );
new TestCase( SECTION, DateString+".getDate()", ExpectDate.date, DateCase.getDate() );
// new TestCase( SECTION, DateString+".getDay()", ExpectDate.day, DateCase.getDay() );
new TestCase( SECTION, DateString+".getHours()", ExpectDate.hours, DateCase.getHours() );
new TestCase( SECTION, DateString+".getMinutes()", ExpectDate.minutes, DateCase.getMinutes() );
new TestCase( SECTION, DateString+".getSeconds()", ExpectDate.seconds, DateCase.getSeconds() );
new TestCase( SECTION, DateString+".getMilliseconds()", ExpectDate.ms, DateCase.getMilliseconds() );
*/
}
function MyDate() {

Просмотреть файл

@ -56,45 +56,7 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( now );
/*
addTestCase( time );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
addTestCase( TIME_NOW );
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
@ -108,11 +70,14 @@ new TestCase( SECTION,
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,36 +56,11 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
var DST_START_1998 = GetDSTStart(TimeFromYear(1998));
addTestCase( DST_START_1998+1 );
/*
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
@ -99,11 +74,14 @@ new TestCase( SECTION,
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,35 +56,11 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
var DST_END_1998 = GetDSTEnd(TimeFromYear(1998));
addTestCase( DST_END_1998 );
/*
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
@ -98,11 +74,14 @@ new TestCase( SECTION,
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,34 +56,11 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
var DST_END_1998 = GetDSTEnd(TimeFromYear(1998));
addTestCase( DST_END_1998-1 );
/*
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
@ -97,11 +74,14 @@ new TestCase( SECTION,
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,29 +56,9 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
var DST_END_1998 = GetDSTEnd(TimeFromYear(1998));
addTestCase( DST_END_1998+1 );
@ -94,11 +74,14 @@ new TestCase( SECTION,
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,62 +56,28 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour );
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( time );
/*
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
addTestCase( TIME_0000 );
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,43 +56,7 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( TIME_1970 );
/*
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
@ -106,11 +70,14 @@ new TestCase( SECTION,
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,59 +56,28 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour );
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( TIME_1900 );
/*
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -55,61 +55,29 @@ startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour );
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( TIME_2000 );
/*
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,58 +56,28 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour );
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( UTC_FEB_29_2000 );
/*
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,57 +56,28 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( UTC_JAN_1_2005 );
/*
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,56 +56,32 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour );
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
var DST_START_1998 = GetDSTStart(TimeFromYear(1998));
addTestCase( DST_START_1998 );
/*
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,37 +56,11 @@ var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour );
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
var DST_START_1998 = GetDSTStart(TimeFromYear(1998));
addTestCase( DST_START_1998-1 );
/*
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
@ -100,11 +74,14 @@ new TestCase( SECTION,
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}

Просмотреть файл

@ -56,46 +56,19 @@ var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
addTestCase( now );
addTestCase( TIME_NOW );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDate()",
DateFromTime(d),
(new Date(d)).getUTCDate() );
}
}

Просмотреть файл

@ -56,48 +56,19 @@ var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
addTestCase( time );
addTestCase( TIME_0000 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDate()",
DateFromTime(d),
(new Date(d)).getUTCDate() );
}
}

Просмотреть файл

@ -56,43 +56,19 @@ var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_1970 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDate()",
DateFromTime(d),
(new Date(d)).getUTCDate() );
}
}

Просмотреть файл

@ -56,43 +56,19 @@ var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_1900 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( var d = 0; d < TimeInMonth( m ); d += 7* msPerDay ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDate()",
DateFromTime(d),
(new Date(d)).getUTCDate() );
}
}

Просмотреть файл

@ -56,43 +56,19 @@ var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_2000 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDate()",
DateFromTime(d),
(new Date(d)).getUTCDate() );
}
}

Просмотреть файл

@ -56,45 +56,19 @@ var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay );
addTestCase( UTC_FEB_29_2000 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDate()",
DateFromTime(d),
(new Date(d)).getUTCDate() );
}
}

Просмотреть файл

@ -56,46 +56,19 @@ var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( UTC_JAN_1_2005 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDate()",
DateFromTime(d),
(new Date(d)).getUTCDate() );
}
}

Просмотреть файл

@ -57,56 +57,19 @@ var TITLE = "Date.prototype.getDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_NOW );
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( now );
/*
addTestCase( time );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getDay()",
NaN,
(new Date(NaN)).getDay() );
new TestCase( SECTION,
"Date.prototype.getDay.length",
0,
Date.prototype.getDay.length );
*/
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getDay()",
WeekDay(LocalTime(t)),
(new Date(t)).getDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDay()",
WeekDay((LocalTime(d))),
(new Date(d)).getDay() );
}
}

Просмотреть файл

@ -57,55 +57,19 @@ var TITLE = "Date.prototype.getDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_0000 );
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( time );
/*
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getDay()",
NaN,
(new Date(NaN)).getDay() );
new TestCase( SECTION,
"Date.prototype.getDay.length",
0,
Date.prototype.getDay.length );
*/
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDay()",
WeekDay(LocalTime(t)),
(new Date(t)).getDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDay()",
WeekDay((LocalTime(d))),
(new Date(d)).getDay() );
}
}

Просмотреть файл

@ -57,54 +57,19 @@ var TITLE = "Date.prototype.getDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_1970 );
/*
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getDay()",
NaN,
(new Date(NaN)).getDay() );
new TestCase( SECTION,
"Date.prototype.getDay.length",
0,
Date.prototype.getDay.length );
*/
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getDay()",
WeekDay(LocalTime(t)),
(new Date(t)).getDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDay()",
WeekDay((LocalTime(d))),
(new Date(d)).getDay() );
}
}

Просмотреть файл

@ -57,53 +57,19 @@ var TITLE = "Date.prototype.getDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_1900 );
/*
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getDay()",
NaN,
(new Date(NaN)).getDay() );
new TestCase( SECTION,
"Date.prototype.getDay.length",
0,
Date.prototype.getDay.length );
*/
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getDay()",
WeekDay(LocalTime(t)),
(new Date(t)).getDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDay()",
WeekDay((LocalTime(d))),
(new Date(d)).getDay() );
}
}

Просмотреть файл

@ -57,52 +57,19 @@ var TITLE = "Date.prototype.getDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_2000 );
/*
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getDay()",
NaN,
(new Date(NaN)).getDay() );
new TestCase( SECTION,
"Date.prototype.getDay.length",
0,
Date.prototype.getDay.length );
*/
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getDay()",
WeekDay(LocalTime(t)),
(new Date(t)).getDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDay()",
WeekDay((LocalTime(d))),
(new Date(d)).getDay() );
}
}

Просмотреть файл

@ -57,51 +57,19 @@ var TITLE = "Date.prototype.getDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( UTC_FEB_29_2000 );
/*
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getDay()",
NaN,
(new Date(NaN)).getDay() );
new TestCase( SECTION,
"Date.prototype.getDay.length",
0,
Date.prototype.getDay.length );
*/
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getDay()",
WeekDay(LocalTime(t)),
(new Date(t)).getDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDay()",
WeekDay((LocalTime(d))),
(new Date(d)).getDay() );
}
}

Просмотреть файл

@ -57,49 +57,19 @@ var TITLE = "Date.prototype.getDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( UTC_JAN_1_2005 );
/*
new TestCase( SECTION,
"(new Date(NaN)).getDay()",
NaN,
(new Date(NaN)).getDay() );
new TestCase( SECTION,
"Date.prototype.getDay.length",
0,
Date.prototype.getDay.length );
*/
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getDay()",
WeekDay(LocalTime(t)),
(new Date(t)).getDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDay()",
WeekDay((LocalTime(d))),
(new Date(d)).getDay() );
}
}

Просмотреть файл

@ -57,24 +57,6 @@ var TITLE = "Date.prototype.getDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
new TestCase( SECTION,
"(new Date(NaN)).getDay()",
NaN,
@ -85,18 +67,3 @@ new TestCase( SECTION,
0,
Date.prototype.getDay.length );
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*6 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getDay()",
WeekDay(LocalTime(t)),
(new Date(t)).getDay() );
}
}
}

Просмотреть файл

@ -56,8 +56,6 @@ var TITLE = "Date.prototype.getUTCDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
@ -66,16 +64,14 @@ addTestCase( now );
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDay()",
WeekDay((t)),
(new Date(t)).getUTCDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDay()",
WeekDay((d)),
(new Date(d)).getUTCDay() );
}
}

Просмотреть файл

@ -56,27 +56,19 @@ var TITLE = "Date.prototype.getUTCDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_0000 );
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
addTestCase( time );
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDay()",
WeekDay((t)),
(new Date(t)).getUTCDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDay()",
WeekDay((d)),
(new Date(d)).getUTCDay() );
}
}

Просмотреть файл

@ -56,23 +56,20 @@ var TITLE = "Date.prototype.getUTCDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_1970 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDay()",
WeekDay((t)),
(new Date(t)).getUTCDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDay()",
WeekDay((d)),
(new Date(d)).getUTCDay() );
}
}

Просмотреть файл

@ -56,23 +56,20 @@ var TITLE = "Date.prototype.getUTCDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_1900 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDay()",
WeekDay((t)),
(new Date(t)).getUTCDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDay()",
WeekDay((d)),
(new Date(d)).getUTCDay() );
}
}

Просмотреть файл

@ -56,23 +56,20 @@ var TITLE = "Date.prototype.getUTCDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_2000 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*14 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDay()",
WeekDay((t)),
(new Date(t)).getUTCDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDay()",
WeekDay((d)),
(new Date(d)).getUTCDay() );
}
}

Просмотреть файл

@ -56,26 +56,20 @@ var TITLE = "Date.prototype.getUTCDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
addTestCase( UTC_FEB_29_2000 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*7 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDay()",
WeekDay((t)),
(new Date(t)).getUTCDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDay()",
WeekDay((d)),
(new Date(d)).getUTCDay() );
}
}

Просмотреть файл

@ -56,28 +56,19 @@ var TITLE = "Date.prototype.getUTCDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( UTC_JAN_1_2005 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*7 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDay()",
WeekDay((t)),
(new Date(t)).getUTCDay() );
}
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getUTCDay()",
WeekDay((d)),
(new Date(d)).getUTCDay() );
}
}

Просмотреть файл

@ -56,47 +56,14 @@ var TITLE = "Date.prototype.getUTCDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
new TestCase( SECTION,
"(new Date(NaN)).getUTCDay()",
NaN,
(new Date(NaN)).getUTCDay() );
new TestCase( SECTION,
"(new Date(NaN)).getUTCDay()",
NaN,
(new Date(NaN)).getUTCDay() );
new TestCase( SECTION,
"Date.prototype.getUTCDay.length",
0,
Date.prototype.getUTCDay.length );
"Date.prototype.getUTCDay.length",
0,
Date.prototype.getUTCDay.length );
test();
function addTestCase( t ) {
for ( var m = 0; m < 12; m++ ) {
t += TimeInMonth(m);
for ( d = 0; d < TimeInMonth(m); d+= msPerDay*7 ) {
t += d;
new TestCase( SECTION,
"(new Date("+t+")).getUTCDay()",
WeekDay((t)),
(new Date(t)).getUTCDay() );
}
}
}

Просмотреть файл

@ -55,26 +55,8 @@ var TITLE = "Date.prototype.getHours()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( now );
addTestCase( time );
addTestCase( TIME_NOW );
addTestCase( TIME_0000 );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );

Просмотреть файл

@ -56,26 +56,8 @@ var TITLE = "Date.prototype.getUTCHours()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( now );
addTestCase( time );
addTestCase( TIME_NOW );
addTestCase( TIME_0000 );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );

Просмотреть файл

@ -55,26 +55,8 @@ var TITLE = "Date.prototype.getMinutes()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( now );
addTestCase( time );
addTestCase( TIME_NOW );
addTestCase( TIME_0000 );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );

Просмотреть файл

@ -56,26 +56,8 @@ var TITLE = "Date.prototype.getUTCMinutes()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( now );
addTestCase( time );
addTestCase( TIME_NOW );
addTestCase( TIME_0000 );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );

Просмотреть файл

@ -56,26 +56,8 @@ var TITLE = "Date.prototype.getSeconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( now );
addTestCase( time );
addTestCase( TIME_NOW );
addTestCase( TIME_0000 );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );

Просмотреть файл

@ -56,26 +56,8 @@ var TITLE = "Date.prototype.getUTCSeconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( now );
addTestCase( time );
addTestCase( TIME_NOW );
addTestCase( TIME_0000 );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );

Просмотреть файл

@ -80,8 +80,6 @@ new TestCase( SECTION,
typeof now.toString() );
// 1970
TZ_ADJUST = TZ_DIFF * msPerHour;
new TestCase( SECTION,
"Date.parse( (new Date(0)).toString() )",
0,
@ -116,39 +114,36 @@ new TestCase( SECTION,
// 29 Feb 2000
var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
new TestCase( SECTION,
"Date.parse( (new Date("+UTC_29_FEB_2000+")).toString() )",
UTC_29_FEB_2000,
Date.parse( (new Date(UTC_29_FEB_2000)).toString() ) );
"Date.parse( (new Date("+UTC_FEB_29_2000+")).toString() )",
UTC_FEB_29_2000,
Date.parse( (new Date(UTC_FEB_29_2000)).toString() ) );
new TestCase( SECTION,
"Date.parse( (new Date("+(UTC_29_FEB_2000-1000)+")).toString() )",
UTC_29_FEB_2000-1000,
Date.parse( (new Date(UTC_29_FEB_2000-1000)).toString() ) );
"Date.parse( (new Date("+(UTC_FEB_29_2000-1000)+")).toString() )",
UTC_FEB_29_2000-1000,
Date.parse( (new Date(UTC_FEB_29_2000-1000)).toString() ) );
new TestCase( SECTION,
"Date.parse( (new Date("+(UTC_29_FEB_2000-TZ_ADJUST)+")).toString() )",
UTC_29_FEB_2000-TZ_ADJUST,
Date.parse( (new Date(UTC_29_FEB_2000-TZ_ADJUST)).toString() ) );
"Date.parse( (new Date("+(UTC_FEB_29_2000-TZ_ADJUST)+")).toString() )",
UTC_FEB_29_2000-TZ_ADJUST,
Date.parse( (new Date(UTC_FEB_29_2000-TZ_ADJUST)).toString() ) );
// 2O05
var UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
new TestCase( SECTION,
"Date.parse( (new Date("+UTC_1_JAN_2005+")).toString() )",
UTC_1_JAN_2005,
Date.parse( (new Date(UTC_1_JAN_2005)).toString() ) );
"Date.parse( (new Date("+UTC_JAN_1_2005+")).toString() )",
UTC_JAN_1_2005,
Date.parse( (new Date(UTC_JAN_1_2005)).toString() ) );
new TestCase( SECTION,
"Date.parse( (new Date("+(UTC_1_JAN_2005-1000)+")).toString() )",
UTC_1_JAN_2005-1000,
Date.parse( (new Date(UTC_1_JAN_2005-1000)).toString() ) );
"Date.parse( (new Date("+(UTC_JAN_1_2005-1000)+")).toString() )",
UTC_JAN_1_2005-1000,
Date.parse( (new Date(UTC_JAN_1_2005-1000)).toString() ) );
new TestCase( SECTION,
"Date.parse( (new Date("+(UTC_1_JAN_2005-TZ_ADJUST)+")).toString() )",
UTC_1_JAN_2005-TZ_ADJUST,
Date.parse( (new Date(UTC_1_JAN_2005-TZ_ADJUST)).toString() ) );
"Date.parse( (new Date("+(UTC_JAN_1_2005-TZ_ADJUST)+")).toString() )",
UTC_JAN_1_2005-TZ_ADJUST,
Date.parse( (new Date(UTC_JAN_1_2005-TZ_ADJUST)).toString() ) );
test();

Просмотреть файл

@ -80,8 +80,6 @@ new TestCase( SECTION,
typeof now.toString() );
// 1970
TZ_ADJUST = TZ_DIFF * msPerHour;
new TestCase( SECTION,
"Date.parse( (new Date(0)).toString() )",
0,
@ -116,39 +114,36 @@ new TestCase( SECTION,
// 29 Feb 2000
var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
new TestCase( SECTION,
"Date.parse( (new Date("+UTC_29_FEB_2000+")).toString() )",
UTC_29_FEB_2000,
Date.parse( (new Date(UTC_29_FEB_2000)).toString() ) );
"Date.parse( (new Date("+UTC_FEB_29_2000+")).toString() )",
UTC_FEB_29_2000,
Date.parse( (new Date(UTC_FEB_29_2000)).toString() ) );
new TestCase( SECTION,
"Date.parse( (new Date("+(UTC_29_FEB_2000-1000)+")).toString() )",
UTC_29_FEB_2000-1000,
Date.parse( (new Date(UTC_29_FEB_2000-1000)).toString() ) );
"Date.parse( (new Date("+(UTC_FEB_29_2000-1000)+")).toString() )",
UTC_FEB_29_2000-1000,
Date.parse( (new Date(UTC_FEB_29_2000-1000)).toString() ) );
new TestCase( SECTION,
"Date.parse( (new Date("+(UTC_29_FEB_2000-TZ_ADJUST)+")).toString() )",
UTC_29_FEB_2000-TZ_ADJUST,
Date.parse( (new Date(UTC_29_FEB_2000-TZ_ADJUST)).toString() ) );
"Date.parse( (new Date("+(UTC_FEB_29_2000-TZ_ADJUST)+")).toString() )",
UTC_FEB_29_2000-TZ_ADJUST,
Date.parse( (new Date(UTC_FEB_29_2000-TZ_ADJUST)).toString() ) );
// 2O05
var UTC_1_JAN_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
new TestCase( SECTION,
"Date.parse( (new Date("+UTC_1_JAN_2005+")).toString() )",
UTC_1_JAN_2005,
Date.parse( (new Date(UTC_1_JAN_2005)).toString() ) );
"Date.parse( (new Date("+UTC_JAN_1_2005+")).toString() )",
UTC_JAN_1_2005,
Date.parse( (new Date(UTC_JAN_1_2005)).toString() ) );
new TestCase( SECTION,
"Date.parse( (new Date("+(UTC_1_JAN_2005-1000)+")).toString() )",
UTC_1_JAN_2005-1000,
Date.parse( (new Date(UTC_1_JAN_2005-1000)).toString() ) );
"Date.parse( (new Date("+(UTC_JAN_1_2005-1000)+")).toString() )",
UTC_JAN_1_2005-1000,
Date.parse( (new Date(UTC_JAN_1_2005-1000)).toString() ) );
new TestCase( SECTION,
"Date.parse( (new Date("+(UTC_1_JAN_2005-TZ_ADJUST)+")).toString() )",
UTC_1_JAN_2005-TZ_ADJUST,
Date.parse( (new Date(UTC_1_JAN_2005-TZ_ADJUST)).toString() ) );
"Date.parse( (new Date("+(UTC_JAN_1_2005-TZ_ADJUST)+")).toString() )",
UTC_JAN_1_2005-TZ_ADJUST,
Date.parse( (new Date(UTC_JAN_1_2005-TZ_ADJUST)).toString() ) );
test();

Просмотреть файл

@ -56,26 +56,8 @@ var TITLE = "Date.prototype.getMilliseconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( now );
addTestCase( time );
addTestCase( TIME_NOW );
addTestCase( TIME_0000 );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );

Просмотреть файл

@ -56,45 +56,10 @@ var TITLE = "Date.prototype.getUTCMilliseconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_NOW );
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( now );
/*
addTestCase( time );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getUTCMilliseconds()",
NaN,
(new Date(NaN)).getUTCMilliseconds() );
new TestCase( SECTION,
"Date.prototype.getUTCMilliseconds.length",
0,
Date.prototype.getUTCMilliseconds.length );
*/
test();
function addTestCase( t ) {
new TestCase( SECTION,
"(new Date("+t+")).getUTCMilliseconds()",

Просмотреть файл

@ -56,42 +56,7 @@ var TITLE = "Date.prototype.getUTCMilliseconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( time );
/*
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getUTCMilliseconds()",
NaN,
(new Date(NaN)).getUTCMilliseconds() );
new TestCase( SECTION,
"Date.prototype.getUTCMilliseconds.length",
0,
Date.prototype.getUTCMilliseconds.length );
*/
addTestCase( TIME_0000 );
test();

Просмотреть файл

@ -56,24 +56,6 @@ var TITLE = "Date.prototype.getUTCMilliseconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_1970 );
test();

Просмотреть файл

@ -56,25 +56,8 @@ var TITLE = "Date.prototype.getUTCMilliseconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_1900 );
test();
function addTestCase( t ) {

Просмотреть файл

@ -56,24 +56,6 @@ var TITLE = "Date.prototype.getUTCMilliseconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_2000 );
test();

Просмотреть файл

@ -56,24 +56,6 @@ var TITLE = "Date.prototype.getUTCMilliseconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( UTC_FEB_29_2000 );
test();

Просмотреть файл

@ -56,25 +56,8 @@ var TITLE = "Date.prototype.getUTCMilliseconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( UTC_JAN_1_2005 );
test();
function addTestCase( t ) {

Просмотреть файл

@ -56,24 +56,6 @@ var TITLE = "Date.prototype.getUTCMilliseconds()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
new TestCase( SECTION,
"(new Date(NaN)).getUTCMilliseconds()",
NaN,
@ -85,9 +67,3 @@ new TestCase( SECTION,
Date.prototype.getUTCMilliseconds.length );
test();
function addTestCase( t ) {
new TestCase( SECTION,
"(new Date("+t+")).getUTCMilliseconds()",
msFromTime(t),
(new Date(t)).getUTCMilliseconds() );
}

Просмотреть файл

@ -57,27 +57,7 @@ var TITLE = "Date.prototype.getTimezoneOffset()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// addTestCase( now );
addTestCase( time );
addTestCase( TIME_0000 );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );

Просмотреть файл

@ -57,42 +57,8 @@ var TITLE = "Date.prototype.getTimezoneOffset()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_0000 );
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( time );
/*
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getTimezoneOffset()",
NaN,
(new Date(NaN)).getTimezoneOffset() );
new TestCase( SECTION,
"Date.prototype.getTimezoneOffset.length",
0,
Date.prototype.getTimezoneOffset.length );
*/
test();
function addTestCase( t ) {

Просмотреть файл

@ -57,41 +57,8 @@ var TITLE = "Date.prototype.getTimezoneOffset()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_1970 );
/*
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getTimezoneOffset()",
NaN,
(new Date(NaN)).getTimezoneOffset() );
new TestCase( SECTION,
"Date.prototype.getTimezoneOffset.length",
0,
Date.prototype.getTimezoneOffset.length );
*/
test();
function addTestCase( t ) {

Просмотреть файл

@ -57,40 +57,8 @@ var TITLE = "Date.prototype.getTimezoneOffset()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_1900 );
/*
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getTimezoneOffset()",
NaN,
(new Date(NaN)).getTimezoneOffset() );
new TestCase( SECTION,
"Date.prototype.getTimezoneOffset.length",
0,
Date.prototype.getTimezoneOffset.length );
*/
test();
function addTestCase( t ) {

Просмотреть файл

@ -57,39 +57,8 @@ var TITLE = "Date.prototype.getTimezoneOffset()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( TIME_2000 );
/*
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getTimezoneOffset()",
NaN,
(new Date(NaN)).getTimezoneOffset() );
new TestCase( SECTION,
"Date.prototype.getTimezoneOffset.length",
0,
Date.prototype.getTimezoneOffset.length );
*/
test();
function addTestCase( t ) {

Просмотреть файл

@ -57,38 +57,8 @@ var TITLE = "Date.prototype.getTimezoneOffset()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( UTC_FEB_29_2000 );
/*
addTestCase( UTC_JAN_1_2005 );
new TestCase( SECTION,
"(new Date(NaN)).getTimezoneOffset()",
NaN,
(new Date(NaN)).getTimezoneOffset() );
new TestCase( SECTION,
"Date.prototype.getTimezoneOffset.length",
0,
Date.prototype.getTimezoneOffset.length );
*/
test();
function addTestCase( t ) {

Просмотреть файл

@ -57,36 +57,8 @@ var TITLE = "Date.prototype.getTimezoneOffset()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( UTC_JAN_1_2005 );
/*
new TestCase( SECTION,
"(new Date(NaN)).getTimezoneOffset()",
NaN,
(new Date(NaN)).getTimezoneOffset() );
new TestCase( SECTION,
"Date.prototype.getTimezoneOffset.length",
0,
Date.prototype.getTimezoneOffset.length );
*/
test();
function addTestCase( t ) {

Просмотреть файл

@ -57,24 +57,6 @@ var TITLE = "Date.prototype.getTimezoneOffset()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
new TestCase( SECTION,
"(new Date(NaN)).getTimezoneOffset()",
NaN,
@ -86,12 +68,3 @@ new TestCase( SECTION,
Date.prototype.getTimezoneOffset.length );
test();
function addTestCase( t ) {
for ( m = 0; m <= 1000; m+=100 ) {
t++;
new TestCase( SECTION,
"(new Date("+t+")).getTimezoneOffset()",
(t - LocalTime(t)) / msPerMinute,
(new Date(t)).getTimezoneOffset() );
}
}

Просмотреть файл

@ -60,23 +60,6 @@ writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var now = "now";
addTestCase( 0, 0 );
/*
addTestCase( now, -2208988800000 );
addTestCase( now, -86400000 );
addTestCase( now, 946684800000 );
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, -2208988800000 );
addTestCase( now, 946684800000 );
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, 0 );
addTestCase( now, String( TIME_1900 ) );
addTestCase( now, String( TZ_DIFF* msPerHour ) );
addTestCase( now, String( TIME_2000 ) );
*/
test();
@ -92,8 +75,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -60,22 +60,6 @@ writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var now = "now";
addTestCase( now, -2208988800000 );
/*
addTestCase( now, -86400000 );
addTestCase( now, 946684800000 );
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, -2208988800000 );
addTestCase( now, 946684800000 );
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, 0 );
addTestCase( now, String( TIME_1900 ) );
addTestCase( now, String( TZ_DIFF* msPerHour ) );
addTestCase( now, String( TIME_2000 ) );
*/
test();
@ -91,8 +75,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -60,21 +60,6 @@ writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var now = "now";
addTestCase( now, -86400000 );
/*
addTestCase( now, 946684800000 );
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, -2208988800000 );
addTestCase( now, 946684800000 );
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, 0 );
addTestCase( now, String( TIME_1900 ) );
addTestCase( now, String( TZ_DIFF* msPerHour ) );
addTestCase( now, String( TIME_2000 ) );
*/
test();
@ -91,8 +76,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -60,19 +60,6 @@ writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var now = "now";
addTestCase( now, 946684800000 );
/*
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, -2208988800000 );
addTestCase( now, 946684800000 );
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, 0 );
addTestCase( now, String( TIME_1900 ) );
addTestCase( now, String( TZ_DIFF* msPerHour ) );
addTestCase( now, String( TIME_2000 ) );
*/
test();
@ -88,8 +75,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -60,16 +60,6 @@ writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var now = "now";
addTestCase( now, -2208988800000 );
/*
addTestCase( now, 946684800000 );
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, 0 );
addTestCase( now, String( TIME_1900 ) );
addTestCase( now, String( TZ_DIFF* msPerHour ) );
addTestCase( now, String( TIME_2000 ) );
*/
test();
@ -85,8 +75,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -60,14 +60,6 @@ writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var now = "now";
addTestCase( now, 946684800000 );
/*
// this daylight savings case fails -- need to fix date test functions
// addTestCase( now, -69609600000 );
addTestCase( now, 0 );
addTestCase( now, String( TIME_1900 ) );
addTestCase( now, String( TZ_DIFF* msPerHour ) );
addTestCase( now, String( TIME_2000 ) );
*/
test();
@ -83,8 +75,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -60,11 +60,6 @@ writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var now = "now";
addTestCase( now, 0 );
/*
addTestCase( now, String( TIME_1900 ) );
addTestCase( now, String( TZ_DIFF* msPerHour ) );
addTestCase( now, String( TIME_2000 ) );
*/
test();
@ -80,8 +75,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -60,10 +60,6 @@ writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var now = "now";
addTestCase( now, String( TIME_1900 ) );
/*
addTestCase( now, String( TZ_DIFF* msPerHour ) );
addTestCase( now, String( TIME_2000 ) );
*/
test();
@ -79,8 +75,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -60,9 +60,6 @@ writeHeaderToLog( SECTION + " Date.prototype.setTime(time)");
var now = "now";
addTestCase( now, String( TZ_DIFF* msPerHour ) );
/*
addTestCase( now, String( TIME_2000 ) );
*/
test();
@ -78,8 +75,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -75,9 +75,6 @@ function addTestCase( startTime, setTime ) {
var UTCDate = UTCDateFromTime ( Number(setTime) );
var LocalDate = LocalDateFromTime( Number(setTime) );
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() );
new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() );

Просмотреть файл

@ -57,19 +57,12 @@ var TITLE = "Date.prototype.setTime()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
test_times = new Array( now, TIME_1970, TIME_1900, TIME_2000 );
test_times = new Array( TIME_NOW, TIME_1970, TIME_1900, TIME_2000 );
for ( var j = 0; j < test_times.length; j++ ) {
addTestCase( new Date(now), test_times[j] );
addTestCase( new Date(TIME_NOW), test_times[j] );
}
new TestCase( SECTION,
"(new Date(NaN)).setTime()",
NaN,

Просмотреть файл

@ -58,30 +58,12 @@ var TITLE = "Date.prototype.setTime()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000,
test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000,
UTC_FEB_29_2000, UTC_JAN_1_2005 );
for ( var j = 0; j < test_times.length; j++ ) {
addTestCase( new Date(time), test_times[j] );
addTestCase( new Date(TIME_0000), test_times[j] );
}
new TestCase( SECTION,

Просмотреть файл

@ -58,25 +58,7 @@ var TITLE = "Date.prototype.setTime()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000,
test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000,
UTC_FEB_29_2000, UTC_JAN_1_2005 );

Просмотреть файл

@ -58,25 +58,7 @@ var TITLE = "Date.prototype.setTime()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000,
test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000,
UTC_FEB_29_2000, UTC_JAN_1_2005 );

Просмотреть файл

@ -58,25 +58,7 @@ var TITLE = "Date.prototype.setTime()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000,
test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000,
UTC_FEB_29_2000, UTC_JAN_1_2005 );

Просмотреть файл

@ -58,24 +58,7 @@ var TITLE = "Date.prototype.setTime()";
writeHeaderToLog( SECTION + " "+ TITLE);
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
test_times = new Array( now, time, TIME_1970, TIME_1900, TIME_2000,
test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000,
UTC_FEB_29_2000, UTC_JAN_1_2005 );

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше