Merge "Fix opcode tests for const-class and filled-new-array" into froyo
diff --git a/tools/vm-tests/src/dot/junit/opcodes/const_class/TestStubs.java b/tools/vm-tests/src/dot/junit/opcodes/const_class/TestStubs.java
index 2a096b7..3897d2f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/const_class/TestStubs.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/const_class/TestStubs.java
@@ -16,9 +16,6 @@
package dot.junit.opcodes.const_class;
-public class TestStubs {
- @SuppressWarnings("unused")
- private class TestStub {
- // used by testE2
- }
+//used by testE2
+class TestStubs {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/const_class/Test_const_class.java b/tools/vm-tests/src/dot/junit/opcodes/const_class/Test_const_class.java
index e481ec6..93f5ee4 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/const_class/Test_const_class.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/const_class/Test_const_class.java
@@ -61,16 +61,14 @@
* @title Class is not accessible
*/
public void testE2() {
- //@uses dot.junit.opcodes.const_class.TestStubs$TestStub
+ //@uses dot.junit.opcodes.const_class.TestStubs
//@uses dot.junit.opcodes.const_class.d.T_const_class_7
try {
T_const_class_7 t = new T_const_class_7();
t.run();
- fail("expected a verification exception");
+ fail("expected an IllegalAccessError exception");
} catch (IllegalAccessError e) {
// expected
- } catch(VerifyError e) {
- // expected
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/const_class/d/T_const_class_7.d b/tools/vm-tests/src/dot/junit/opcodes/const_class/d/T_const_class_7.d
index fc04390..20d9749 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/const_class/d/T_const_class_7.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/const_class/d/T_const_class_7.d
@@ -27,7 +27,7 @@
.method public run()Ljava/lang/Class;
.limit regs 255
- const-class v254, dot/junit/opcodes/const_class/TestStubs$TestStub
+ const-class v254, dot/junit/opcodes/const_class/TestStubs
return-object v254
.end method
diff --git a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/TestStubs.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/TestStubs.java
index 8a513a7..344f5c2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/TestStubs.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/TestStubs.java
@@ -16,9 +16,6 @@
package dot.junit.opcodes.filled_new_array;
-public class TestStubs {
- @SuppressWarnings("unused")
- private class TestStub{
- // used by T_filled_new_array_11
- }
+// used by T_filled_new_array_11
+class TestStubs {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/Test_filled_new_array.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/Test_filled_new_array.java
index 4022d68..b17c29b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/Test_filled_new_array.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/Test_filled_new_array.java
@@ -19,8 +19,9 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.filled_new_array.d.T_filled_new_array_1;
+import dot.junit.opcodes.filled_new_array.d.T_filled_new_array_10;
+import dot.junit.opcodes.filled_new_array.d.T_filled_new_array_11;
import dot.junit.opcodes.filled_new_array.d.T_filled_new_array_2;
-import dot.junit.opcodes.filled_new_array.d.T_filled_new_array_9;
public class Test_filled_new_array extends DxTestCase {
/**
@@ -145,11 +146,13 @@
* @title attempt to instantiate array of non-existent class
*/
public void testVFE8() {
+ //@uses dot.junit.opcodes.filled_new_array.d.T_filled_new_array_10
try {
- Class.forName("dot.junit.opcodes.filled_new_array.d.T_filled_new_array_10");
- fail("expected a verification exception");
- } catch(Throwable t) {
- DxUtil.checkVerifyException(t);
+ T_filled_new_array_10 T = new T_filled_new_array_10();
+ T.run();
+ fail("expected a NoClassDefFoundError exception");
+ } catch(NoClassDefFoundError t) {
+ // expected
}
}
@@ -161,10 +164,11 @@
//@uses dot.junit.opcodes.filled_new_array.d.T_filled_new_array_11
//@uses dot.junit.opcodes.filled_new_array.TestStubs
try {
- Class.forName("dot.junit.opcodes.filled_new_array.d.T_filled_new_array_11");
- fail("expected a verification exception");
- } catch(Throwable t) {
- DxUtil.checkVerifyException(t);
+ T_filled_new_array_11 T = new T_filled_new_array_11();
+ T.run();
+ fail("expected a IllegalAccessError exception");
+ } catch(IllegalAccessError t) {
+ // expected
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_10.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_10.java
new file mode 100644
index 0000000..4caf263
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_10.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dot.junit.opcodes.filled_new_array.d;
+
+public class T_filled_new_array_10 {
+ public Object[] run() {
+ return null;
+ }
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.d b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.d
index e9c0775..dca1ca3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.d
@@ -27,7 +27,7 @@
.method public run()[Ljava/lang/Object;
.limit regs 10
const v9, 0
- filled-new-array {v9}, [Ldot/junit/opcodes/filled_new_array/TestStubs$TestStub;
+ filled-new-array {v9}, [Ldot/junit/opcodes/filled_new_array/TestStubs;
move-result-object v0
return-object v0
.end method
diff --git a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.java
new file mode 100644
index 0000000..f25d58f
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dot.junit.opcodes.filled_new_array.d;
+
+public class T_filled_new_array_11 {
+ public Object[] run() {
+ return null;
+ }
+}