mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
test long addition and subtraction in Misc, as well as multidimensional array creation
This commit is contained in:
parent
b2e25f4e17
commit
c9f06933e2
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user