diff options
Diffstat (limited to 'website/resources/scripts/testcases2/15.8.2.15_round.json')
-rw-r--r-- | website/resources/scripts/testcases2/15.8.2.15_round.json | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/15.8.2.15_round.json b/website/resources/scripts/testcases2/15.8.2.15_round.json new file mode 100644 index 000000000..3444893dc --- /dev/null +++ b/website/resources/scripts/testcases2/15.8.2.15_round.json @@ -0,0 +1,50 @@ +{ + "testCollection": { + "name": "15.8.2.15_round", + "numTests": 7, + "tests": [ + { + "section": "15.8.2.15", + "description": "Checking if Math.round(x) is NaN, where x is NaN", + "test": "// CHECK#1\nvar x = NaN;\nif (!isNaN(Math.round(x)))\n{\n\t$ERROR(\"#1: 'var x=NaN; isNaN(Math.round(x)) === false'\");\n}\n", + "id": "S15.8.2.15_A1" + }, + { + "section": "15.8.2.15", + "description": "Checking if Math.round(x) equals to +0, where x is +0", + "test": "// CHECK#1\nvar x = +0;\nif (Math.round(x) !== +0)\n{\n\t$ERROR(\"#1: 'var x=+0; Math.round(x) !== +0'\");\n}\n", + "id": "S15.8.2.15_A2" + }, + { + "section": "15.8.2.15", + "description": "Checking if Math.round(x) equals to -0, where x is -0", + "test": "// CHECK#1\nvar x = -0;\nif (Math.round(x) !== -0)\n{\n\t$ERROR(\"#1: 'var x=-0; Math.round(x) !== -0'\");\n}\n", + "id": "S15.8.2.15_A3" + }, + { + "section": "15.8.2.15", + "description": "Checking if Math.round(x) is +Infinity, where x is +Infinity", + "test": "// CHECK#1\nvar x = +Infinity;\nif (Math.round(x) !== +Infinity)\n{\n\t$ERROR(\"#1: 'var x=+Infinity; Math.round(x) !== +Infinity'\");\n}\n", + "id": "S15.8.2.15_A4" + }, + { + "section": "15.8.2.15", + "description": "Checking if Math.round(x) is -Infinity, where x is -Infinity", + "test": "// CHECK#1\nvar x = -Infinity;\nif (Math.round(x) !== -Infinity)\n{\n\t$ERROR(\"#1: 'var x=-Infinity; Math.round(x) !== -Infinity'\");\n}\n", + "id": "S15.8.2.15_A5" + }, + { + "section": "15.8.2.15", + "description": ": Checking if Math.round(x) is equal to Math.floor(x+0.5), where x equals to 0, greater than 0, or is less than -0.5; this check is performed on 2000 argument x values;", + "test": "// CHECK#1\nfor (i = 0; i <= 1000; i++)\n{\n\tx = i/10.0;\n\tif (Math.round(x) !== Math.floor(x + 0.5))\n\t{\n\t\t$ERROR(\"#1: 'x = \" + x + \"; Math.round(x) !== Math.floor(x + 0.5)'\")\n\t}\n}\n\nfor (i = -5; i >= -1000; i--)\n{\n\tif (i === -5)\n\t{\n\t\tx = -0.500000000000001;\n\t} else\n\t{\n\t\tx = i/10.0;\n\t}\n\t\n\tif (Math.round(x) !== Math.floor(x + 0.5))\n\t{\n\t\t$ERROR(\"#2: 'x = \" + x + \"; Math.round(x) !== Math.floor(x + 0.5)'\")\n\t}\n}\n", + "id": "S15.8.2.15_A6" + }, + { + "section": "15.8.2.15", + "description": "Checking if Math.round(x) is equal -0, where x is equal to 0, equal to -0.5, or less than -0 while greater than -0.5", + "test": "// CHECK#1\nif (Math.round(-0) !== -0)\n{\n\t$ERROR(\"#1: 'Math.round(-0) !== -0'\");\n}\n\n// CHECK#2\nif (Math.round(-0.5) !== -0)\n{\n\t$ERROR(\"#2: 'Math.round(-0.5) !== -0'\");\n}\n\n// CHECK#3\nif (Math.round(-0.25) !== -0)\n{\n\t$ERROR(\"#3: 'Math.round(-0.25) !== -0'\");\n}\n", + "id": "S15.8.2.15_A7" + } + ] + } +} |