summaryrefslogtreecommitdiffstats
path: root/test/412-new-array
diff options
context:
space:
mode:
authorMingyao Yang <mingyao@google.com>2015-03-31 15:09:29 -0700
committerMingyao Yang <mingyao@google.com>2015-04-01 15:00:47 -0700
commit0c365e674545159fd77b998081207f0685a605e5 (patch)
tree038e68e264ee0a25f898cbf313140d793bab4708 /test/412-new-array
parenta109632b240f3c9355ca95500f6f48e4478e3c51 (diff)
downloadart-0c365e674545159fd77b998081207f0685a605e5.zip
art-0c365e674545159fd77b998081207f0685a605e5.tar.gz
art-0c365e674545159fd77b998081207f0685a605e5.tar.bz2
CanThrow() of HNewArray should return true.
Change-Id: I9950f1c391dfeb26cf59cee769705d01d8e283d5
Diffstat (limited to 'test/412-new-array')
-rw-r--r--test/412-new-array/src/Main.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/412-new-array/src/Main.java b/test/412-new-array/src/Main.java
index 168420c..e4669b8 100644
--- a/test/412-new-array/src/Main.java
+++ b/test/412-new-array/src/Main.java
@@ -26,6 +26,7 @@ public class Main extends TestCase {
$opt$TestWithInitializations();
$opt$TestNegativeValueNewByteArray();
$opt$TestNegativeValueNewCharArray();
+ testNegativeArraySize();
testSmaliFilledNewArray();
testSmaliFillArrayData();
testSmaliVerifyError();
@@ -129,6 +130,21 @@ public class Main extends TestCase {
}
}
+ static void testNegativeArraySize() {
+ int i = 0;
+ try {
+ $opt$TestNegativeArraySize();
+ } catch (NegativeArraySizeException e) {
+ i = 1;
+ }
+ assertEquals(i, 1);
+ }
+
+ static int[] $opt$TestNegativeArraySize() {
+ int[] array = new int[-1];
+ return null;
+ }
+
public static void testSmaliFilledNewArray() throws Exception {
Class<?> c = Class.forName("FilledNewArray");