(functionNameRoot, functionParamNum)
| 421 | |
| 422 | |
| 423 | function testDateFunction(functionNameRoot, functionParamNum) |
| 424 | { |
| 425 | var success = true; |
| 426 | |
| 427 | switch (functionParamNum) { |
| 428 | case 4: |
| 429 | success &= testDateFunctionWithValueExpectingNaN4(functionNameRoot); |
| 430 | if (functionNameRoot != "Time" && |
| 431 | functionNameRoot != "FullYear" && |
| 432 | functionNameRoot != "UTCFullYear" && |
| 433 | functionNameRoot != "Year") |
| 434 | success &= testDateFunctionWithValueNoRecoverNaN(functionNameRoot, 4); |
| 435 | |
| 436 | case 3: |
| 437 | success &= testDateFunctionWithValueExpectingNaN3(functionNameRoot); |
| 438 | if (functionNameRoot != "Time" && |
| 439 | functionNameRoot != "FullYear" && |
| 440 | functionNameRoot != "UTCFullYear" && |
| 441 | functionNameRoot != "Year") |
| 442 | success &= testDateFunctionWithValueNoRecoverNaN(functionNameRoot, 3); |
| 443 | |
| 444 | case 2: |
| 445 | success &= testDateFunctionWithValueExpectingNaN2(functionNameRoot); |
| 446 | if (functionNameRoot != "Time" && |
| 447 | functionNameRoot != "FullYear" && |
| 448 | functionNameRoot != "UTCFullYear" && |
| 449 | functionNameRoot != "Year") |
| 450 | success &= testDateFunctionWithValueNoRecoverNaN(functionNameRoot, 2); |
| 451 | |
| 452 | case 1: |
| 453 | success &= testDateFunctionWithValueExpectingNaN1(functionNameRoot); |
| 454 | if (functionNameRoot == "Time") |
| 455 | success &= testDateFunctionWithValueRecoverTime(functionNameRoot); |
| 456 | else if (functionNameRoot == "FullYear") |
| 457 | success &= testDateFunctionWithValueRecoverFullYear(functionNameRoot); |
| 458 | else if (functionNameRoot == "UTCFullYear") |
| 459 | success &= testDateFunctionWithValueRecoverUTCFullYear(functionNameRoot); |
| 460 | else if (functionNameRoot == "Year") |
| 461 | success &= testDateFunctionWithValueRecoverYear(functionNameRoot); |
| 462 | else |
| 463 | success &= testDateFunctionWithValueNoRecoverNaN(functionNameRoot, 1); |
| 464 | } |
| 465 | |
| 466 | if (success) |
| 467 | testPassed("date.set" + functionNameRoot + " passed all tests"); |
| 468 | } |
| 469 | |
| 470 | for (var x in dateFunctionNameRoots) |
| 471 | { |
no test coverage detected