js/src/tests/ecma/Math/15.8.2.14.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma/Math/15.8.2.14.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     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:          15.8.2.14.js
    1.12 +   ECMA Section:       15.8.2.14 Math.random()
    1.13 +   returns a number value x with a positive sign
    1.14 +   with 1 > x >= 0 with approximately uniform
    1.15 +   distribution over that range, using an
    1.16 +   implementation-dependent algorithm or strategy.
    1.17 +   This function takes no arguments.
    1.18 +
    1.19 +   Description:
    1.20 +   Author:             christine@netscape.com
    1.21 +   Date:               16 september 1997
    1.22 +*/
    1.23 +
    1.24 +var SECTION = "15.8.2.14";
    1.25 +var VERSION = "ECMA_1";
    1.26 +startTest();
    1.27 +var TITLE   = "Math.random()";
    1.28 +
    1.29 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.30 +
    1.31 +for ( var item = 0; item < 100; item++ ) {
    1.32 +  var testcase = new TestCase( SECTION, 
    1.33 +			       "Math.random()",   
    1.34 +			       "pass",   
    1.35 +			       null );
    1.36 +  testcase.reason = Math.random();
    1.37 +  testcase.actual = "pass";
    1.38 +
    1.39 +  if ( ! ( testcase.reason >= 0) ) {
    1.40 +    testcase.actual = "fail";
    1.41 +  }
    1.42 +
    1.43 +  if ( ! (testcase.reason < 1) ) {
    1.44 +    testcase.actual = "fail";
    1.45 +  }
    1.46 +}
    1.47 +
    1.48 +test();

mercurial