var SECTION = "15.9.5.12";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDay()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
var now = (new Date()).valueOf();
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDay()",
NaN,
(new Date(NaN)).getDay() );
testcases[tc++] = 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);
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() );
}
}
}
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 );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}