]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma/LexicalConventions/7.7.3-1.js
1 /* The contents of this file are subject to the Netscape Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/NPL/
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
11 * The Original Code is Mozilla Communicator client code, released March
14 * The Initial Developer of the Original Code is Netscape Communications
15 * Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
24 ECMA Section: 7.7.3 Numeric Literals
26 Description: A numeric literal stands for a value of the Number type
27 This value is determined in two steps: first a
28 mathematical value (MV) is derived from the literal;
29 second, this mathematical value is rounded, ideally
30 using IEEE 754 round-to-nearest mode, to a reprentable
31 value of of the number type.
33 These test cases came from Waldemar.
35 Author: christine@netscape.com
39 var SECTION
= "7.7.3-1";
40 var VERSION
= "ECMA_1";
42 var TITLE
= "Numeric Literals";
43 var BUGNUMBER
="122877";
45 writeHeaderToLog( SECTION
+ " "+ TITLE
);
47 var testcases
= new Array();
50 testcases
[tc
++] = new TestCase( SECTION
,
55 testcases
[tc
++] = new TestCase( SECTION
,
60 testcases
[tc
++] = new TestCase( SECTION
,
65 testcases
[tc
++] = new TestCase( SECTION
,
70 testcases
[tc
++] = new TestCase( SECTION
,
75 testcases
[tc
++] = new TestCase( SECTION
,
80 testcases
[tc
++] = new TestCase( SECTION
,
85 testcases
[tc
++] = new TestCase( SECTION
,
90 testcases
[tc
++] = new TestCase( SECTION
,
95 testcases
[tc
++] = new TestCase( SECTION
,
100 testcases
[tc
++] = new TestCase( SECTION
,
105 testcases
[tc
++] = new TestCase( SECTION
,
110 testcases
[tc
++] = new TestCase( SECTION
,
111 "0x1000000000000080",
113 0x1000000000000080 );
115 testcases
[tc
++] = new TestCase( SECTION
,
116 "0x1000000000000081",
118 0x1000000000000081 );
120 testcases
[tc
++] = new TestCase( SECTION
,
121 "0x1000000000000100",
123 0x1000000000000100 );
125 testcases
[tc
++] = new TestCase( SECTION
,
126 "0x100000000000017f",
128 0x100000000000017f );
130 testcases
[tc
++] = new TestCase( SECTION
,
131 "0x1000000000000180",
133 0x1000000000000180 );
135 testcases
[tc
++] = new TestCase( SECTION
,
136 "0x1000000000000181",
138 0x1000000000000181 );
140 testcases
[tc
++] = new TestCase( SECTION
,
141 "0x10000000000001f0",
143 0x10000000000001f0 );
145 testcases
[tc
++] = new TestCase( SECTION
,
146 "0x1000000000000200",
148 0x1000000000000200 );
150 testcases
[tc
++] = new TestCase( SECTION
,
151 "0x100000000000027f",
153 0x100000000000027f );
155 testcases
[tc
++] = new TestCase( SECTION
,
156 "0x1000000000000280",
158 0x1000000000000280 );
160 testcases
[tc
++] = new TestCase( SECTION
,
161 "0x1000000000000281",
163 0x1000000000000281 );
165 testcases
[tc
++] = new TestCase( SECTION
,
166 "0x10000000000002ff",
168 0x10000000000002ff );
170 testcases
[tc
++] = new TestCase( SECTION
,
171 "0x1000000000000300",
173 0x1000000000000300 );
175 testcases
[tc
++] = new TestCase( SECTION
,
176 "0x10000000000000000",
177 18446744073709552000,
178 0x10000000000000000 );
183 for ( tc
=0; tc
< testcases
.length
; tc
++ ) {
184 testcases
[tc
].actual
= testcases
[tc
].actual
;
186 testcases
[tc
].passed
= writeTestCaseResult(
187 testcases
[tc
].expect
,
188 testcases
[tc
].actual
,
189 testcases
[tc
].description
+" = "+ testcases
[tc
].actual
);
191 testcases
[tc
].reason
+= ( testcases
[tc
].passed
) ? "" : "wrong value ";
196 return ( testcases
);