From c9f06933e23335f5caff6b1b0871188e734fb8d6 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 18 May 2008 09:45:52 -0600 Subject: [PATCH] test long addition and subtraction in Misc, as well as multidimensional array creation --- test/Misc.java | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/test/Misc.java b/test/Misc.java index c262c09833..489386a3f5 100644 --- a/test/Misc.java +++ b/test/Misc.java @@ -101,6 +101,8 @@ public class Misc { expect(a >> b == -5 >> 2); expect(a >>> b == -5 >>> 2); expect(a << b == -5 << 2); + expect(a + b == -5 + 2); + expect(a - b == -5 - 2); expect(a * b == -5 * 2); expect(a / b == -5 / 2); expect(a % b == -5 % 2); @@ -115,6 +117,8 @@ public class Misc { expect(a >> b == 5 >> 2); expect(a >>> b == 5 >>> 2); expect(a << b == 5 << 2); + expect(a + b == 5 + 2); + expect(a - b == 5 - 2); expect(a * b == 5 * 2); expect(a / b == 5 / 2); expect(a % b == 5 % 2); @@ -130,6 +134,8 @@ public class Misc { expect(a >> b == -5L >> 2); expect(a >>> b == -5L >>> 2); expect(a << b == -5L << 2); + expect(a + b == -5L + 2L); + expect(a - b == -5L - 2L); expect(a * b == -5L * 2L); expect(a / b == -5L / 2L); expect(a % b == -5L % 2L); @@ -144,6 +150,8 @@ public class Misc { expect(a >> b == 5L >> 2); expect(a >>> b == 5L >>> 2); expect(a << b == 5L << 2); + expect(a + b == 5L + 2L); + expect(a - b == 5L - 2L); expect(a * b == 5L * 2L); expect(a / b == 5L / 2L); expect(a % b == 5L % 2L); @@ -235,14 +243,20 @@ public class Misc { expect(zip() == 47); expect(zup() == 47); - int[] array = new int[0]; - Exception exception = null; - try { - int x = array[0]; - } catch (ArrayIndexOutOfBoundsException e) { - exception = e; + { int[] array = new int[0]; + Exception exception = null; + try { + int x = array[0]; + } catch (ArrayIndexOutOfBoundsException e) { + exception = e; + } + + expect(exception != null); } - expect(exception != null); + { Object[][] array = new Object[1][1]; + expect(array.length == 1); + expect(array[0].length == 1); + } } }