1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma/Math/15.8.2.16.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,98 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +/** 1.11 + File Name: 15.8.2.16.js 1.12 + ECMA Section: 15.8.2.16 sin( x ) 1.13 + Description: return an approximation to the sine of the 1.14 + argument. argument is expressed in radians 1.15 + Author: christine@netscape.com 1.16 + Date: 7 july 1997 1.17 + 1.18 +*/ 1.19 +var SECTION = "15.8.2.16"; 1.20 +var VERSION = "ECMA_1"; 1.21 +startTest(); 1.22 +var TITLE = "Math.sin(x)"; 1.23 + 1.24 +writeHeaderToLog( SECTION + " "+ TITLE); 1.25 + 1.26 +new TestCase( SECTION, 1.27 + "Math.sin.length", 1.28 + 1, 1.29 + Math.sin.length ); 1.30 + 1.31 +new TestCase( SECTION, 1.32 + "Math.sin()", 1.33 + Number.NaN, 1.34 + Math.sin() ); 1.35 + 1.36 +new TestCase( SECTION, 1.37 + "Math.sin(null)", 1.38 + 0, 1.39 + Math.sin(null) ); 1.40 + 1.41 +new TestCase( SECTION, 1.42 + "Math.sin(void 0)", 1.43 + Number.NaN, 1.44 + Math.sin(void 0) ); 1.45 + 1.46 +new TestCase( SECTION, 1.47 + "Math.sin(false)", 1.48 + 0, 1.49 + Math.sin(false) ); 1.50 + 1.51 +new TestCase( SECTION, 1.52 + "Math.sin('2.356194490192')", 1.53 + 0.7071067811865, 1.54 + Math.sin('2.356194490192') ); 1.55 + 1.56 +new TestCase( SECTION, 1.57 + "Math.sin(NaN)", 1.58 + Number.NaN, 1.59 + Math.sin(Number.NaN) ); 1.60 + 1.61 +new TestCase( SECTION, 1.62 + "Math.sin(0)", 1.63 + 0, 1.64 + Math.sin(0) ); 1.65 + 1.66 +new TestCase( SECTION, 1.67 + "Math.sin(-0)", 1.68 + -0, 1.69 + Math.sin(-0)); 1.70 + 1.71 +new TestCase( SECTION, 1.72 + "Math.sin(Infinity)", 1.73 + Number.NaN, 1.74 + Math.sin(Number.POSITIVE_INFINITY)); 1.75 + 1.76 +new TestCase( SECTION, 1.77 + "Math.sin(-Infinity)", 1.78 + Number.NaN, 1.79 + Math.sin(Number.NEGATIVE_INFINITY)); 1.80 + 1.81 +new TestCase( SECTION, 1.82 + "Math.sin(0.7853981633974)", 1.83 + 0.7071067811865, 1.84 + Math.sin(0.7853981633974)); 1.85 + 1.86 +new TestCase( SECTION, 1.87 + "Math.sin(1.570796326795)", 1.88 + 1, 1.89 + Math.sin(1.570796326795)); 1.90 + 1.91 +new TestCase( SECTION, 1.92 + "Math.sin(2.356194490192)", 1.93 + 0.7071067811865, 1.94 + Math.sin(2.356194490192)); 1.95 + 1.96 +new TestCase( SECTION, 1.97 + "Math.sin(3.14159265359)", 1.98 + 0, 1.99 + Math.sin(3.14159265359)); 1.100 + 1.101 +test();