~loic.molinari/+junk/qtdeclarative-shadereffectsource-changes

« back to all changes in this revision

Viewing changes to tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.7.js

  • Committer: Loïc Molinari
  • Date: 2012-04-21 17:59:51 UTC
  • Revision ID: loic.molinari@canonical.com-20120421175951-bqx68caaf5zrp76l
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/* ***** BEGIN LICENSE BLOCK *****
 
3
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
4
 *
 
5
 * The contents of this file are subject to the Mozilla Public License Version
 
6
 * 1.1 (the "License"); you may not use this file except in compliance with
 
7
 * the License. You may obtain a copy of the License at
 
8
 * http://www.mozilla.org/MPL/
 
9
 *
 
10
 * Software distributed under the License is distributed on an "AS IS" basis,
 
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
12
 * for the specific language governing rights and limitations under the
 
13
 * License.
 
14
 *
 
15
 * The Original Code is Mozilla Communicator client code, released
 
16
 * March 31, 1998.
 
17
 *
 
18
 * The Initial Developer of the Original Code is
 
19
 * Netscape Communications Corporation.
 
20
 * Portions created by the Initial Developer are Copyright (C) 1998
 
21
 * the Initial Developer. All Rights Reserved.
 
22
 *
 
23
 * Contributor(s):
 
24
 *
 
25
 * Alternatively, the contents of this file may be used under the terms of
 
26
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
27
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
28
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
29
 * of those above. If you wish to allow use of your version of this file only
 
30
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
31
 * use your version of this file under the terms of the MPL, indicate your
 
32
 * decision by deleting the provisions above and replace them with the notice
 
33
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
34
 * the provisions above, a recipient may use your version of this file under
 
35
 * the terms of any one of the MPL, the GPL or the LGPL.
 
36
 *
 
37
 * ***** END LICENSE BLOCK ***** */
 
38
 
 
39
gTestfile = '15.8.2.7.js';
 
40
 
 
41
/**
 
42
   File Name:          15.8.2.7.js
 
43
   ECMA Section:       15.8.2.7 cos( x )
 
44
   Description:        return an approximation to the cosine of the
 
45
   argument.  argument is expressed in radians
 
46
   Author:             christine@netscape.com
 
47
   Date:               7 july 1997
 
48
 
 
49
*/
 
50
 
 
51
var SECTION = "15.8.2.7";
 
52
var VERSION = "ECMA_1";
 
53
startTest();
 
54
var TITLE   = "Math.cos(x)";
 
55
 
 
56
writeHeaderToLog( SECTION + " "+ TITLE);
 
57
 
 
58
new TestCase( SECTION,
 
59
              "Math.cos.length",
 
60
              1,
 
61
              Math.cos.length );
 
62
 
 
63
new TestCase( SECTION,
 
64
              "Math.cos()",
 
65
              Number.NaN,
 
66
              Math.cos() );
 
67
 
 
68
new TestCase( SECTION,
 
69
              "Math.cos(void 0)",
 
70
              Number.NaN,
 
71
              Math.cos(void 0) );
 
72
 
 
73
new TestCase( SECTION,
 
74
              "Math.cos(false)",
 
75
              1,
 
76
              Math.cos(false) );
 
77
 
 
78
new TestCase( SECTION,
 
79
              "Math.cos(null)",
 
80
              1,
 
81
              Math.cos(null) );
 
82
 
 
83
new TestCase( SECTION,
 
84
              "Math.cos('0')",
 
85
              1,
 
86
              Math.cos('0') );
 
87
 
 
88
new TestCase( SECTION,
 
89
              "Math.cos('Infinity')",
 
90
              Number.NaN,
 
91
              Math.cos("Infinity") );
 
92
 
 
93
new TestCase( SECTION,
 
94
              "Math.cos('3.14159265359')",
 
95
              -1,
 
96
              Math.cos('3.14159265359') );
 
97
 
 
98
new TestCase( SECTION,
 
99
              "Math.cos(NaN)",
 
100
              Number.NaN,
 
101
              Math.cos(Number.NaN)        );
 
102
 
 
103
new TestCase( SECTION,
 
104
              "Math.cos(0)",
 
105
              1,
 
106
              Math.cos(0)                 );
 
107
 
 
108
new TestCase( SECTION,
 
109
              "Math.cos(-0)",
 
110
              1,
 
111
              Math.cos(-0)                );
 
112
 
 
113
new TestCase( SECTION,
 
114
              "Math.cos(Infinity)",
 
115
              Number.NaN,
 
116
              Math.cos(Number.POSITIVE_INFINITY) );
 
117
 
 
118
new TestCase( SECTION,
 
119
              "Math.cos(-Infinity)",
 
120
              Number.NaN,
 
121
              Math.cos(Number.NEGATIVE_INFINITY) );
 
122
 
 
123
new TestCase( SECTION,
 
124
              "Math.cos(0.7853981633974)",
 
125
              0.7071067811865,
 
126
              Math.cos(0.7853981633974)   );
 
127
 
 
128
new TestCase( SECTION,
 
129
              "Math.cos(1.570796326795)",
 
130
              0,
 
131
              Math.cos(1.570796326795)    );
 
132
 
 
133
new TestCase( SECTION,
 
134
              "Math.cos(2.356194490192)",
 
135
              -0.7071067811865,
 
136
              Math.cos(2.356194490192)    );
 
137
 
 
138
new TestCase( SECTION,
 
139
              "Math.cos(3.14159265359)",
 
140
              -1,
 
141
              Math.cos(3.14159265359)     );
 
142
 
 
143
new TestCase( SECTION,
 
144
              "Math.cos(3.926990816987)",
 
145
              -0.7071067811865,
 
146
              Math.cos(3.926990816987)    );
 
147
 
 
148
new TestCase( SECTION,
 
149
              "Math.cos(4.712388980385)",
 
150
              0,
 
151
              Math.cos(4.712388980385)    );
 
152
 
 
153
new TestCase( SECTION,
 
154
              "Math.cos(5.497787143782)",
 
155
              0.7071067811865,
 
156
              Math.cos(5.497787143782)    );
 
157
 
 
158
new TestCase( SECTION,
 
159
              "Math.cos(Math.PI*2)",
 
160
              1,
 
161
              Math.cos(Math.PI*2)         );
 
162
 
 
163
new TestCase( SECTION,
 
164
              "Math.cos(Math.PI/4)",
 
165
              Math.SQRT2/2,
 
166
              Math.cos(Math.PI/4)         );
 
167
 
 
168
new TestCase( SECTION,
 
169
              "Math.cos(Math.PI/2)",
 
170
              0,
 
171
              Math.cos(Math.PI/2)         );
 
172
 
 
173
new TestCase( SECTION,
 
174
              "Math.cos(3*Math.PI/4)",
 
175
              -Math.SQRT2/2,
 
176
              Math.cos(3*Math.PI/4)       );
 
177
 
 
178
new TestCase( SECTION,
 
179
              "Math.cos(Math.PI)",
 
180
              -1,
 
181
              Math.cos(Math.PI)           );
 
182
 
 
183
new TestCase( SECTION,
 
184
              "Math.cos(5*Math.PI/4)",
 
185
              -Math.SQRT2/2,
 
186
              Math.cos(5*Math.PI/4)       );
 
187
 
 
188
new TestCase( SECTION,
 
189
              "Math.cos(3*Math.PI/2)",
 
190
              0,
 
191
              Math.cos(3*Math.PI/2)       );
 
192
 
 
193
new TestCase( SECTION,
 
194
              "Math.cos(7*Math.PI/4)",
 
195
              Math.SQRT2/2,
 
196
              Math.cos(7*Math.PI/4)       );
 
197
 
 
198
new TestCase( SECTION,
 
199
              "Math.cos(Math.PI*2)",
 
200
              1,
 
201
              Math.cos(2*Math.PI)         );
 
202
 
 
203
new TestCase( SECTION,
 
204
              "Math.cos(-0.7853981633974)",
 
205
              0.7071067811865,
 
206
              Math.cos(-0.7853981633974)  );
 
207
 
 
208
new TestCase( SECTION,
 
209
              "Math.cos(-1.570796326795)",
 
210
              0,
 
211
              Math.cos(-1.570796326795)   );
 
212
 
 
213
new TestCase( SECTION,
 
214
              "Math.cos(-2.3561944901920)",
 
215
              -.7071067811865,
 
216
              Math.cos(2.3561944901920)   );
 
217
 
 
218
new TestCase( SECTION,
 
219
              "Math.cos(-3.14159265359)",
 
220
              -1,
 
221
              Math.cos(3.14159265359)     );
 
222
 
 
223
new TestCase( SECTION,
 
224
              "Math.cos(-3.926990816987)",
 
225
              -0.7071067811865,
 
226
              Math.cos(3.926990816987)    );
 
227
 
 
228
new TestCase( SECTION,
 
229
              "Math.cos(-4.712388980385)",
 
230
              0,
 
231
              Math.cos(4.712388980385)    );
 
232
 
 
233
new TestCase( SECTION,
 
234
              "Math.cos(-5.497787143782)",
 
235
              0.7071067811865,
 
236
              Math.cos(5.497787143782)    );
 
237
 
 
238
new TestCase( SECTION,
 
239
              "Math.cos(-6.28318530718)",
 
240
              1,
 
241
              Math.cos(6.28318530718)     );
 
242
 
 
243
new TestCase( SECTION,
 
244
              "Math.cos(-Math.PI/4)",
 
245
              Math.SQRT2/2,
 
246
              Math.cos(-Math.PI/4)        );
 
247
 
 
248
new TestCase( SECTION,
 
249
              "Math.cos(-Math.PI/2)",
 
250
              0,
 
251
              Math.cos(-Math.PI/2)        );
 
252
 
 
253
new TestCase( SECTION,
 
254
              "Math.cos(-3*Math.PI/4)",
 
255
              -Math.SQRT2/2,
 
256
              Math.cos(-3*Math.PI/4)      );
 
257
 
 
258
new TestCase( SECTION,
 
259
              "Math.cos(-Math.PI)",
 
260
              -1,
 
261
              Math.cos(-Math.PI)          );
 
262
 
 
263
new TestCase( SECTION,
 
264
              "Math.cos(-5*Math.PI/4)",
 
265
              -Math.SQRT2/2,
 
266
              Math.cos(-5*Math.PI/4)      );
 
267
 
 
268
new TestCase( SECTION,
 
269
              "Math.cos(-3*Math.PI/2)",
 
270
              0,
 
271
              Math.cos(-3*Math.PI/2)      );
 
272
 
 
273
new TestCase( SECTION,
 
274
              "Math.cos(-7*Math.PI/4)",
 
275
              Math.SQRT2/2,
 
276
              Math.cos(-7*Math.PI/4)      );
 
277
 
 
278
new TestCase( SECTION,
 
279
              "Math.cos(-Math.PI*2)",
 
280
              1,
 
281
              Math.cos(-Math.PI*2)        );
 
282
 
 
283
test();