diff -r ff57af563cb8 -r 6cad41d877d2 vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java --- a/vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java Thu Feb 07 16:11:53 2013 +0100 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/NumberTest.java Thu Feb 07 17:24:19 2013 +0100 @@ -144,186 +144,6 @@ ); } - @Test public void longShiftL1() throws Exception { - final long res = 0x00fa37d7763e0ca1l << 5; - assertExec("Long << 5", - Numbers.class, "shlL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 5); - } - - @Test public void longShiftL2() throws Exception { - final long res = 0x00fa37d7763e0ca1l << 32; - assertExec("Long << 32", - Numbers.class, "shlL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 32); - } - - @Test public void longShiftL3() throws Exception { - final long res = 0x00fa37d7763e0ca1l << 45; - assertExec("Long << 45", - Numbers.class, "shlL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 45); - } - - @Test public void longShiftR1() throws Exception { - final long res = 0x00fa37d7763e0ca1l >> 5; - assertExec("Long >> 5", - Numbers.class, "shrL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 5); - } - - @Test public void longShiftR2() throws Exception { - final long res = 0x00fa37d7763e0ca1l >> 32; - assertExec("Long >> 32", - Numbers.class, "shrL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 32); - } - - @Test public void longShiftR3() throws Exception { - final long res = 0x00fa37d7763e0ca1l >> 45; - assertExec("Long >> 45", - Numbers.class, "shrL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 45); - } - - @Test public void longUShiftR1() throws Exception { - final long res = 0x00fa37d7763e0ca1l >>> 5; - assertExec("Long >>> 5", - Numbers.class, "ushrL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 5); - } - - @Test public void longUShiftR2() throws Exception { - final long res = 0x00fa37d7763e0ca1l >>> 45; - assertExec("Long >>> 45", - Numbers.class, "ushrL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 45); - } - - @Test public void longUShiftR3() throws Exception { - final long res = 0xf0fa37d7763e0ca1l >>> 5; - assertExec("Long >>> 5", - Numbers.class, "ushrL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0xf0, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 5); - } - - @Test public void longUShiftR4() throws Exception { - final long res = 0xf0fa37d7763e0ca1l >>> 45; - assertExec("Long >>> 45", - Numbers.class, "ushrL__J_3BI", - Double.valueOf(res), - new byte[] { (byte)0xf0, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - 45); - } - - @Test public void longAnd() throws Exception { - final long res = 0x00fa37d7763e0ca1l & 0xa7b3432fff00123el; - assertExec("LOng binary AND", - Numbers.class, "andL__J_3B_3B", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - new byte[] { (byte)0xa7, (byte)0xb3, (byte)0x43, (byte)0x2f, (byte)0xff, (byte)0x00, (byte)0x12, (byte)0x3e } - ); - } - - @Test public void longOr() throws Exception { - final long res = 0x00fa37d7763e0ca1l | 0xa7b3432fff00123el; - assertExec("Long binary OR", - Numbers.class, "orL__J_3B_3B", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - new byte[] { (byte)0xa7, (byte)0xb3, (byte)0x43, (byte)0x2f, (byte)0xff, (byte)0x00, (byte)0x12, (byte)0x3e } - ); - } - - @Test public void longXor1() throws Exception { - final long res = 0x00fa37d7763e0ca1l ^ 0xa7b3432fff00123el; - assertExec("Long binary XOR", - Numbers.class, "xorL__J_3B_3B", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - new byte[] { (byte)0xa7, (byte)0xb3, (byte)0x43, (byte)0x2f, (byte)0xff, (byte)0x00, (byte)0x12, (byte)0x3e } - ); - } - - @Test public void longXor2() throws Exception { - final long res = 0x00fa37d7763e0ca1l ^ 0x00000000ff00123el; - assertExec("Long binary XOR", - Numbers.class, "xorL__J_3B_3B", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0xfa, (byte)0x37, (byte)0xd7, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x12, (byte)0x3e } - ); - } - - @Test public void longXor3() throws Exception { - final long res = 0x00000000763e0ca1l ^ 0x00000000ff00123el; - assertExec("Long binary XOR", - Numbers.class, "xorL__J_3B_3B", - Double.valueOf(res), - new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x76, (byte)0x3e, (byte)0x0c, (byte)0xa1 }, - new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x12, (byte)0x3e } - ); - } - - @Test public void longCompareSameNumbers() throws Exception { - assertExec("Long compare same numbers", - Numbers.class, "compareL__I_3B_3BI", - 0.0, - new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }, - new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }, - 0 - ); - } - - @Test public void longComparePositiveNumbers() throws Exception { - assertExec("Long compare positive numbers", - Numbers.class, "compareL__I_3B_3BI", - -1.0, - new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x20, (byte)0x00, (byte)0x00 }, - new byte[] { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x10, (byte)0x00, (byte)0x00, (byte)0x00 }, - 0 - ); - } - - @Test public void longCompareNegativeNumbers() throws Exception { - assertExec("Long compare negative numbers", - Numbers.class, "compareL__I_3B_3BI", - 1.0, - new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, - new byte[] { (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }, - 0 - ); - } - - @Test public void longCompareMixedNumbers() throws Exception { - assertExec("Long compare mixed numbers", - Numbers.class, "compareL__I_3B_3BI", - -1.0, - new byte[] { (byte)0x80, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 }, - new byte[] { (byte)0x7f, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff }, - 0 - ); - } - private static CharSequence codeSeq; private static Invocable code;