|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 /* |
|
7 * |
|
8 * Date: 28 April 2003 |
|
9 * SUMMARY: Testing the ternary query operator |
|
10 * |
|
11 * See http://bugzilla.mozilla.org/show_bug.cgi?id=203402 |
|
12 * |
|
13 */ |
|
14 //----------------------------------------------------------------------------- |
|
15 var UBound = 0; |
|
16 var BUGNUMBER = 203402; |
|
17 var summary = 'Testing the ternary query operator'; |
|
18 var status = ''; |
|
19 var statusitems = []; |
|
20 var actual = ''; |
|
21 var actualvalues = []; |
|
22 var expect= ''; |
|
23 var expectedvalues = []; |
|
24 |
|
25 |
|
26 // This used to crash the Rhino optimized shell - |
|
27 status = inSection(1); |
|
28 actual = "" + (1==0) ? "" : ""; |
|
29 expect = ""; |
|
30 addThis(); |
|
31 |
|
32 |
|
33 |
|
34 //----------------------------------------------------------------------------- |
|
35 test(); |
|
36 //----------------------------------------------------------------------------- |
|
37 |
|
38 |
|
39 |
|
40 function addThis() |
|
41 { |
|
42 statusitems[UBound] = status; |
|
43 actualvalues[UBound] = actual; |
|
44 expectedvalues[UBound] = expect; |
|
45 UBound++; |
|
46 } |
|
47 |
|
48 |
|
49 function test() |
|
50 { |
|
51 enterFunc('test'); |
|
52 printBugNumber(BUGNUMBER); |
|
53 printStatus(summary); |
|
54 |
|
55 for (var i=0; i<UBound; i++) |
|
56 { |
|
57 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); |
|
58 } |
|
59 |
|
60 exitFunc ('test'); |
|
61 } |