Skip to content

Commit 94a6ad4

Browse files
committed
Add test for NegativeArraySizeException
The new test is similar to NegativeArraySizeException1 (was called NegativeArraySizeException before the previous commit). It checks that a NegativeArraySizeException is correctly caught if the catch block specifies one of its superclasses.
1 parent 9cc3192 commit 94a6ad4

7 files changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public class NegativeArraySizeExceptionTest {
2+
public static void main(String args[]) {
3+
try {
4+
int a[]=new int[-1];
5+
}
6+
catch (Exception exc) {
7+
assert false;
8+
}
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package java.lang;
2+
3+
public class NegativeArraySizeException extends RuntimeException {
4+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package java.lang;
2+
3+
public class RuntimeException extends Exception {
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
NegativeArraySizeExceptionTest.class
3+
--java-throw-runtime-exceptions
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^.*assertion at file NegativeArraySizeExceptionTest.java line 7 function.*: FAILURE$
7+
^VERIFICATION FAILED$
8+
--
9+
^warning: ignoring

0 commit comments

Comments
 (0)