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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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/. */
     7 /**
     8    File Name:          7.7.3-1.js
     9    ECMA Section:       7.7.3 Numeric Literals
    11    Description:        A numeric literal stands for a value of the Number type
    12    This value is determined in two steps:  first a
    13    mathematical value (MV) is derived from the literal;
    14    second, this mathematical value is rounded, ideally
    15    using IEEE 754 round-to-nearest mode, to a reprentable
    16    value of of the number type.
    18    These test cases came from Waldemar.
    20    Author:             christine@netscape.com
    21    Date:               12 June 1998
    22 */
    24 var SECTION = "7.7.3-1";
    25 var VERSION = "ECMA_1";
    26 var TITLE   = "Numeric Literals";
    27 var BUGNUMBER="122877";
    29 startTest();
    31 writeHeaderToLog( SECTION + " "+ TITLE);
    33 new TestCase( SECTION,
    34 	      "0x12345678",
    35 	      305419896,
    36 	      0x12345678 );
    38 new TestCase( SECTION,
    39 	      "0x80000000",
    40 	      2147483648,
    41 	      0x80000000 );
    43 new TestCase( SECTION,
    44 	      "0xffffffff",
    45 	      4294967295,
    46 	      0xffffffff );
    48 new TestCase( SECTION,
    49 	      "0x100000000",
    50 	      4294967296,
    51 	      0x100000000 );
    53 new TestCase( SECTION,
    54 	      "077777777777777777",
    55 	      2251799813685247,
    56 	      077777777777777777 );
    58 new TestCase( SECTION,
    59 	      "077777777777777776",
    60 	      2251799813685246,
    61 	      077777777777777776 );
    63 new TestCase( SECTION,
    64 	      "0x1fffffffffffff",
    65 	      9007199254740991,
    66 	      0x1fffffffffffff );
    68 new TestCase( SECTION,
    69 	      "0x20000000000000",
    70 	      9007199254740992,
    71 	      0x20000000000000 );
    73 new TestCase( SECTION,
    74 	      "0x20123456789abc",
    75 	      9027215253084860,
    76 	      0x20123456789abc );
    78 new TestCase( SECTION,
    79 	      "0x20123456789abd",
    80 	      9027215253084860,
    81 	      0x20123456789abd );
    83 new TestCase( SECTION,
    84 	      "0x20123456789abe",
    85 	      9027215253084862,
    86 	      0x20123456789abe );
    88 new TestCase( SECTION,
    89 	      "0x20123456789abf",
    90 	      9027215253084864,
    91 	      0x20123456789abf );
    93 new TestCase( SECTION,
    94 	      "0x1000000000000080",
    95 	      1152921504606847000,
    96 	      0x1000000000000080 );
    98 new TestCase( SECTION,
    99 	      "0x1000000000000081",
   100 	      1152921504606847200,
   101 	      0x1000000000000081 );
   103 new TestCase( SECTION,
   104 	      "0x1000000000000100",
   105 	      1152921504606847200,
   106 	      0x1000000000000100 );
   108 new TestCase( SECTION,
   109 	      "0x100000000000017f",
   110 	      1152921504606847200,
   111 	      0x100000000000017f );
   113 new TestCase( SECTION,
   114 	      "0x1000000000000180",
   115 	      1152921504606847500,
   116 	      0x1000000000000180 );
   118 new TestCase( SECTION,
   119 	      "0x1000000000000181",
   120 	      1152921504606847500,
   121 	      0x1000000000000181 );
   123 new TestCase( SECTION,
   124 	      "0x10000000000001f0",
   125 	      1152921504606847500,
   126 	      0x10000000000001f0 );
   128 new TestCase( SECTION,
   129 	      "0x1000000000000200",
   130 	      1152921504606847500,
   131 	      0x1000000000000200 );
   133 new TestCase( SECTION,
   134 	      "0x100000000000027f",
   135 	      1152921504606847500,
   136 	      0x100000000000027f );
   138 new TestCase( SECTION,
   139 	      "0x1000000000000280",
   140 	      1152921504606847500,
   141 	      0x1000000000000280 );
   143 new TestCase( SECTION,
   144 	      "0x1000000000000281",
   145 	      1152921504606847700,
   146 	      0x1000000000000281 );
   148 new TestCase( SECTION,
   149 	      "0x10000000000002ff",
   150 	      1152921504606847700,
   151 	      0x10000000000002ff );
   153 new TestCase( SECTION,
   154 	      "0x1000000000000300",
   155 	      1152921504606847700,
   156 	      0x1000000000000300 );
   158 new TestCase( SECTION,
   159 	      "0x10000000000000000",
   160 	      18446744073709552000,
   161 	      0x10000000000000000 );
   163 test();

mercurial