am a2bcf4b2: Merge "Fix opcode tests for sput_char" into froyo
* commit 'a2bcf4b27b84e18df5f5c1d9787ca5fb39b5c9f1':
Fix opcode tests for sput_char
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_char/Test_sput_char.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/Test_sput_char.java
index 92ec064..120b45a 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sput_char/Test_sput_char.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/Test_sput_char.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.sput_char.d.T_sput_char_1;
+import dot.junit.opcodes.sput_char.d.T_sput_char_10;
import dot.junit.opcodes.sput_char.d.T_sput_char_11;
import dot.junit.opcodes.sput_char.d.T_sput_char_12;
import dot.junit.opcodes.sput_char.d.T_sput_char_13;
import dot.junit.opcodes.sput_char.d.T_sput_char_14;
+import dot.junit.opcodes.sput_char.d.T_sput_char_15;
+import dot.junit.opcodes.sput_char.d.T_sput_char_17;
+import dot.junit.opcodes.sput_char.d.T_sput_char_7;
+import dot.junit.opcodes.sput_char.d.T_sput_char_8;
+import dot.junit.opcodes.sput_char.d.T_sput_char_9;
public class Test_sput_char extends DxTestCase {
/**
@@ -35,7 +41,7 @@
assertEquals(77, T_sput_char_1.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -57,7 +63,7 @@
t.run();
assertEquals(77, T_sput_char_14.getProtectedField());
}
-
+
/**
* @title initialization of referenced class throws exception
@@ -73,7 +79,7 @@
}
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -86,8 +92,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -101,23 +107,22 @@
/**
- *
- * @constraint B13
- * @title put char into long field - only field with same name but
+ *
+ * @constraint B13
+ * @title put char into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sput_char.d.T_sput_char_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_char_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
- *
- * @constraint B13
+ *
+ * @constraint B13
* @title put value '66000' into byte field
*/
public void testVFE6() {
@@ -130,9 +135,9 @@
}
/**
- *
- * @constraint B13
- * @title type of field doesn't match opcode - attempt to modify double
+ *
+ * @constraint B13
+ * @title type of field doesn't match opcode - attempt to modify double
* field with single-width register
*/
public void testVFE7() {
@@ -143,87 +148,77 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint A12
- * @title Attempt to set non-static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ *
+ * @constraint A12
+ * @title Attempt to set non-static field.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.sput_char.d.T_sput_char_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_char_7().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to modify inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify inaccessible field.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.sput_char.TestStubs
//@uses dot.junit.opcodes.sput_char.d.T_sput_char_8
try {
- Class.forName("dot.junit.opcodes.sput_char.d.T_sput_char_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_char_8().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to modify field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify field of undefined class.
*/
public void testVFE10() {
try {
- Class.forName("dot.junit.opcodes.sput_char.d.T_sput_char_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_char_9().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to modify undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify undefined field.
*/
public void testVFE11() {
try {
- Class.forName("dot.junit.opcodes.sput_char.d.T_sput_char_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_char_10().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
-
-
+
+
+
/**
* @constraint n/a
- * @title Attempt to modify superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify superclass' private field from subclass.
*/
public void testVFE12() {
//@uses dot.junit.opcodes.sput_char.d.T_sput_char_1
//@uses dot.junit.opcodes.sput_char.d.T_sput_char_15
try {
- Class.forName("dot.junit.opcodes.sput_char.d.T_sput_char_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_char_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title sput-char shall not work for wide numbers
*/
public void testVFE13() {
@@ -234,10 +229,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-char shall not work for reference fields
*/
public void testVFE14() {
@@ -248,10 +243,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-char shall not work for short fields
*/
public void testVFE15() {
@@ -262,10 +257,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-char shall not work for int fields
*/
public void testVFE16() {
@@ -276,10 +271,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-char shall not work for byte fields
*/
public void testVFE17() {
@@ -290,10 +285,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-char shall not work for boolean fields
*/
public void testVFE18() {
@@ -313,10 +308,9 @@
//@uses dot.junit.opcodes.sput_char.TestStubs
//@uses dot.junit.opcodes.sput_char.d.T_sput_char_11
try {
- Class.forName("dot.junit.opcodes.sput_char.d.T_sput_char_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_char_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_10.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_10.java
new file mode 100644
index 0000000..10f88f3
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_10.java
@@ -0,0 +1,22 @@
+/*
+ * 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.sput_char.d;
+
+public class T_sput_char_10 {
+ public void run() {
+ }
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_15.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_15.java
new file mode 100644
index 0000000..2b4d7d2
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_15.java
@@ -0,0 +1,22 @@
+/*
+ * 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.sput_char.d;
+
+public class T_sput_char_15 {
+ public void run() {
+ }
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_17.java
new file mode 100644
index 0000000..349eaa2
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_17.java
@@ -0,0 +1,22 @@
+/*
+ * 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.sput_char.d;
+
+public class T_sput_char_17 {
+ public void run() {
+ }
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_7.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_7.java
new file mode 100644
index 0000000..7a496f2
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_7.java
@@ -0,0 +1,22 @@
+/*
+ * 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.sput_char.d;
+
+public class T_sput_char_7 {
+ public void run() {
+ }
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_8.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_8.java
new file mode 100644
index 0000000..c4a3e38
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_8.java
@@ -0,0 +1,22 @@
+/*
+ * 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.sput_char.d;
+
+public class T_sput_char_8 {
+ public void run() {
+ }
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_9.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_9.java
new file mode 100644
index 0000000..c38e18c
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_9.java
@@ -0,0 +1,22 @@
+/*
+ * 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.sput_char.d;
+
+public class T_sput_char_9 {
+ public void run() {
+ }
+}