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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma/LexicalConventions/7.7.3-1.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,164 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +/**
    1.11 +   File Name:          7.7.3-1.js
    1.12 +   ECMA Section:       7.7.3 Numeric Literals
    1.13 +
    1.14 +   Description:        A numeric literal stands for a value of the Number type
    1.15 +   This value is determined in two steps:  first a
    1.16 +   mathematical value (MV) is derived from the literal;
    1.17 +   second, this mathematical value is rounded, ideally
    1.18 +   using IEEE 754 round-to-nearest mode, to a reprentable
    1.19 +   value of of the number type.
    1.20 +
    1.21 +   These test cases came from Waldemar.
    1.22 +
    1.23 +   Author:             christine@netscape.com
    1.24 +   Date:               12 June 1998
    1.25 +*/
    1.26 +
    1.27 +var SECTION = "7.7.3-1";
    1.28 +var VERSION = "ECMA_1";
    1.29 +var TITLE   = "Numeric Literals";
    1.30 +var BUGNUMBER="122877";
    1.31 +
    1.32 +startTest();
    1.33 +
    1.34 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.35 +
    1.36 +new TestCase( SECTION,
    1.37 +	      "0x12345678",
    1.38 +	      305419896,
    1.39 +	      0x12345678 );
    1.40 +
    1.41 +new TestCase( SECTION,
    1.42 +	      "0x80000000",
    1.43 +	      2147483648,
    1.44 +	      0x80000000 );
    1.45 +
    1.46 +new TestCase( SECTION,
    1.47 +	      "0xffffffff",
    1.48 +	      4294967295,
    1.49 +	      0xffffffff );
    1.50 +
    1.51 +new TestCase( SECTION,
    1.52 +	      "0x100000000",
    1.53 +	      4294967296,
    1.54 +	      0x100000000 );
    1.55 +
    1.56 +new TestCase( SECTION,
    1.57 +	      "077777777777777777",
    1.58 +	      2251799813685247,
    1.59 +	      077777777777777777 );
    1.60 +
    1.61 +new TestCase( SECTION,
    1.62 +	      "077777777777777776",
    1.63 +	      2251799813685246,
    1.64 +	      077777777777777776 );
    1.65 +
    1.66 +new TestCase( SECTION,
    1.67 +	      "0x1fffffffffffff",
    1.68 +	      9007199254740991,
    1.69 +	      0x1fffffffffffff );
    1.70 +
    1.71 +new TestCase( SECTION,
    1.72 +	      "0x20000000000000",
    1.73 +	      9007199254740992,
    1.74 +	      0x20000000000000 );
    1.75 +
    1.76 +new TestCase( SECTION,
    1.77 +	      "0x20123456789abc",
    1.78 +	      9027215253084860,
    1.79 +	      0x20123456789abc );
    1.80 +
    1.81 +new TestCase( SECTION,
    1.82 +	      "0x20123456789abd",
    1.83 +	      9027215253084860,
    1.84 +	      0x20123456789abd );
    1.85 +
    1.86 +new TestCase( SECTION,
    1.87 +	      "0x20123456789abe",
    1.88 +	      9027215253084862,
    1.89 +	      0x20123456789abe );
    1.90 +
    1.91 +new TestCase( SECTION,
    1.92 +	      "0x20123456789abf",
    1.93 +	      9027215253084864,
    1.94 +	      0x20123456789abf );
    1.95 +
    1.96 +new TestCase( SECTION,
    1.97 +	      "0x1000000000000080",
    1.98 +	      1152921504606847000,
    1.99 +	      0x1000000000000080 );
   1.100 +
   1.101 +new TestCase( SECTION,
   1.102 +	      "0x1000000000000081",
   1.103 +	      1152921504606847200,
   1.104 +	      0x1000000000000081 );
   1.105 +
   1.106 +new TestCase( SECTION,
   1.107 +	      "0x1000000000000100",
   1.108 +	      1152921504606847200,
   1.109 +	      0x1000000000000100 );
   1.110 +
   1.111 +new TestCase( SECTION,
   1.112 +	      "0x100000000000017f",
   1.113 +	      1152921504606847200,
   1.114 +	      0x100000000000017f );
   1.115 +
   1.116 +new TestCase( SECTION,
   1.117 +	      "0x1000000000000180",
   1.118 +	      1152921504606847500,
   1.119 +	      0x1000000000000180 );
   1.120 +
   1.121 +new TestCase( SECTION,
   1.122 +	      "0x1000000000000181",
   1.123 +	      1152921504606847500,
   1.124 +	      0x1000000000000181 );
   1.125 +
   1.126 +new TestCase( SECTION,
   1.127 +	      "0x10000000000001f0",
   1.128 +	      1152921504606847500,
   1.129 +	      0x10000000000001f0 );
   1.130 +
   1.131 +new TestCase( SECTION,
   1.132 +	      "0x1000000000000200",
   1.133 +	      1152921504606847500,
   1.134 +	      0x1000000000000200 );
   1.135 +
   1.136 +new TestCase( SECTION,
   1.137 +	      "0x100000000000027f",
   1.138 +	      1152921504606847500,
   1.139 +	      0x100000000000027f );
   1.140 +
   1.141 +new TestCase( SECTION,
   1.142 +	      "0x1000000000000280",
   1.143 +	      1152921504606847500,
   1.144 +	      0x1000000000000280 );
   1.145 +
   1.146 +new TestCase( SECTION,
   1.147 +	      "0x1000000000000281",
   1.148 +	      1152921504606847700,
   1.149 +	      0x1000000000000281 );
   1.150 +
   1.151 +new TestCase( SECTION,
   1.152 +	      "0x10000000000002ff",
   1.153 +	      1152921504606847700,
   1.154 +	      0x10000000000002ff );
   1.155 +
   1.156 +new TestCase( SECTION,
   1.157 +	      "0x1000000000000300",
   1.158 +	      1152921504606847700,
   1.159 +	      0x1000000000000300 );
   1.160 +
   1.161 +new TestCase( SECTION,
   1.162 +	      "0x10000000000000000",
   1.163 +	      18446744073709552000,
   1.164 +	      0x10000000000000000 );
   1.165 +
   1.166 +test();
   1.167 +

mercurial