| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-338653.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 338653; |
| 9 |
var summary = 'Force GC when JSRuntime.gcMallocBytes hits ' + |
| 10 |
'JSRuntime.gcMaxMallocBytes'; |
| 11 |
var actual = 'No Crash'; |
| 12 |
var expect = 'No Crash'; |
| 13 |
|
| 14 |
printBugNumber(BUGNUMBER); |
| 15 |
printStatus (summary); |
| 16 |
print('This test should never fail explicitly. ' + |
| 17 |
'You must view the memory usage during the test. ' + |
| 18 |
'This test fails if the memory usage repeatedly spikes ' + |
| 19 |
'by several hundred megabytes.'); |
| 20 |
|
| 21 |
function dosubst() |
| 22 |
{ |
| 23 |
var f = '0x'; |
| 24 |
var s = f; |
| 25 |
|
| 26 |
for (var i = 0; i < 18; i++) |
| 27 |
{ |
| 28 |
s += s; |
| 29 |
} |
| 30 |
|
| 31 |
var index = s.indexOf(f); |
| 32 |
while (index != -1 && index < 10000) { |
| 33 |
s = s.substr(0, index) + '1' + s.substr(index + f.length); |
| 34 |
index = s.indexOf(f); |
| 35 |
} |
| 36 |
|
| 37 |
} |
| 38 |
|
| 39 |
dosubst(); |
| 40 |
|
| 41 |
reportCompare(expect, actual, summary); |