author | lagergren |
Thu, 17 Apr 2014 20:01:19 +0200 | |
changeset 24740 | 26791be09688 |
parent 24719 | f726e9d67629 |
child 24743 | 138ee369abd8 |
permissions | -rw-r--r-- |
16147 | 1 |
/* |
16151 | 2 |
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
16147 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
4 |
* |
16147 | 5 |
* This code is free software; you can redistribute it and/or modify it |
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
8 |
* |
16147 | 9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
14 |
* |
16147 | 15 |
* You should have received a copy of the GNU General Public License version |
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
18 |
* |
16147 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
24 |
/** |
|
25 |
* runsunspider : runs the sunspider tests and checks for compliance |
|
26 |
* |
|
16525
1409942e618e
8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
lagergren
parents:
16164
diff
changeset
|
27 |
* @subtest |
16147 | 28 |
*/ |
29 |
||
30 |
/** |
|
31 |
* This is not a test, but a test "framework" for running sunspider tests. |
|
32 |
*/ |
|
33 |
||
34 |
function assertEq(a, b) { |
|
35 |
if (a !== b) { |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
36 |
throw "ASSERTION FAILED: " + a + " should be " + b; |
16147 | 37 |
} |
38 |
} |
|
39 |
||
24719 | 40 |
function pprint(x) { |
41 |
if (verbose_run) { |
|
42 |
print(x); |
|
43 |
} |
|
44 |
} |
|
45 |
||
16147 | 46 |
var runs = 0; |
47 |
var total_time = 0; |
|
48 |
||
49 |
function runbench(name) { |
|
50 |
var filename = name.split("/").pop(); |
|
24719 | 51 |
pprint("Running (warmup/sanity) " + filename); |
16147 | 52 |
|
53 |
var start = new Date; |
|
24719 | 54 |
load(name); |
16147 | 55 |
var stop = new Date - start; |
56 |
total_time += stop; |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
57 |
|
24719 | 58 |
pprint(filename + " done in " + stop + " ms"); |
16147 | 59 |
runs++; |
60 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
61 |
|
24719 | 62 |
var m_w; |
63 |
var m_z; |
|
64 |
var MAXINT; |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
65 |
|
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
66 |
//produce deterministic random numbers for test suite |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
67 |
function pseudorandom() { |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
68 |
m_z = 36969 * (m_z & 65535) + (m_z >> 16); |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
69 |
m_w = 18000 * (m_w & 65535) + (m_w >> 16); |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
70 |
return (Math.abs((m_z << 16) + m_w) & MAXINT) / MAXINT; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
71 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
72 |
|
24719 | 73 |
function initrandom() { |
74 |
m_w = 4711; |
|
75 |
m_z = 17; |
|
76 |
MAXINT = 0x7fffffff; |
|
77 |
Math.random = pseudorandom; |
|
78 |
} |
|
79 |
||
80 |
var rtimes = 0; |
|
81 |
var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__; |
|
82 |
var single; |
|
83 |
var verbose_run = false; |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
84 |
|
24719 | 85 |
var args = []; |
86 |
if (typeof $ARGS !== 'undefined') { |
|
87 |
args = $ARGS; |
|
88 |
} else if (typeof arguments !== 'undefined' && arguments.length != 0) { |
|
89 |
args = arguments; |
|
90 |
} |
|
91 |
||
92 |
for (var i = 0; i < args.length; i++) { |
|
93 |
if (args[i] === '--verbose') { |
|
94 |
verbose_run = true; |
|
95 |
} else if (args[i] === '--times') { |
|
96 |
i++; |
|
97 |
rtimes = +args[i]; |
|
98 |
} else if (args[i] === '--single') { |
|
99 |
i++; |
|
100 |
single = args[i]; |
|
101 |
} |
|
102 |
} |
|
103 |
||
104 |
function runsuite(tests) { |
|
105 |
var changed = false; |
|
106 |
var res = []; |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
107 |
var oldRandom = Math.random; |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
108 |
|
16147 | 109 |
try { |
24719 | 110 |
for (var n = 0; n < tests.length; n++) { |
111 |
path = dir + '../external/sunspider/tests/sunspider-1.0.2/' + tests[n].name |
|
112 |
||
113 |
initrandom(); |
|
114 |
||
115 |
var dd = new Date; |
|
116 |
||
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
117 |
runbench(path); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
118 |
if (typeof tests[n].actual !== 'undefined') { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
119 |
assertEq(tests[n].actual(), tests[n].expected()); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
120 |
} |
24719 | 121 |
|
122 |
if (typeof tests[n].rerun !== 'undefined' && tests[n].times > 0) { |
|
123 |
pprint("rerunning " + tests[n].name + " " + tests[n].times + " times..."); |
|
124 |
var times = 0; |
|
125 |
var to = tests[n].times; |
|
126 |
||
127 |
var elemsPerPercent = to / 100; |
|
128 |
var po = 0|(to / 10); |
|
129 |
||
130 |
times = 0; |
|
131 |
for (; times < to; times++) { |
|
132 |
initrandom(); |
|
133 |
tests[n].rerun(); |
|
134 |
if ((times % (po|0)) == 0) { |
|
135 |
pprint(times/to * 100 + "%"); |
|
136 |
} |
|
137 |
} |
|
138 |
} |
|
139 |
||
140 |
var t = new Date - dd; |
|
141 |
pprint("time: " + t + " ms"); |
|
142 |
if (typeof tests[n].actual !== 'undefined') { |
|
143 |
assertEq(tests[n].actual(), tests[n].expected()); |
|
144 |
} |
|
145 |
res.push(t); |
|
146 |
||
147 |
pprint(""); |
|
148 |
||
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
149 |
changed = true; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
150 |
} |
24719 | 151 |
} catch (e) { |
152 |
print("FAIL!"); |
|
153 |
throw e; |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
154 |
// no scripting or something, silently fail |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
155 |
} finally { |
24719 | 156 |
Math.random = oldRandom; |
16147 | 157 |
} |
24719 | 158 |
|
159 |
for (var n = 0; n < tests.length; n++) { |
|
160 |
||
161 |
var time = "" + res[n]; |
|
162 |
while (time.length < 4) { |
|
163 |
time = " " + time; |
|
164 |
} |
|
165 |
time += " ms"; |
|
166 |
if (res[n] == -1) { |
|
167 |
time = "<couldn't be rerun>"; |
|
168 |
} |
|
169 |
var str = tests[n].name; |
|
170 |
for (var spaces = str.length; spaces < 32; spaces++) { |
|
171 |
str += " "; |
|
172 |
} |
|
173 |
str += " "; |
|
174 |
str += time; |
|
175 |
||
176 |
if (tests[n].times > 0) { |
|
177 |
str += " ["; |
|
178 |
str += tests[n].times + " reruns]"; |
|
179 |
} |
|
180 |
pprint(str); |
|
181 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
182 |
|
16147 | 183 |
return changed; |
184 |
} |
|
185 |
||
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
186 |
function hash(str) { |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
187 |
var s = "" + str; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
188 |
var h = 0; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
189 |
var off = 0; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
190 |
for (var i = 0; i < s.length; i++) { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
191 |
h = 31 * h + s.charCodeAt(off++); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
192 |
h &= 0x7fffffff; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
193 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
194 |
return h ^ s.length; |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
195 |
} |
16147 | 196 |
|
197 |
var tests = [ |
|
24719 | 198 |
|
199 |
{ name: 'regexp-dna.js', |
|
200 |
actual: function() { |
|
201 |
return dnaOutputString + dnaInput; |
|
202 |
}, |
|
203 |
expected: function() { |
|
204 |
return expectedDNAOutputString + expectedDNAInput; |
|
205 |
}, |
|
206 |
}, |
|
207 |
||
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
208 |
{ name: 'string-base64.js', |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
209 |
actual: function() { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
210 |
return hash(str); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
211 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
212 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
213 |
return 1544571068; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
214 |
}, |
24719 | 215 |
times: rtimes, |
216 |
rerun: function() { |
|
217 |
toBinaryTable = [ |
|
218 |
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, |
|
219 |
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, |
|
220 |
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, |
|
221 |
52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1, |
|
222 |
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, |
|
223 |
15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, |
|
224 |
-1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, |
|
225 |
41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 |
|
226 |
]; |
|
227 |
var str = ""; |
|
228 |
for (var i = 0; i < 8192; i++) |
|
229 |
str += String.fromCharCode((25 * Math.random()) + 97); |
|
230 |
||
231 |
for (var i = 8192; i <= 16384; i *= 2) { |
|
232 |
var base64; |
|
233 |
base64 = toBase64(str); |
|
234 |
var encoded = base64ToString(base64); |
|
235 |
||
236 |
str += str; |
|
237 |
} |
|
238 |
toBinaryTable = null; |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
239 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
240 |
}, |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
241 |
{ name: 'date-format-xparb.js', |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
242 |
actual: function() { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
243 |
return shortFormat + longFormat; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
244 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
245 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
246 |
return "2017-09-05Tuesday, September 05, 2017 8:43:48 AM"; |
24719 | 247 |
}, |
248 |
times: rtimes, |
|
249 |
rerun: function() { |
|
250 |
date = new Date("1/1/2007 1:11:11"); |
|
251 |
for (i = 0; i < 4000; ++i) { |
|
252 |
var shortFormat = date.dateFormat("Y-m-d"); |
|
253 |
var longFormat = date.dateFormat("l, F d, Y g:i:s A"); |
|
254 |
date.setTime(date.getTime() + 84266956); |
|
255 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
256 |
} |
24719 | 257 |
|
258 |
}, |
|
259 |
{ name: 'string-validate-input.js', |
|
260 |
actual: function() { |
|
261 |
return hash(endResult); |
|
262 |
}, |
|
263 |
expected: function() { |
|
264 |
return 726038055; |
|
265 |
}, |
|
266 |
times: rtimes, |
|
267 |
rerun: function() { |
|
268 |
doTest(); |
|
269 |
}, |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
270 |
}, |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
271 |
{ name: '3d-morph.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
272 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
273 |
var acceptableDelta = 4e-15; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
274 |
return (testOutput - 6.394884621840902e-14) < acceptableDelta; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
275 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
276 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
277 |
return true; |
24719 | 278 |
}, |
279 |
times: rtimes, |
|
280 |
rerun: function() { |
|
281 |
a = Array() |
|
282 |
for (var i=0; i < nx*nz*3; ++i) |
|
283 |
a[i] = 0 |
|
284 |
for (var i = 0; i < loops; ++i) { |
|
285 |
morph(a, i/loops) |
|
286 |
} |
|
287 |
testOutput = 0; |
|
288 |
for (var i = 0; i < nx; i++) |
|
289 |
testOutput += a[3*(i*nx+i)+1]; |
|
290 |
a = null; |
|
291 |
||
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
292 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
293 |
}, |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
294 |
{ name: 'crypto-aes.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
295 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
296 |
return plainText; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
297 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
298 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
299 |
return decryptedText; |
24719 | 300 |
}, |
301 |
times: rtimes, |
|
302 |
rerun: function() { |
|
303 |
cipherText = AESEncryptCtr(plainText, password, 256); |
|
304 |
decryptedText = AESDecryptCtr(cipherText, password, 256); |
|
305 |
||
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
306 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
307 |
}, |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
308 |
{ name: 'crypto-md5.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
309 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
310 |
return md5Output; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
311 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
312 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
313 |
return "a831e91e0f70eddcb70dc61c6f82f6cd"; |
24719 | 314 |
}, |
315 |
times: rtimes, |
|
316 |
rerun: function() { |
|
317 |
md5Output = hex_md5(plainText); |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
318 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
319 |
}, |
24719 | 320 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
321 |
{ name: 'crypto-sha1.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
322 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
323 |
return sha1Output; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
324 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
325 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
326 |
return "2524d264def74cce2498bf112bedf00e6c0b796d"; |
24719 | 327 |
}, |
328 |
times: rtimes, |
|
329 |
rerun: function() { |
|
330 |
sha1Output = hex_sha1(plainText); |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
331 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
332 |
}, |
24719 | 333 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
334 |
{ name: 'bitops-bitwise-and.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
335 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
336 |
return result; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
337 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
338 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
339 |
return 0; |
24719 | 340 |
}, |
341 |
times: rtimes, |
|
342 |
rerun: function() { |
|
343 |
bitwiseAndValue = 4294967296; |
|
344 |
for (var i = 0; i < 600000; i++) { |
|
345 |
bitwiseAndValue = bitwiseAndValue & i; |
|
346 |
} |
|
347 |
result = bitwiseAndValue; |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
348 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
349 |
}, |
24719 | 350 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
351 |
{ name: 'bitops-bits-in-byte.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
352 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
353 |
return result; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
354 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
355 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
356 |
return 358400; |
24719 | 357 |
}, |
358 |
times: rtimes, |
|
359 |
rerun: function() { |
|
360 |
result = TimeFunc(bitsinbyte); |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
361 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
362 |
}, |
24719 | 363 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
364 |
{ name: 'bitops-nsieve-bits.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
365 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
366 |
var ret = 0; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
367 |
for (var i = 0; i < result.length; ++i) { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
368 |
ret += result[i]; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
369 |
} |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
370 |
ret += result.length; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
371 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
372 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
373 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
374 |
return -1286749539853; |
24719 | 375 |
}, |
376 |
times: rtimes, |
|
377 |
rerun: function() { |
|
378 |
result = sieve(); |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
379 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
380 |
}, |
24719 | 381 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
382 |
{ name: 'bitops-3bit-bits-in-byte.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
383 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
384 |
return sum; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
385 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
386 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
387 |
return 512000; |
24719 | 388 |
}, |
389 |
times: rtimes, |
|
390 |
rerun: function() { |
|
391 |
sum = TimeFunc(fast3bitlookup); |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
392 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
393 |
}, |
24719 | 394 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
395 |
{ name: 'access-nbody.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
396 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
397 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
398 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
399 |
expected: function() { |
20947
ab64f6cdcad0
8026498: Revert: latest runsunspider.js tests contains several bugs
jlaskey
parents:
20942
diff
changeset
|
400 |
return -1.3524862408537381; |
24719 | 401 |
}, |
402 |
times: rtimes, |
|
403 |
rerun: function() { |
|
404 |
var ret = 0; |
|
405 |
for (var n = 3; n <= 24; n *= 2) { |
|
406 |
(function(){ |
|
407 |
var bodies = new NBodySystem( Array( |
|
408 |
Sun(),Jupiter(),Saturn(),Uranus(),Neptune() |
|
409 |
)); |
|
410 |
var max = n * 100; |
|
411 |
||
412 |
ret += bodies.energy(); |
|
413 |
for (var i=0; i<max; i++){ |
|
414 |
bodies.advance(0.01); |
|
415 |
} |
|
416 |
ret += bodies.energy(); |
|
417 |
})(); |
|
418 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
419 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
420 |
}, |
24719 | 421 |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
422 |
{ name: 'access-binary-trees.js', |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
423 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
424 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
425 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
426 |
expected: function() { |
20947
ab64f6cdcad0
8026498: Revert: latest runsunspider.js tests contains several bugs
jlaskey
parents:
20942
diff
changeset
|
427 |
return -4; |
24719 | 428 |
}, |
429 |
times: rtimes, |
|
430 |
rerun: function() { |
|
431 |
ret = 0; |
|
432 |
||
433 |
for (var n = 4; n <= 7; n += 1) { |
|
434 |
var minDepth = 4; |
|
435 |
var maxDepth = Math.max(minDepth + 2, n); |
|
436 |
var stretchDepth = maxDepth + 1; |
|
437 |
||
438 |
var check = bottomUpTree(0,stretchDepth).itemCheck(); |
|
439 |
||
440 |
var longLivedTree = bottomUpTree(0,maxDepth); |
|
441 |
for (var depth=minDepth; depth<=maxDepth; depth+=2){ |
|
442 |
var iterations = 1 << (maxDepth - depth + minDepth); |
|
443 |
||
444 |
check = 0; |
|
445 |
for (var i=1; i<=iterations; i++){ |
|
446 |
check += bottomUpTree(i,depth).itemCheck(); |
|
447 |
check += bottomUpTree(-i,depth).itemCheck(); |
|
448 |
} |
|
449 |
} |
|
450 |
||
451 |
ret += longLivedTree.itemCheck(); |
|
452 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
453 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
454 |
}, |
24719 | 455 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
456 |
{ name: 'access-fannkuch.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
457 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
458 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
459 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
460 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
461 |
return 22; |
24719 | 462 |
}, |
463 |
times: rtimes, |
|
464 |
rerun: function() { |
|
465 |
n = 8; |
|
466 |
ret = fannkuch(n); |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
467 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
468 |
}, |
24719 | 469 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
470 |
{ name: 'math-spectral-norm.js', |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
471 |
actual: function() { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
472 |
var ret = ''; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
473 |
for (var i = 6; i <= 48; i *= 2) { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
474 |
ret += spectralnorm(i) + ','; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
475 |
} |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
476 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
477 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
478 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
479 |
return "1.2657786149754053,1.2727355112619148,1.273989979775574,1.274190125290389,"; |
24719 | 480 |
}, |
481 |
times: rtimes, |
|
482 |
rerun: function() { |
|
483 |
total = 0; |
|
484 |
for (var i = 6; i <= 48; i *= 2) { |
|
485 |
total += spectralnorm(i); |
|
486 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
487 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
488 |
}, |
24719 | 489 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
490 |
{ name: '3d-raytrace.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
491 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
492 |
return hash(testOutput); |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
493 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
494 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
495 |
return 230692593; |
24719 | 496 |
}, |
497 |
times: rtimes, |
|
498 |
rerun: function() { |
|
499 |
testOutput = arrayToCanvasCommands(raytraceScene()); |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
500 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
501 |
}, |
24719 | 502 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
503 |
{ name: 'math-cordic.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
504 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
505 |
return total; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
506 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
507 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
508 |
return 10362.570468755888; |
24719 | 509 |
}, |
510 |
times: rtimes, |
|
511 |
rerun: function() { |
|
512 |
total = 0; |
|
513 |
cordic(25000); |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
514 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
515 |
}, |
24719 | 516 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
517 |
{ name: 'controlflow-recursive.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
518 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
519 |
var ret = 0; |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
520 |
for (var i = 3; i <= 5; i++) { |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
521 |
ret += ack(3,i); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
522 |
ret += fib(17.0+i); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
523 |
ret += tak(3*i+3,2*i+2,i+1); |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
524 |
} |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
525 |
return ret; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
526 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
527 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
528 |
return 57775; |
24719 | 529 |
}, |
530 |
times: rtimes, |
|
531 |
rerun: function() { |
|
532 |
result = 0; |
|
533 |
for (var i = 3; i <= 5; i++) { |
|
534 |
result += ack(3,i); |
|
535 |
result += fib(17.0+i); |
|
536 |
result += tak(3*i+3,2*i+2,i+1); |
|
537 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
538 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
539 |
}, |
24719 | 540 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
541 |
{ name: 'date-format-tofte.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
542 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
543 |
return shortFormat + longFormat; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
544 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
545 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
546 |
return "2008-05-01Thursday, May 01, 2008 6:31:22 PM"; |
24719 | 547 |
}, |
548 |
times: rtimes, |
|
549 |
rerun: function() { |
|
550 |
date = new Date("1/1/2007 1:11:11"); |
|
551 |
for (i = 0; i < 500; ++i) { |
|
552 |
var shortFormat = date.formatDate("Y-m-d"); |
|
553 |
var longFormat = date.formatDate("l, F d, Y g:i:s A"); |
|
554 |
date.setTime(date.getTime() + 84266956); |
|
555 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
556 |
} |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
557 |
}, |
24719 | 558 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
559 |
{ name: 'string-tagcloud.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
560 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
561 |
// The result string embeds floating-point numbers, which can vary a bit on different platforms, |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
562 |
// so we truncate them a bit before comparing. |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
563 |
var tagcloud_norm = tagcloud.replace(/([0-9.]+)px/g, function(str, p1) { return p1.substr(0, 10) + 'px' }) |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
564 |
return tagcloud_norm.length; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
565 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
566 |
expected: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
567 |
return 295906; |
24719 | 568 |
}, |
569 |
times: rtimes, |
|
570 |
rerun: function() { |
|
571 |
tagInfo = tagInfoJSON.parseJSON(function(a, b) { if (a == "popularity") { return Math.log(b) / log2; } else {return b; } }); |
|
572 |
tagcloud = makeTagCloud(tagInfo); |
|
573 |
} |
|
574 |
}, |
|
575 |
||
576 |
{ name: 'math-partial-sums.js', |
|
577 |
actual: function() { |
|
578 |
return total; |
|
579 |
}, |
|
580 |
expected: function() { |
|
581 |
return 60.08994194659945; |
|
582 |
}, |
|
583 |
times: rtimes, |
|
584 |
rerun: function() { |
|
585 |
total = 0; |
|
586 |
for (var i = 1024; i <= 16384; i *= 2) { |
|
587 |
total += partial(i); |
|
588 |
} |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
589 |
} |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
590 |
}, |
24719 | 591 |
|
592 |
{ name: 'access-nsieve.js', |
|
593 |
actual: function() { |
|
594 |
return result; |
|
595 |
}, |
|
596 |
expected: function() { |
|
597 |
return 14302; |
|
598 |
}, |
|
599 |
times: rtimes, |
|
600 |
rerun: function() { |
|
601 |
result = sieve(); |
|
602 |
} |
|
603 |
}, |
|
604 |
||
605 |
{ name: '3d-cube.js', |
|
606 |
times: rtimes, |
|
607 |
rerun: function() { |
|
608 |
Q = new Array(); |
|
609 |
MTrans = new Array(); // transformation matrix |
|
610 |
MQube = new Array(); // position information of qube |
|
611 |
I = new Array(); // entity matrix |
|
612 |
Origin = new Object(); |
|
613 |
Testing = new Object(); |
|
614 |
for ( var i = 20; i <= 160; i *= 2 ) { |
|
615 |
Init(i); |
|
616 |
} |
|
617 |
} |
|
618 |
}, |
|
619 |
||
620 |
//TODO no easy way to sanity check result |
|
621 |
{ name: 'string-fasta.js', |
|
622 |
times: rtimes, |
|
623 |
rerun: function() { |
|
624 |
ret = 0; |
|
625 |
count = 7; |
|
626 |
fastaRepeat(2*count*100000, ALU); |
|
627 |
fastaRandom(3*count*1000, IUB); |
|
628 |
fastaRandom(5*count*1000, HomoSap); |
|
629 |
} |
|
630 |
}, |
|
631 |
||
632 |
//TODO no easy way to sanity check result |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
633 |
{ name: 'string-unpack-code.js', |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
634 |
actual: function() { |
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
635 |
return decompressedMochiKit.length == 106415 && |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
636 |
decompressedMochiKit[2000] == '5' && |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
637 |
decompressedMochiKit[12000] == '_' && |
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
638 |
decompressedMochiKit[82556] == '>'; |
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
639 |
}, |
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
640 |
expected: function() { |
24719 | 641 |
return true; |
642 |
}, |
|
19104
6fe18e748f74
8021321: Two runsunspider tests fail after updating sunspider to 1.0
jlaskey
parents:
17518
diff
changeset
|
643 |
}, |
24719 | 644 |
|
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
645 |
]; |
16147 | 646 |
|
24719 | 647 |
tests.sort(function(a,b) { return a.name.localeCompare(b.name); }); |
648 |
if (typeof single !== 'undefined') { |
|
649 |
for (i in tests) { |
|
650 |
if (tests[i].name === single) { |
|
651 |
singleTest = tests[i]; |
|
652 |
tests = [singleTest]; |
|
653 |
break; |
|
654 |
} |
|
655 |
} |
|
656 |
if (tests.length != 1) { |
|
657 |
throw "unknown single test '" + single + "'"; |
|
658 |
} |
|
659 |
} |
|
660 |
||
661 |
||
16147 | 662 |
// handle the case this script may be run by a JS engine that doesn't |
663 |
// support __DIR__ global variable. |
|
664 |
||
16164
1899aada11f8
8005971: runsunspider.js should check results of benchmarks
lagergren
parents:
16163
diff
changeset
|
665 |
runsuite(tests); |
16147 | 666 |
|
24719 | 667 |
pprint('\n' + runs + "/" + tests.length + " tests were successfully run in " + total_time + " ms "); |
16147 | 668 |
|
669 |
print("Sunspider finished!"); |