~ubuntu-branches/ubuntu/saucy/mozjs17/saucy-proposed

« back to all changes in this revision

Viewing changes to js/src/tests/js1_5/GC/regress-338653.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// |reftest| skip -- slow, killed on x86_64
 
2
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
3
/* This Source Code Form is subject to the terms of the Mozilla Public
 
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
6
 
 
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);