var SECTION = "15.9.5.16";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getMinutes()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
var now = (new Date()).valueOf();
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
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);
addTestCase( now );
addTestCase( time );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getMinutes()",
NaN,
(new Date(NaN)).getMinutes() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getMinutes.length",
0,
Date.prototype.getMinutes.length );
test();
function addTestCase( t ) {
for ( m = 0; m <= 60; m+=10 ) {
t += msPerMinute;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getMinutes()",
MinFromTime((LocalTime(t))),
(new Date(t)).getMinutes() );
}
}
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 );
}