js/src/tests/test262/ch09/9.6/S9.6_A2.1.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:7a3ab7c4b502
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /**
5 * ToUint32 returns values between 0 and 2^32-1
6 *
7 * @path ch09/9.6/S9.6_A2.1.js
8 * @description Converting numbers, which are in\outside of Uint32 scopes, with >>>0 operator
9 */
10
11 // CHECK#1
12 if ((0 >>> 0) !== 0) {
13 $ERROR('#1: (0 >>> 0) === 0. Actual: ' + ((0 >>> 0)));
14 }
15
16 // CHECK#2
17 if ((1 >>> 0) !== 1) {
18 $ERROR('#2: (1 >>> 0) === 1. Actual: ' + ((1 >>> 0)));
19 }
20
21 // CHECK#3
22 if ((-1 >>> 0) !== 4294967295) {
23 $ERROR('#3: (-1 >>> 0) === 4294967295. Actual: ' + ((-1 >>> 0)));
24 }
25
26 // CHECK#4
27 if ((4294967295 >>> 0) !== 4294967295) {
28 $ERROR('#4: (4294967295 >>> 0) === 4294967295. Actual: ' + ((4294967295 >>> 0)));
29 }
30
31 // CHECK#5
32 if ((4294967294 >>> 0) !== 4294967294) {
33 $ERROR('#5: (4294967294 >>> 0) === 4294967294. Actual: ' + ((4294967294 >>> 0)));
34 }
35
36 // CHECK#6
37 if ((4294967296 >>> 0) !== 0) {
38 $ERROR('#6: (4294967296 >>> 0) === 0. Actual: ' + ((4294967296 >>> 0)));
39 }
40

mercurial