Bug 469739 - Add support for displaying Vista UAC shield icon; r=joe sr=vladimir
[wine-gecko.git] / js / tests / js1_5 / Array / regress-107138.js
blobe1ca691bc3f656ed1f752e315a109cff21bdb4cb
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
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/
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.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * morse@netscape.com, pschwartau@netscape.com
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.
37 * ***** END LICENSE BLOCK ***** */
40 * Date: 29 October 2001
42 * SUMMARY: Regression test for bug 107138
43 * See http://bugzilla.mozilla.org/show_bug.cgi?id=107138
45 * The bug: arr['1'] == undefined instead of arr['1'] == 'one'.
46 * The bug was intermittent and did not always occur...
48 * The cnSTRESS constant defines how many times to repeat this test.
50 //-----------------------------------------------------------------------------
51 var gTestfile = 'regress-107138.js';
52 var UBound = 0;
53 var cnSTRESS = 10;
54 var cnDASH = '-';
55 var BUGNUMBER = 107138;
56 var summary = 'Regression test for bug 107138';
57 var status = '';
58 var statusitems = [];
59 var actual = '';
60 var actualvalues = [];
61 var expect= '';
62 var expectedvalues = [];
65 var arr = ['zero', 'one', 'two', 'three', 'four', 'five',
66 'six', 'seven', 'eight', 'nine', 'ten'];
69 // This bug was intermittent. Stress-test it.
70 for (var j=0; j<cnSTRESS; j++)
72 status = inSection(j + cnDASH + 1);
73 actual = arr[0];
74 expect = 'zero';
75 addThis();
77 status = inSection(j + cnDASH + 2);
78 actual = arr['0'];
79 expect = 'zero';
80 addThis();
82 status = inSection(j + cnDASH + 3);
83 actual = arr[1];
84 expect = 'one';
85 addThis();
87 status = inSection(j + cnDASH + 4);
88 actual = arr['1'];
89 expect = 'one';
90 addThis();
92 status = inSection(j + cnDASH + 5);
93 actual = arr[2];
94 expect = 'two';
95 addThis();
97 status = inSection(j + cnDASH + 6);
98 actual = arr['2'];
99 expect = 'two';
100 addThis();
102 status = inSection(j + cnDASH + 7);
103 actual = arr[3];
104 expect = 'three';
105 addThis();
107 status = inSection(j + cnDASH + 8);
108 actual = arr['3'];
109 expect = 'three';
110 addThis();
112 status = inSection(j + cnDASH + 9);
113 actual = arr[4];
114 expect = 'four';
115 addThis();
117 status = inSection(j + cnDASH + 10);
118 actual = arr['4'];
119 expect = 'four';
120 addThis();
122 status = inSection(j + cnDASH + 11);
123 actual = arr[5];
124 expect = 'five';
125 addThis();
127 status = inSection(j + cnDASH + 12);
128 actual = arr['5'];
129 expect = 'five';
130 addThis();
132 status = inSection(j + cnDASH + 13);
133 actual = arr[6];
134 expect = 'six';
135 addThis();
137 status = inSection(j + cnDASH + 14);
138 actual = arr['6'];
139 expect = 'six';
140 addThis();
142 status = inSection(j + cnDASH + 15);
143 actual = arr[7];
144 expect = 'seven';
145 addThis();
147 status = inSection(j + cnDASH + 16);
148 actual = arr['7'];
149 expect = 'seven';
150 addThis();
152 status = inSection(j + cnDASH + 17);
153 actual = arr[8];
154 expect = 'eight';
155 addThis();
157 status = inSection(j + cnDASH + 18);
158 actual = arr['8'];
159 expect = 'eight';
160 addThis();
162 status = inSection(j + cnDASH + 19);
163 actual = arr[9];
164 expect = 'nine';
165 addThis();
167 status = inSection(j + cnDASH + 20);
168 actual = arr['9'];
169 expect = 'nine';
170 addThis();
172 status = inSection(j + cnDASH + 21);
173 actual = arr[10];
174 expect = 'ten';
175 addThis();
177 status = inSection(j + cnDASH + 22);
178 actual = arr['10'];
179 expect = 'ten';
180 addThis();
184 //-----------------------------------------------------------------------------
185 test();
186 //-----------------------------------------------------------------------------
190 function addThis()
192 statusitems[UBound] = status;
193 actualvalues[UBound] = actual;
194 expectedvalues[UBound] = expect;
195 UBound++;
199 function test()
201 enterFunc ('test');
202 printBugNumber(BUGNUMBER);
203 printStatus (summary);
205 for (var i=0; i<UBound; i++)
207 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
210 exitFunc ('test');