var SECTION = "15.9.3.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
getTestCases();
test();
function getTestCases( ) {
var TZ_ADJUST = TZ_PST * msPerHour;
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] );
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
adjustResultArray(ResultArray);
var item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}