Skip to content

Commit

Permalink
Add test for ArrayIndexOutOfBoundsException
Browse files Browse the repository at this point in the history
The new test is similar to ArrayIndexOutOfBoundsException1. It checks
that an ArrayIndexOutOfBoundsException is correctly caught if the catch
block specifies one of its superclasses.
  • Loading branch information
antlechner committed Dec 5, 2017
1 parent 379e415 commit 200017a
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class ArrayIndexOutOfBoundsExceptionTest {
public static void main(String args[]) {
try {
int[] a=new int[4];
a[4]=0;
}
catch (Exception exc) {
assert false;
}
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package java.lang;

public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package java.lang;

public class IndexOutOfBoundsException extends RuntimeException {
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package java.lang;

public class RuntimeException extends Exception {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
ArrayIndexOutOfBoundsExceptionTest.class
--java-throw-runtime-exceptions
^EXIT=10$
^SIGNAL=0$
^.*assertion at file ArrayIndexOutOfBoundsExceptionTest.java line 8 function.*: FAILURE$
^VERIFICATION FAILED$
--
^warning: ignoring

0 comments on commit 200017a

Please sign in to comment.