js/src/tests/ecma/LexicalConventions/7.7.3-1.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6
michael@0 7 /**
michael@0 8 File Name: 7.7.3-1.js
michael@0 9 ECMA Section: 7.7.3 Numeric Literals
michael@0 10
michael@0 11 Description: A numeric literal stands for a value of the Number type
michael@0 12 This value is determined in two steps: first a
michael@0 13 mathematical value (MV) is derived from the literal;
michael@0 14 second, this mathematical value is rounded, ideally
michael@0 15 using IEEE 754 round-to-nearest mode, to a reprentable
michael@0 16 value of of the number type.
michael@0 17
michael@0 18 These test cases came from Waldemar.
michael@0 19
michael@0 20 Author: christine@netscape.com
michael@0 21 Date: 12 June 1998
michael@0 22 */
michael@0 23
michael@0 24 var SECTION = "7.7.3-1";
michael@0 25 var VERSION = "ECMA_1";
michael@0 26 var TITLE = "Numeric Literals";
michael@0 27 var BUGNUMBER="122877";
michael@0 28
michael@0 29 startTest();
michael@0 30
michael@0 31 writeHeaderToLog( SECTION + " "+ TITLE);
michael@0 32
michael@0 33 new TestCase( SECTION,
michael@0 34 "0x12345678",
michael@0 35 305419896,
michael@0 36 0x12345678 );
michael@0 37
michael@0 38 new TestCase( SECTION,
michael@0 39 "0x80000000",
michael@0 40 2147483648,
michael@0 41 0x80000000 );
michael@0 42
michael@0 43 new TestCase( SECTION,
michael@0 44 "0xffffffff",
michael@0 45 4294967295,
michael@0 46 0xffffffff );
michael@0 47
michael@0 48 new TestCase( SECTION,
michael@0 49 "0x100000000",
michael@0 50 4294967296,
michael@0 51 0x100000000 );
michael@0 52
michael@0 53 new TestCase( SECTION,
michael@0 54 "077777777777777777",
michael@0 55 2251799813685247,
michael@0 56 077777777777777777 );
michael@0 57
michael@0 58 new TestCase( SECTION,
michael@0 59 "077777777777777776",
michael@0 60 2251799813685246,
michael@0 61 077777777777777776 );
michael@0 62
michael@0 63 new TestCase( SECTION,
michael@0 64 "0x1fffffffffffff",
michael@0 65 9007199254740991,
michael@0 66 0x1fffffffffffff );
michael@0 67
michael@0 68 new TestCase( SECTION,
michael@0 69 "0x20000000000000",
michael@0 70 9007199254740992,
michael@0 71 0x20000000000000 );
michael@0 72
michael@0 73 new TestCase( SECTION,
michael@0 74 "0x20123456789abc",
michael@0 75 9027215253084860,
michael@0 76 0x20123456789abc );
michael@0 77
michael@0 78 new TestCase( SECTION,
michael@0 79 "0x20123456789abd",
michael@0 80 9027215253084860,
michael@0 81 0x20123456789abd );
michael@0 82
michael@0 83 new TestCase( SECTION,
michael@0 84 "0x20123456789abe",
michael@0 85 9027215253084862,
michael@0 86 0x20123456789abe );
michael@0 87
michael@0 88 new TestCase( SECTION,
michael@0 89 "0x20123456789abf",
michael@0 90 9027215253084864,
michael@0 91 0x20123456789abf );
michael@0 92
michael@0 93 new TestCase( SECTION,
michael@0 94 "0x1000000000000080",
michael@0 95 1152921504606847000,
michael@0 96 0x1000000000000080 );
michael@0 97
michael@0 98 new TestCase( SECTION,
michael@0 99 "0x1000000000000081",
michael@0 100 1152921504606847200,
michael@0 101 0x1000000000000081 );
michael@0 102
michael@0 103 new TestCase( SECTION,
michael@0 104 "0x1000000000000100",
michael@0 105 1152921504606847200,
michael@0 106 0x1000000000000100 );
michael@0 107
michael@0 108 new TestCase( SECTION,
michael@0 109 "0x100000000000017f",
michael@0 110 1152921504606847200,
michael@0 111 0x100000000000017f );
michael@0 112
michael@0 113 new TestCase( SECTION,
michael@0 114 "0x1000000000000180",
michael@0 115 1152921504606847500,
michael@0 116 0x1000000000000180 );
michael@0 117
michael@0 118 new TestCase( SECTION,
michael@0 119 "0x1000000000000181",
michael@0 120 1152921504606847500,
michael@0 121 0x1000000000000181 );
michael@0 122
michael@0 123 new TestCase( SECTION,
michael@0 124 "0x10000000000001f0",
michael@0 125 1152921504606847500,
michael@0 126 0x10000000000001f0 );
michael@0 127
michael@0 128 new TestCase( SECTION,
michael@0 129 "0x1000000000000200",
michael@0 130 1152921504606847500,
michael@0 131 0x1000000000000200 );
michael@0 132
michael@0 133 new TestCase( SECTION,
michael@0 134 "0x100000000000027f",
michael@0 135 1152921504606847500,
michael@0 136 0x100000000000027f );
michael@0 137
michael@0 138 new TestCase( SECTION,
michael@0 139 "0x1000000000000280",
michael@0 140 1152921504606847500,
michael@0 141 0x1000000000000280 );
michael@0 142
michael@0 143 new TestCase( SECTION,
michael@0 144 "0x1000000000000281",
michael@0 145 1152921504606847700,
michael@0 146 0x1000000000000281 );
michael@0 147
michael@0 148 new TestCase( SECTION,
michael@0 149 "0x10000000000002ff",
michael@0 150 1152921504606847700,
michael@0 151 0x10000000000002ff );
michael@0 152
michael@0 153 new TestCase( SECTION,
michael@0 154 "0x1000000000000300",
michael@0 155 1152921504606847700,
michael@0 156 0x1000000000000300 );
michael@0 157
michael@0 158 new TestCase( SECTION,
michael@0 159 "0x10000000000000000",
michael@0 160 18446744073709552000,
michael@0 161 0x10000000000000000 );
michael@0 162
michael@0 163 test();
michael@0 164

mercurial