01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.dev.jjs.test;
17:
18: import com.google.gwt.junit.client.GWTTestCase;
19:
20: /**
21: * TODO: document me.
22: */
23: public class NativeLongTest extends GWTTestCase {
24:
25: public String getModuleName() {
26: return "com.google.gwt.dev.jjs.CompilerSuite";
27: }
28:
29: public void testConstants() {
30: assertEquals(0x5DEECE66DL, 0x5DEECE66DL);
31: assertTrue(0x5DEECE66DL > 0L);
32: assertTrue(0L < 0x5DEECE66DL);
33: assertEquals(0xBL, 0xBL);
34: assertTrue(0xBL > 0L);
35: assertTrue(0L < 0xBL);
36: }
37:
38: public void testLogicalAnd() {
39: assertEquals(1L & 0L, 0L);
40: assertEquals(1L & 3L, 1L);
41: }
42:
43: public void testShift() {
44: assertEquals(0x5DEECE66DL, 0x5DEECE66DL & ((1L << 48) - 1));
45: }
46:
47: public void testTripleShift() {
48: assertEquals(1 << 12, (1 << 60) >>> (48));
49: }
50:
51: public void testXor() {
52: assertTrue((255L ^ 0x5DEECE66DL) != 0);
53: }
54:
55: }
|