| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
var completed = false; |
| 6 |
var testcases; |
| 7 |
var tc = 0; |
| 8 |
|
| 9 |
SECTION = ""; |
| 10 |
VERSION = ""; |
| 11 |
BUGNUMBER = ""; |
| 12 |
EXCLUDE = ""; |
| 13 |
BUGNUMBER = ""; |
| 14 |
|
| 15 |
|
| 16 |
TZ_DIFF = -8; |
| 17 |
|
| 18 |
var TT = ""; |
| 19 |
var TT_ = ""; |
| 20 |
var BR = ""; |
| 21 |
var NBSP = " "; |
| 22 |
var CR = "\n"; |
| 23 |
var FONT = ""; |
| 24 |
var FONT_ = ""; |
| 25 |
var FONT_RED = ""; |
| 26 |
var FONT_GREEN = ""; |
| 27 |
var B = ""; |
| 28 |
var B_ = "" |
| 29 |
var H2 = ""; |
| 30 |
var H2_ = ""; |
| 31 |
var HR = ""; |
| 32 |
var DEBUG = false; |
| 33 |
|
| 34 |
|
| 35 |
var PASSED = " PASSED!" |
| 36 |
var FAILED = " FAILED! expected: "; |
| 37 |
function test() { |
| 38 |
for ( tc=0; tc < testcases.length; tc++ ) { |
| 39 |
testcases[tc].passed = writeTestCaseResult( |
| 40 |
testcases[tc].expect, |
| 41 |
testcases[tc].actual, |
| 42 |
testcases[tc].description +" = "+ |
| 43 |
testcases[tc].actual ); |
| 44 |
|
| 45 |
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; |
| 46 |
} |
| 47 |
stopTest(); |
| 48 |
return ( testcases ); |
| 49 |
} |
| 50 |
|
| 51 |
function TestCase( n, d, e, a ) { |
| 52 |
this.name = n; |
| 53 |
this.description = d; |
| 54 |
this.expect = e; |
| 55 |
this.actual = a; |
| 56 |
this.passed = true; |
| 57 |
this.reason = ""; |
| 58 |
this.bugnumber = BUGNUMBER; |
| 59 |
|
| 60 |
this.passed = getTestCaseResult( this.expect, this.actual ); |
| 61 |
if ( DEBUG ) { |
| 62 |
print( "added " + this.description ); |
| 63 |
} |
| 64 |
} |
| 65 |
function startTest() { |
| 66 |
|
| 67 |
if ( VERSION == "ECMA_1" ) { |
| 68 |
version ( "130" ); |
| 69 |
} |
| 70 |
if ( VERSION == "JS_13" ) { |
| 71 |
version ( "130" ); |
| 72 |
} |
| 73 |
if ( VERSION == "JS_12" ) { |
| 74 |
version ( "120" ); |
| 75 |
} |
| 76 |
if ( VERSION == "JS_11" ) { |
| 77 |
version ( "110" ); |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 82 |
testcases = new Array(); |
| 83 |
tc = 0; |
| 84 |
|
| 85 |
} |
| 86 |
function getTestCaseResult( expect, actual ) { |
| 87 |
|
| 88 |
|
| 89 |
if ( actual != actual ) { |
| 90 |
if ( typeof actual == "object" ) { |
| 91 |
actual = "NaN object"; |
| 92 |
} else { |
| 93 |
actual = "NaN number"; |
| 94 |
} |
| 95 |
} |
| 96 |
if ( expect != expect ) { |
| 97 |
if ( typeof expect == "object" ) { |
| 98 |
expect = "NaN object"; |
| 99 |
} else { |
| 100 |
expect = "NaN number"; |
| 101 |
} |
| 102 |
} |
| 103 |
|
| 104 |
var passed = ( expect == actual ) ? true : false; |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
if ( !passed |
| 109 |
&& typeof(actual) == "number" |
| 110 |
&& typeof(expect) == "number" |
| 111 |
) { |
| 112 |
if ( Math.abs(actual-expect) < 0.0000001 ) { |
| 113 |
passed = true; |
| 114 |
} |
| 115 |
} |
| 116 |
|
| 117 |
|
| 118 |
if ( typeof(expect) != typeof(actual) ) { |
| 119 |
passed = false; |
| 120 |
} |
| 121 |
|
| 122 |
return passed; |
| 123 |
} |
| 124 |
function writeTestCaseResult( expect, actual, string ) { |
| 125 |
var passed = getTestCaseResult( expect, actual ); |
| 126 |
writeFormattedResult( expect, actual, string, passed ); |
| 127 |
return passed; |
| 128 |
} |
| 129 |
function writeFormattedResult( expect, actual, string, passed ) { |
| 130 |
var s = TT + string ; |
| 131 |
|
| 132 |
for ( k = 0; |
| 133 |
k < (60 - string.length >= 0 ? 60 - string.length : 5) ; |
| 134 |
k++ ) { |
| 135 |
} |
| 136 |
|
| 137 |
s += B ; |
| 138 |
s += ( passed ) ? FONT_GREEN + NBSP + PASSED : FONT_RED + NBSP + FAILED + expect + TT_ ; |
| 139 |
|
| 140 |
print( s + FONT_ + B_ + TT_ ); |
| 141 |
|
| 142 |
return passed; |
| 143 |
} |
| 144 |
|
| 145 |
function writeHeaderToLog( string ) { |
| 146 |
print( H2 + string + H2_ ); |
| 147 |
} |
| 148 |
function stopTest() |
| 149 |
{ |
| 150 |
var sizeTag = "<#TEST CASES SIZE>"; |
| 151 |
var doneTag = "<#TEST CASES DONE>"; |
| 152 |
var beginTag = "<#TEST CASE "; |
| 153 |
var endTag = ">"; |
| 154 |
|
| 155 |
print(sizeTag); |
| 156 |
print(testcases.length); |
| 157 |
for (tc = 0; tc < testcases.length; tc++) |
| 158 |
{ |
| 159 |
print(beginTag + 'PASSED' + endTag); |
| 160 |
print(testcases[tc].passed); |
| 161 |
print(beginTag + 'NAME' + endTag); |
| 162 |
print(testcases[tc].name); |
| 163 |
print(beginTag + 'EXPECTED' + endTag); |
| 164 |
print(testcases[tc].expect); |
| 165 |
print(beginTag + 'ACTUAL' + endTag); |
| 166 |
print(testcases[tc].actual); |
| 167 |
print(beginTag + 'DESCRIPTION' + endTag); |
| 168 |
print(testcases[tc].description); |
| 169 |
print(beginTag + 'REASON' + endTag); |
| 170 |
print(( testcases[tc].passed ) ? "" : "wrong value "); |
| 171 |
print(beginTag + 'BUGNUMBER' + endTag); |
| 172 |
print( BUGNUMBER ); |
| 173 |
} |
| 174 |
print(doneTag); |
| 175 |
print( HR ); |
| 176 |
gc(); |
| 177 |
} |
| 178 |
function getFailedCases() { |
| 179 |
for ( var i = 0; i < testcases.length; i++ ) { |
| 180 |
if ( ! testcases[i].passed ) { |
| 181 |
print( testcases[i].description +" = " +testcases[i].actual +" expected: "+ testcases[i].expect ); |
| 182 |
} |
| 183 |
} |
| 184 |
} |
| 185 |
function err( msg, page, line ) { |
| 186 |
testcases[tc].actual = "error"; |
| 187 |
testcases[tc].reason = msg; |
| 188 |
writeTestCaseResult( testcases[tc].expect, |
| 189 |
testcases[tc].actual, |
| 190 |
testcases[tc].description +" = "+ testcases[tc].actual + |
| 191 |
": " + testcases[tc].reason ); |
| 192 |
stopTest(); |
| 193 |
return true; |
| 194 |
} |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
var msPerDay = 86400000; |
| 208 |
var HoursPerDay = 24; |
| 209 |
var MinutesPerHour = 60; |
| 210 |
var SecondsPerMinute = 60; |
| 211 |
var msPerSecond = 1000; |
| 212 |
var msPerMinute = 60000; |
| 213 |
var msPerHour = 3600000; |
| 214 |
|
| 215 |
var TIME_1970 = 0; |
| 216 |
var TIME_2000 = 946684800000; |
| 217 |
var TIME_1900 = -2208988800000; |
| 218 |
|
| 219 |
function Day( t ) { |
| 220 |
return ( Math.floor(t/msPerDay ) ); |
| 221 |
} |
| 222 |
function DaysInYear( y ) { |
| 223 |
if ( y % 4 != 0 ) { |
| 224 |
return 365; |
| 225 |
} |
| 226 |
if ( (y % 4 == 0) && (y % 100 != 0) ) { |
| 227 |
return 366; |
| 228 |
} |
| 229 |
if ( (y % 100 == 0) && (y % 400 != 0) ) { |
| 230 |
return 365; |
| 231 |
} |
| 232 |
if ( (y % 400 == 0) ){ |
| 233 |
return 366; |
| 234 |
} else { |
| 235 |
return "ERROR: DaysInYear(" + y + ") case not covered"; |
| 236 |
} |
| 237 |
} |
| 238 |
function TimeInYear( y ) { |
| 239 |
return ( DaysInYear(y) * msPerDay ); |
| 240 |
} |
| 241 |
function DayNumber( t ) { |
| 242 |
return ( Math.floor( t / msPerDay ) ); |
| 243 |
} |
| 244 |
function TimeWithinDay( t ) { |
| 245 |
if ( t < 0 ) { |
| 246 |
return ( (t % msPerDay) + msPerDay ); |
| 247 |
} else { |
| 248 |
return ( t % msPerDay ); |
| 249 |
} |
| 250 |
} |
| 251 |
function YearNumber( t ) { |
| 252 |
} |
| 253 |
function TimeFromYear( y ) { |
| 254 |
return ( msPerDay * DayFromYear(y) ); |
| 255 |
} |
| 256 |
function DayFromYear( y ) { |
| 257 |
return ( 365*(y-1970) + |
| 258 |
Math.floor((y-1969)/4) - |
| 259 |
Math.floor((y-1901)/100) + |
| 260 |
Math.floor((y-1601)/400) ); |
| 261 |
} |
| 262 |
function InLeapYear( t ) { |
| 263 |
if ( DaysInYear(YearFromTime(t)) == 365 ) { |
| 264 |
return 0; |
| 265 |
} |
| 266 |
if ( DaysInYear(YearFromTime(t)) == 366 ) { |
| 267 |
return 1; |
| 268 |
} else { |
| 269 |
return "ERROR: InLeapYear("+t+") case not covered"; |
| 270 |
} |
| 271 |
} |
| 272 |
function YearFromTime( t ) { |
| 273 |
t = Number( t ); |
| 274 |
var sign = ( t < 0 ) ? -1 : 1; |
| 275 |
var year = ( sign < 0 ) ? 1969 : 1970; |
| 276 |
for ( var timeToTimeZero = t; ; ) { |
| 277 |
|
| 278 |
timeToTimeZero -= sign * TimeInYear(year) |
| 279 |
|
| 280 |
|
| 281 |
if ( sign < 0 ) { |
| 282 |
if ( sign * timeToTimeZero <= 0 ) { |
| 283 |
break; |
| 284 |
} else { |
| 285 |
year += sign; |
| 286 |
} |
| 287 |
} else { |
| 288 |
if ( sign * timeToTimeZero < 0 ) { |
| 289 |
break; |
| 290 |
} else { |
| 291 |
year += sign; |
| 292 |
} |
| 293 |
} |
| 294 |
} |
| 295 |
return ( year ); |
| 296 |
} |
| 297 |
function MonthFromTime( t ) { |
| 298 |
|
| 299 |
var day = DayWithinYear( t ); |
| 300 |
var leap = InLeapYear(t); |
| 301 |
|
| 302 |
if ( (0 <= day) && (day < 31) ) { |
| 303 |
return 0; |
| 304 |
} |
| 305 |
if ( (31 <= day) && (day < (59+leap)) ) { |
| 306 |
return 1; |
| 307 |
} |
| 308 |
if ( ((59+leap) <= day) && (day < (90+leap)) ) { |
| 309 |
return 2; |
| 310 |
} |
| 311 |
if ( ((90+leap) <= day) && (day < (120+leap)) ) { |
| 312 |
return 3; |
| 313 |
} |
| 314 |
if ( ((120+leap) <= day) && (day < (151+leap)) ) { |
| 315 |
return 4; |
| 316 |
} |
| 317 |
if ( ((151+leap) <= day) && (day < (181+leap)) ) { |
| 318 |
return 5; |
| 319 |
} |
| 320 |
if ( ((181+leap) <= day) && (day < (212+leap)) ) { |
| 321 |
return 6; |
| 322 |
} |
| 323 |
if ( ((212+leap) <= day) && (day < (243+leap)) ) { |
| 324 |
return 7; |
| 325 |
} |
| 326 |
if ( ((243+leap) <= day) && (day < (273+leap)) ) { |
| 327 |
return 8; |
| 328 |
} |
| 329 |
if ( ((273+leap) <= day) && (day < (304+leap)) ) { |
| 330 |
return 9; |
| 331 |
} |
| 332 |
if ( ((304+leap) <= day) && (day < (334+leap)) ) { |
| 333 |
return 10; |
| 334 |
} |
| 335 |
if ( ((334+leap) <= day) && (day < (365+leap)) ) { |
| 336 |
return 11; |
| 337 |
} else { |
| 338 |
return "ERROR: MonthFromTime("+t+") not known"; |
| 339 |
} |
| 340 |
} |
| 341 |
function DayWithinYear( t ) { |
| 342 |
return( Day(t) - DayFromYear(YearFromTime(t))); |
| 343 |
} |
| 344 |
function DateFromTime( t ) { |
| 345 |
var day = DayWithinYear(t); |
| 346 |
var month = MonthFromTime(t); |
| 347 |
|
| 348 |
if ( month == 0 ) { |
| 349 |
return ( day + 1 ); |
| 350 |
} |
| 351 |
if ( month == 1 ) { |
| 352 |
return ( day - 30 ); |
| 353 |
} |
| 354 |
if ( month == 2 ) { |
| 355 |
return ( day - 58 - InLeapYear(t) ); |
| 356 |
} |
| 357 |
if ( month == 3 ) { |
| 358 |
return ( day - 89 - InLeapYear(t)); |
| 359 |
} |
| 360 |
if ( month == 4 ) { |
| 361 |
return ( day - 119 - InLeapYear(t)); |
| 362 |
} |
| 363 |
if ( month == 5 ) { |
| 364 |
return ( day - 150- InLeapYear(t)); |
| 365 |
} |
| 366 |
if ( month == 6 ) { |
| 367 |
return ( day - 180- InLeapYear(t)); |
| 368 |
} |
| 369 |
if ( month == 7 ) { |
| 370 |
return ( day - 211- InLeapYear(t)); |
| 371 |
} |
| 372 |
if ( month == 8 ) { |
| 373 |
return ( day - 242- InLeapYear(t)); |
| 374 |
} |
| 375 |
if ( month == 9 ) { |
| 376 |
return ( day - 272- InLeapYear(t)); |
| 377 |
} |
| 378 |
if ( month == 10 ) { |
| 379 |
return ( day - 303- InLeapYear(t)); |
| 380 |
} |
| 381 |
if ( month == 11 ) { |
| 382 |
return ( day - 333- InLeapYear(t)); |
| 383 |
} |
| 384 |
|
| 385 |
return ("ERROR: DateFromTime("+t+") not known" ); |
| 386 |
} |
| 387 |
function WeekDay( t ) { |
| 388 |
var weekday = (Day(t)+4) % 7; |
| 389 |
return( weekday < 0 ? 7 + weekday : weekday ); |
| 390 |
} |
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
function HourFromTime( t ) { |
| 395 |
var h = Math.floor( t / msPerHour ) % HoursPerDay; |
| 396 |
return ( (h<0) ? HoursPerDay + h : h ); |
| 397 |
} |
| 398 |
function MinFromTime( t ) { |
| 399 |
var min = Math.floor( t / msPerMinute ) % MinutesPerHour; |
| 400 |
return( ( min < 0 ) ? MinutesPerHour + min : min ); |
| 401 |
} |
| 402 |
function SecFromTime( t ) { |
| 403 |
var sec = Math.floor( t / msPerSecond ) % SecondsPerMinute; |
| 404 |
return ( (sec < 0 ) ? SecondsPerMinute + sec : sec ); |
| 405 |
} |
| 406 |
function msFromTime( t ) { |
| 407 |
var ms = t % msPerSecond; |
| 408 |
return ( (ms < 0 ) ? msPerSecond + ms : ms ); |
| 409 |
} |
| 410 |
function LocalTZA() { |
| 411 |
return ( TZ_DIFF * msPerHour ); |
| 412 |
} |
| 413 |
function UTC( t ) { |
| 414 |
return ( t - LocalTZA() - DaylightSavingTA(t - LocalTZA()) ); |
| 415 |
} |
| 416 |
function DaylightSavingTA( t ) { |
| 417 |
t = t - LocalTZA(); |
| 418 |
|
| 419 |
var dst_start = GetFirstSundayInApril(t) + 2*msPerHour; |
| 420 |
var dst_end = GetLastSundayInOctober(t)+ 2*msPerHour; |
| 421 |
|
| 422 |
if ( t >= dst_start && t < dst_end ) { |
| 423 |
return msPerHour; |
| 424 |
} else { |
| 425 |
return 0; |
| 426 |
} |
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
print( new Date( UTC(dst_start + LocalTZA())) ); |
| 432 |
|
| 433 |
return UTC(dst_start + LocalTZA()); |
| 434 |
} |
| 435 |
function GetFirstSundayInApril( t ) { |
| 436 |
var year = YearFromTime(t); |
| 437 |
var leap = InLeapYear(t); |
| 438 |
|
| 439 |
var april = TimeFromYear(year) + TimeInMonth(0, leap) + TimeInMonth(1,leap) + |
| 440 |
TimeInMonth(2,leap); |
| 441 |
|
| 442 |
for ( var first_sunday = april; WeekDay(first_sunday) > 0; |
| 443 |
first_sunday += msPerDay ) |
| 444 |
{ |
| 445 |
; |
| 446 |
} |
| 447 |
|
| 448 |
return first_sunday; |
| 449 |
} |
| 450 |
function GetLastSundayInOctober( t ) { |
| 451 |
var year = YearFromTime(t); |
| 452 |
var leap = InLeapYear(t); |
| 453 |
|
| 454 |
for ( var oct = TimeFromYear(year), m = 0; m < 9; m++ ) { |
| 455 |
oct += TimeInMonth(m, leap); |
| 456 |
} |
| 457 |
for ( var last_sunday = oct + 30*msPerDay; WeekDay(last_sunday) > 0; |
| 458 |
last_sunday -= msPerDay ) |
| 459 |
{ |
| 460 |
; |
| 461 |
} |
| 462 |
return last_sunday; |
| 463 |
} |
| 464 |
function LocalTime( t ) { |
| 465 |
return ( t + LocalTZA() + DaylightSavingTA(t) ); |
| 466 |
} |
| 467 |
function MakeTime( hour, min, sec, ms ) { |
| 468 |
if ( isNaN( hour ) || isNaN( min ) || isNaN( sec ) || isNaN( ms ) ) { |
| 469 |
return Number.NaN; |
| 470 |
} |
| 471 |
|
| 472 |
hour = ToInteger(hour); |
| 473 |
min = ToInteger( min); |
| 474 |
sec = ToInteger( sec); |
| 475 |
ms = ToInteger( ms ); |
| 476 |
|
| 477 |
return( (hour*msPerHour) + (min*msPerMinute) + |
| 478 |
(sec*msPerSecond) + ms ); |
| 479 |
} |
| 480 |
function MakeDay( year, month, date ) { |
| 481 |
if ( isNaN(year) || isNaN(month) || isNaN(date) ) { |
| 482 |
return Number.NaN; |
| 483 |
} |
| 484 |
year = ToInteger(year); |
| 485 |
month = ToInteger(month); |
| 486 |
date = ToInteger(date ); |
| 487 |
|
| 488 |
var sign = ( year < 1970 ) ? -1 : 1; |
| 489 |
var t = ( year < 1970 ) ? 1 : 0; |
| 490 |
var y = ( year < 1970 ) ? 1969 : 1970; |
| 491 |
|
| 492 |
var result5 = year + Math.floor( month/12 ); |
| 493 |
var result6 = month % 12; |
| 494 |
|
| 495 |
if ( year < 1970 ) { |
| 496 |
for ( y = 1969; y >= year; y += sign ) { |
| 497 |
t += sign * TimeInYear(y); |
| 498 |
} |
| 499 |
} else { |
| 500 |
for ( y = 1970 ; y < year; y += sign ) { |
| 501 |
t += sign * TimeInYear(y); |
| 502 |
} |
| 503 |
} |
| 504 |
|
| 505 |
var leap = InLeapYear( t ); |
| 506 |
|
| 507 |
for ( var m = 0; m < month; m++ ) { |
| 508 |
t += TimeInMonth( m, leap ); |
| 509 |
} |
| 510 |
|
| 511 |
if ( YearFromTime(t) != result5 ) { |
| 512 |
return Number.NaN; |
| 513 |
} |
| 514 |
if ( MonthFromTime(t) != result6 ) { |
| 515 |
return Number.NaN; |
| 516 |
} |
| 517 |
if ( DateFromTime(t) != 1 ) { |
| 518 |
return Number.NaN; |
| 519 |
} |
| 520 |
|
| 521 |
return ( (Day(t)) + date - 1 ); |
| 522 |
} |
| 523 |
function TimeInMonth( month, leap ) { |
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
if ( month == 3 || month == 5 || month == 8 || month == 10 ) { |
| 529 |
return ( 30*msPerDay ); |
| 530 |
} |
| 531 |
|
| 532 |
|
| 533 |
if ( month == 0 || month == 2 || month == 4 || month == 6 || |
| 534 |
month == 7 || month == 9 || month == 11 ) { |
| 535 |
return ( 31*msPerDay ); |
| 536 |
} |
| 537 |
|
| 538 |
|
| 539 |
return ( (leap == 0) ? 28*msPerDay : 29*msPerDay ); |
| 540 |
} |
| 541 |
function MakeDate( day, time ) { |
| 542 |
if ( day == Number.POSITIVE_INFINITY || |
| 543 |
day == Number.NEGATIVE_INFINITY || |
| 544 |
day == Number.NaN ) { |
| 545 |
return Number.NaN; |
| 546 |
} |
| 547 |
if ( time == Number.POSITIVE_INFINITY || |
| 548 |
time == Number.POSITIVE_INFINITY || |
| 549 |
day == Number.NaN) { |
| 550 |
return Number.NaN; |
| 551 |
} |
| 552 |
return ( day * msPerDay ) + time; |
| 553 |
} |
| 554 |
function TimeClip( t ) { |
| 555 |
if ( isNaN( t ) ) { |
| 556 |
return ( Number.NaN ); |
| 557 |
} |
| 558 |
if ( Math.abs( t ) > 8.64e15 ) { |
| 559 |
return ( Number.NaN ); |
| 560 |
} |
| 561 |
|
| 562 |
return ( ToInteger( t ) ); |
| 563 |
} |
| 564 |
function ToInteger( t ) { |
| 565 |
t = Number( t ); |
| 566 |
|
| 567 |
if ( isNaN( t ) ){ |
| 568 |
return ( Number.NaN ); |
| 569 |
} |
| 570 |
if ( t == 0 || t == -0 || |
| 571 |
t == Number.POSITIVE_INFINITY || t == Number.NEGATIVE_INFINITY ) { |
| 572 |
return 0; |
| 573 |
} |
| 574 |
|
| 575 |
var sign = ( t < 0 ) ? -1 : 1; |
| 576 |
|
| 577 |
return ( sign * Math.floor( Math.abs( t ) ) ); |
| 578 |
} |
| 579 |
function Enumerate ( o ) { |
| 580 |
var properties = new Array(); |
| 581 |
for ( p in o ) { |
| 582 |
properties[ properties.length ] = new Array( p, o[p] ); |
| 583 |
} |
| 584 |
return properties; |
| 585 |
} |
| 586 |
function AddTestCase( description, expect, actual ) { |
| 587 |
testcases[tc++] = new TestCase( SECTION, description, expect, actual ); |
| 588 |
} |
| 589 |
function getFailedCases() { |
| 590 |
for ( var i = 0; i < testcases.length; i++ ) { |
| 591 |
if ( ! testcases[i].passed ) { |
| 592 |
print( testcases[i].description +" = " +testcases[i].actual +" expected: "+ testcases[i].expect ); |
| 593 |
} |
| 594 |
} |
| 595 |
} |