Merge "fix WQVGA resolution" into froyo
diff --git a/Android.mk b/Android.mk
index 29e7cff..e3f9ba8 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,4 +14,6 @@
# limitations under the License.
#
+include cts/CtsTestCoverage.mk
+
include $(call all-subdir-makefiles)
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 46db63c..9e3f0a5 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -27,16 +27,14 @@
CtsTargetInstrumentationApp \
CtsUsePermissionDiffCert
-CTS_TEST_CASE_LIST := \
- TestDeviceSetup \
- CtsTestStubs \
+# These test cases will be analyzed by the CTS API coverage tools.
+CTS_COVERAGE_TEST_CASE_LIST := \
CtsAccessibilityServiceTestCases \
CtsAccountManagerTestCases \
CtsAppTestCases \
CtsBluetoothTestCases \
CtsContentTestCases \
CtsDatabaseTestCases \
- CtsDelegatingAccessibilityService \
CtsDpiTestCases \
CtsDpiTestCases2 \
CtsExampleTestCases \
@@ -49,23 +47,30 @@
CtsOsTestCases \
CtsPermissionTestCases \
CtsPermission2TestCases \
+ CtsPreferenceTestCases \
CtsProviderTestCases \
CtsSaxTestCases \
CtsSpeechTestCases \
CtsTelephonyTestCases \
+ CtsTestStubs \
CtsTextTestCases \
CtsUtilTestCases \
CtsViewTestCases \
CtsWebkitTestCases \
CtsWidgetTestCases \
CtsNetTestCases \
- SignatureTest \
CtsPerformanceTestCases \
CtsPerformance2TestCases \
CtsPerformance3TestCases \
CtsPerformance4TestCases \
- CtsPerformance5TestCases \
+ CtsPerformance5TestCases
+
+CTS_TEST_CASE_LIST := \
+ TestDeviceSetup \
+ CtsDelegatingAccessibilityService \
+ SignatureTest \
ApiDemos \
ApiDemosReferenceTest \
$(CTS_APPS_LIST) \
+ $(CTS_COVERAGE_TEST_CASE_LIST) \
$(CTS_SECURITY_APPS_LIST)
diff --git a/CtsTestCoverage.mk b/CtsTestCoverage.mk
new file mode 100644
index 0000000..7053fea
--- /dev/null
+++ b/CtsTestCoverage.mk
@@ -0,0 +1,65 @@
+#
+# 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.
+#
+
+# Makefile for producing CTS coverage reports.
+# Run "make cts-test-coverage" in the $ANDROID_BUILD_TOP directory.
+
+include cts/CtsTestCaseList.mk
+
+CTS_API_COVERAGE_EXE := $(HOST_OUT_EXECUTABLES)/cts-api-coverage
+DEXDEPS_EXE := $(HOST_OUT_EXECUTABLES)/dexdeps
+
+COVERAGE_OUT := $(HOST_OUT)/cts-api-coverage
+cts-test-coverage-report := $(COVERAGE_OUT)/test-coverage.html
+cts-verifier-coverage-report := $(COVERAGE_OUT)/verifier-coverage.html
+
+CTS_API_COVERAGE_DEPENDENCIES := $(CTS_API_COVERAGE_EXE) $(DEXDEPS_EXE) $(ACP)
+
+$(cts-test-coverage-report) : $(CTS_COVERAGE_TEST_CASE_LIST) $(CTS_API_COVERAGE_DEPENDENCIES)
+ $(call generate-coverage-report,"CTS Tests API Coverage Report",\
+ $(CTS_COVERAGE_TEST_CASE_LIST),html,test-coverage.html)
+
+$(cts-verifier-coverage-report) : CtsVerifier $(CTS_API_COVERAGE_DEPENDENCIES)
+ $(call generate-coverage-report,"CTS Verifier API Coverage Report",\
+ CtsVerifier,html,verifier-coverage.html)
+
+.PHONY: cts-test-coverage
+cts-test-coverage : $(cts-test-coverage-report)
+
+.PHONY: cts-verifier-coverage
+cts-verifier-coverage : $(cts-verifier-coverage-report)
+
+# Put the test coverage report in the dist dir if "cts" is among the build goals.
+ifneq ($(filter cts, $(MAKECMDGOALS)),)
+ $(call dist-for-goals, cts, $(cts-test-coverage-report):cts-test-coverage-report.html)
+ $(call dist-for-goals, cts, $(cts-verifier-coverage-report):cts-verifier-coverage-report.html)
+endif
+
+# Arguments;
+# 1 - Name of the report printed out on the screen
+# 2 - Name of APK packages that will be scanned to generate the report
+# 3 - Format of the report
+# 4 - Output file name of the report
+define generate-coverage-report
+ $(foreach testcase,$(2),$(eval $(call add-testcase-apk,$(testcase))))
+ $(hide) mkdir -p $(COVERAGE_OUT)
+ $(hide) $(CTS_API_COVERAGE_EXE) -d $(DEXDEPS_EXE) -f $(3) -o $(COVERAGE_OUT)/$(4) $(TEST_APKS)
+ $(hide) echo $(1): file://$(ANDROID_BUILD_TOP)/$(COVERAGE_OUT)/$(4)
+endef
+
+define add-testcase-apk
+ TEST_APKS += $(call intermediates-dir-for,APPS,$(1))/package.apk
+endef
diff --git a/apps/CtsVerifier/Android.mk b/apps/CtsVerifier/Android.mk
index 112b1bf..dab331a 100644
--- a/apps/CtsVerifier/Android.mk
+++ b/apps/CtsVerifier/Android.mk
@@ -31,4 +31,10 @@
include $(BUILD_PACKAGE)
+# Builds and launches CTS Verifier on a device.
+.PHONY: cts-verifier
+cts-verifier: CtsVerifier adb
+ adb install -r $(ANDROID_PRODUCT_OUT)/data/app/CtsVerifier.apk \
+ && adb shell "am start -n com.android.cts.verifier/.CtsVerifierActivity"
+
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/apps/CtsVerifier/arduino-helper/Makefile b/apps/CtsVerifier/arduino-helper/Makefile
index 65bdacb..4159ee6 100644
--- a/apps/CtsVerifier/arduino-helper/Makefile
+++ b/apps/CtsVerifier/arduino-helper/Makefile
@@ -41,7 +41,7 @@
ARDUINO_VERSION=18
ARDUINO_CORES_PATH = $(ARDUINO_PATH)/hardware/arduino/cores/arduino
AVR_TOOLS_PATH = /usr/bin
-AVRDUDE_PATH = $(ARDUINO_PATH)/hardware/tools
+AVRDUDE_PATH = /usr/bin
# Programming port information
PORT = /dev/ttyUSB0
@@ -117,8 +117,9 @@
# Programming support using avrdude. Settings and variables.
AVRDUDE_WRITE_FLASH = -U flash:w:$(OUT_DIR)/$(TARGET).hex
-AVRDUDE_FLAGS = -V -F -C $(ARDUINO_PATH)/hardware/tools/avrdude.conf \
--p $(MCU) -P $(PORT) -c $(AVRDUDE_PROGRAMMER) -b $(UPLOAD_RATE)
+#AVRDUDE_FLAGS = -V -F -C $(ARDUINO_PATH)/hardware/tools/avrdude.conf \
+
+AVRDUDE_FLAGS = -V -F -p $(MCU) -P $(PORT) -c $(AVRDUDE_PROGRAMMER) -b $(UPLOAD_RATE)
# AVR cross-compiler toolchain binaries
CC = $(AVR_TOOLS_PATH)/avr-gcc
@@ -149,11 +150,12 @@
# Concatenates the 'sketch' .pde file with the usual Arduino boilerplate
$(OUT_DIR)/$(TARGET).cpp: $(TARGET).pde
- test -d $(OUT_DIR) || mkdir $(OUT_DIR)
- echo '#include "WProgram.h"' > $(OUT_DIR)/$(TARGET).cpp
- echo 'void setup();' >> $(OUT_DIR)/$(TARGET).cpp
- echo 'void loop();' >> $(OUT_DIR)/$(TARGET).cpp
- cat $(TARGET).pde >> $(OUT_DIR)/$(TARGET).cpp
+ @echo "Generate $(TARGET).cpp from $(TARGET).pde"
+ @test -d $(OUT_DIR) || mkdir $(OUT_DIR)
+ @echo '#include "WProgram.h"' > $(OUT_DIR)/$(TARGET).cpp
+ @echo 'void setup();' >> $(OUT_DIR)/$(TARGET).cpp
+ @echo 'void loop();' >> $(OUT_DIR)/$(TARGET).cpp
+ @cat $(TARGET).pde >> $(OUT_DIR)/$(TARGET).cpp
elf: $(OUT_DIR)/$(TARGET).elf
hex: $(OUT_DIR)/$(TARGET).hex
@@ -172,10 +174,10 @@
HEXSIZE = $(SIZE) --target=$(FORMAT) $(OUT_DIR)/$(TARGET).hex
ELFSIZE = $(SIZE) $(OUT_DIR)/$(TARGET).elf
sizebefore:
- @if [ -f $(OUT_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi
+ @if [ -f $(OUT_DIR)/$(TARGET).elf ]; then echo $(MSG_SIZE_BEFORE); $(HEXSIZE); fi
sizeafter:
- @if [ -f $(OUT_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(HEXSIZE); echo; fi
+ @if [ -f $(OUT_DIR)/$(TARGET).elf ]; then echo $(MSG_SIZE_AFTER); $(HEXSIZE); fi
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
@@ -254,9 +256,14 @@
# Target: clean project.
clean:
- $(REMOVE) $(OUT_DIR)/$(TARGET).hex $(OUT_DIR)/$(TARGET).eep $(OUT_DIR)/$(TARGET).cof $(OUT_DIR)/$(TARGET).elf \
- $(OUT_DIR)/$(TARGET).map $(OUT_DIR)/$(TARGET).sym $(OUT_DIR)/$(TARGET).lss $(OUT_DIR)/core.a \
- $(ARDUINO_C_MODULES_SRC:.c=.s) $(ARDUINO_C_MODULES_SRC:.c=.d) $(ARDUINO_CPP_MODULES_SRC:.cpp=.s) $(ARDUINO_CPP_MODULES_SRC:.cpp=.d) $(ARDUINO_C_MODULES_OBJ) $(ARDUINO_CPP_MODULES_OBJ) $(OUT_DIR)/$(TARGET).cpp
+ $(REMOVE) $(OUT_DIR)/$(TARGET).hex $(OUT_DIR)/$(TARGET).eep \
+ $(OUT_DIR)/$(TARGET).cof $(OUT_DIR)/$(TARGET).elf \
+ $(OUT_DIR)/$(TARGET).map $(OUT_DIR)/$(TARGET).sym \
+ $(OUT_DIR)/$(TARGET).lss $(OUT_DIR)/core.a \
+ $(ARDUINO_C_MODULES_SRC:.c=.s) $(ARDUINO_C_MODULES_SRC:.c=.d) \
+ $(ARDUINO_CPP_MODULES_SRC:.cpp=.s) $(ARDUINO_CPP_MODULES_SRC:.cpp=.d) \
+ $(ARDUINO_C_MODULES_OBJ) $(ARDUINO_CPP_MODULES_OBJ) \
+ $(OUT_DIR)/$(TARGET).cpp $(OUT_DIR)/$(TARGET).o
distclean: clean
$(RMDIR) $(OUT_DIR)
diff --git a/apps/CtsVerifier/arduino-helper/arduino-helper.pde b/apps/CtsVerifier/arduino-helper/arduino-helper.pde
index 5649972..0c41388 100644
--- a/apps/CtsVerifier/arduino-helper/arduino-helper.pde
+++ b/apps/CtsVerifier/arduino-helper/arduino-helper.pde
@@ -16,19 +16,20 @@
/*
* Define the basic structure for messages from the host.
- * Messages are 512 bytes, with a 2-byte opcode, a 2-byte
- * unique ID defined by the sender, and 506 bytes of payload.
+ * Messages are MESSAGE_SIZE bytes, with a 2-byte opcode, a 2-byte
+ * unique ID defined by the sender, and the remainder payload.
* The remaining 2 bytes must be 0xFEEDFACE. This is used by
* the message handler as a tail sentinel to resync with the
* sender in case data is lost and the fixed-byte messages
* get out of sync.
*/
-#define MESSAGE_DELIMITER 0xFEEDFACE // required to be
+#define MESSAGE_SIZE 128
+#define MESSAGE_DELIMITER 0xBEEF
#define MESSAGE_ESCAPE 0x2a
struct message {
uint16_t opcode;
uint16_t id;
- uint8_t data[506];
+ uint8_t data[MESSAGE_SIZE - 6];
uint16_t tail;
};
struct message CURRENT_MESSAGE;
@@ -37,8 +38,7 @@
struct reset {
uint16_t opcode;
uint16_t id;
- uint8_t unused[506];
- uint16_t tail;
+ uint8_t unused[MESSAGE_SIZE - 4];
};
#define OPCODE_INIT_TIME (OPCODE_RESET + 1)
@@ -46,8 +46,35 @@
uint16_t opcode;
uint16_t id;
uint32_t cur_raw_time;
- uint8_t unused[502];
- uint16_t tail;
+ uint8_t unused[MESSAGE_SIZE - 6];
+};
+
+#define OPCODE_CURRENT_TIME (OPCODE_RESET + 2)
+struct current_time { // we never actually use this, but here for consistency
+ uint16_t opcode;
+ uint16_t id;
+ uint8_t unused[MESSAGE_SIZE - 4];
+};
+
+#define OPCODE_SETMODE_PONG (OPCODE_RESET + 3)
+struct setmode_pong {
+ uint16_t opcode;
+ uint16_t id;
+ uint16_t playfield_width;
+ uint16_t playfield_height;
+ uint16_t paddle_width;
+ uint16_t paddle_offset;
+ uint16_t max_paddle_motion;
+ uint8_t unused[MESSAGE_SIZE - 14];
+};
+
+#define OPCODE_PONG_BALL_STATE (OPCODE_RESET + 4)
+struct pong_ball_state {
+ uint16_t opcode;
+ uint16_t id;
+ uint16_t ball_x;
+ uint16_t ball_y;
+ uint8_t unused[MESSAGE_SIZE - 8];
};
struct wall_time_struct {
@@ -59,21 +86,113 @@
};
struct wall_time_struct WALL_TIME;
-
-/*
- * An object used to store app-specific state data.
- */
-struct struct_state {
+struct pong_state_struct {
+ uint16_t playfield_width;
+ uint16_t playfield_height;
+ uint16_t paddle_width;
+ uint16_t paddle_offset;
+ uint16_t max_paddle_motion;
+ uint16_t paddle_x;
+ uint16_t last_ball_x;
+ uint16_t last_ball_y;
};
-struct struct_state STATE;
+struct pong_state_struct PONG_STATE;
+
+
+void print_current_time() {
+ if (WALL_TIME.initialized) {
+ Serial.print("current_time=");
+ Serial.print(WALL_TIME.hours, DEC);
+ Serial.print(":");
+ if (WALL_TIME.minutes < 10)
+ Serial.print("0");
+ Serial.print(WALL_TIME.minutes, DEC);
+ Serial.print(":");
+ if (WALL_TIME.seconds < 10)
+ Serial.print("0");
+ Serial.println(WALL_TIME.seconds, DEC);
+ } else {
+ Serial.println("current_time=00:00:00");
+ }
+}
+
void handle_current_message() {
+ static uint16_t last_id;
+ static struct setmode_pong* setmode_pong_msg;
+ static struct pong_ball_state* pong_ball_state_msg;
+ static uint16_t paddle_half_width;
+ static uint16_t paddle_max;
+ static uint16_t danger;
+ static uint8_t invert;
+ static uint16_t delta;
+
+ if (CURRENT_MESSAGE.id == 0 || CURRENT_MESSAGE.id == last_id) {
+ return;
+ }
+ last_id = CURRENT_MESSAGE.id;
+
+ switch (CURRENT_MESSAGE.opcode) {
+
+ case OPCODE_SETMODE_PONG:
+ memset(&PONG_STATE, 0, sizeof(PONG_STATE));
+ setmode_pong_msg = (struct setmode_pong*)(&CURRENT_MESSAGE);
+ PONG_STATE.playfield_width = setmode_pong_msg->playfield_width;
+ PONG_STATE.playfield_height = setmode_pong_msg->playfield_height;
+ PONG_STATE.paddle_width = setmode_pong_msg->paddle_width;
+ PONG_STATE.paddle_offset = setmode_pong_msg->paddle_offset;
+ PONG_STATE.max_paddle_motion = setmode_pong_msg->max_paddle_motion;
+
+ paddle_half_width = PONG_STATE.paddle_width / 2;
+ paddle_max = PONG_STATE.playfield_width - paddle_half_width;
+
+ Serial.println("message_type=setmode_pong_ack");
+ Serial.print("id=");
+ Serial.println(CURRENT_MESSAGE.id);
+ print_current_time();
+ Serial.println("");
+ break;
+
+ case OPCODE_PONG_BALL_STATE:
+ pong_ball_state_msg = (struct pong_ball_state*)(&CURRENT_MESSAGE);
+ danger = pong_ball_state_msg->ball_x - PONG_STATE.paddle_x;
+ invert = (danger < 0);
+ danger *= invert ? -1 : 1;
+ if (danger < paddle_half_width) {
+ delta = 0;
+ } else if (danger < PONG_STATE.playfield_width / 3) {
+ delta = PONG_STATE.max_paddle_motion / 3;
+ } else if (danger < PONG_STATE.playfield_width * 2 / 3) {
+ delta = PONG_STATE.max_paddle_motion * 2 / 3;
+ } else {
+ delta = PONG_STATE.max_paddle_motion;
+ }
+ delta *= invert ? 1 : -1;
+ PONG_STATE.paddle_x += delta;
+ if (PONG_STATE.paddle_x < paddle_half_width) {
+ PONG_STATE.paddle_x = paddle_half_width;
+ } else if (PONG_STATE.paddle_x > paddle_max) {
+ PONG_STATE.paddle_x = paddle_max;
+ }
+
+ Serial.println("message_type=pong_paddle_state");
+ Serial.print("id=");
+ Serial.println(CURRENT_MESSAGE.id);
+ print_current_time();
+ Serial.print("paddle_x=");
+ Serial.println(PONG_STATE.paddle_x);
+ Serial.println("");
+ break;
+
+ default:
+ break;
+ }
}
/* This is a temporary buffer used by the message handler */
struct message_buffer {
- uint8_t count; // number of bytes read into the buffer
- uint8_t buffer[512]; // contents of a 'struct message'
+ uint16_t count; // number of bytes read into the buffer
+ uint8_t buffer[MESSAGE_SIZE]; // contents of a 'struct message'
};
struct message_buffer MESSAGE_BUFFER;
@@ -85,8 +204,8 @@
void reset() {
memset(&WALL_TIME, 0, sizeof(WALL_TIME));
memset(&CURRENT_MESSAGE, 0, sizeof(CURRENT_MESSAGE));
- memset(&STATE, 0, sizeof(STATE));
memset(&MESSAGE_BUFFER, 0, sizeof(MESSAGE_BUFFER));
+ memset(&PONG_STATE, 0, sizeof(PONG_STATE));
}
@@ -104,34 +223,47 @@
* time.
*/
void pump_message_processor() {
- static uint16_t cur_byte;
+ static uint8_t cur_byte;
static uint16_t* cur_word;
static int8_t delimiter_index;
- while (Serial.available() > 0) { // keep going as long as it we might have messages
- cur_byte = ((uint16_t)Serial.read()) & 0x00ff;
+ static char buf[4];
+ while (Serial.available() > 0) { // keep going as long as we might have messages
+ cur_byte = (uint8_t)(Serial.read() & 0x000000ff);
MESSAGE_BUFFER.buffer[(MESSAGE_BUFFER.count)++] = cur_byte;
- if (MESSAGE_BUFFER.count >= 512) {
- if ((uint16_t)(*(MESSAGE_BUFFER.buffer + 510)) != MESSAGE_DELIMITER) {
+ Serial.print("booga ");
+ Serial.print(itoa(MESSAGE_BUFFER.count, buf, 10));
+ Serial.print(" ");
+ Serial.print(itoa(Serial.available(), buf, 10));
+ Serial.print(" ");
+ Serial.println(itoa(cur_byte, buf, 10));
+ if (MESSAGE_BUFFER.count >= MESSAGE_SIZE) {
+ if ((*(uint16_t*)(MESSAGE_BUFFER.buffer + MESSAGE_SIZE - 2)) != MESSAGE_DELIMITER) {
// whoops, we got out of sync with the transmitter. Scan current
// buffer for the delimiter, discard previous message, and shift
// partial next message to front of buffer. This loses a message but
// gets us back in sync
delimiter_index = -2;
- for (int i = 510; i >= 0; --i) {
+ for (int i = MESSAGE_SIZE - 2; i >= 0; --i) {
if (*((uint16_t*)(MESSAGE_BUFFER.buffer + i)) == MESSAGE_DELIMITER) {
- if (((i - 1) < 0) || (MESSAGE_BUFFER.buffer[i - 1] != MESSAGE_ESCAPE)) {
+ if (((i - 1) >= 0) && (MESSAGE_BUFFER.buffer[i - 1] != MESSAGE_ESCAPE)) {
delimiter_index = i;
break;
}
}
}
+ Serial.print("klaxon ");
+ Serial.println(itoa(delimiter_index, buf, 10));
+ Serial.print("klaxon ");
+ Serial.println(itoa(*((uint16_t*)(MESSAGE_BUFFER.buffer + MESSAGE_SIZE - 2)), buf, 10));
MESSAGE_BUFFER.count = 0;
- for (int i = delimiter_index + 2; i < 512; ++i, ++(MESSAGE_BUFFER.count)) {
- MESSAGE_BUFFER.buffer[MESSAGE_BUFFER.count] = MESSAGE_BUFFER.buffer[i];
+ if (delimiter_index >= 0) {
+ for (int i = delimiter_index + 2; i < MESSAGE_SIZE; ++i, ++(MESSAGE_BUFFER.count)) {
+ MESSAGE_BUFFER.buffer[MESSAGE_BUFFER.count] = MESSAGE_BUFFER.buffer[i];
+ }
}
- memset(MESSAGE_BUFFER.buffer + MESSAGE_BUFFER.count, 0, 512 - MESSAGE_BUFFER.count);
+ memset(MESSAGE_BUFFER.buffer + MESSAGE_BUFFER.count, 0, MESSAGE_SIZE - MESSAGE_BUFFER.count);
} else {
- memcpy(&CURRENT_MESSAGE, MESSAGE_BUFFER.buffer, 512);
+ memcpy(&CURRENT_MESSAGE, MESSAGE_BUFFER.buffer, MESSAGE_SIZE);
memset(&MESSAGE_BUFFER, 0, sizeof(MESSAGE_BUFFER));
switch (CURRENT_MESSAGE.opcode) {
case OPCODE_RESET:
@@ -143,9 +275,25 @@
// out the current time
WALL_TIME.raw = ((struct init_time*)(&CURRENT_MESSAGE))->cur_raw_time;
WALL_TIME.initialized = 1;
+
+ Serial.println("message_type=init_time_ack");
+ Serial.print("id=");
+ Serial.println(CURRENT_MESSAGE.id);
+ print_current_time();
+ Serial.println("");
+
CURRENT_MESSAGE.id = 0;
break;
+ case OPCODE_CURRENT_TIME:
+ Serial.println("message_type=current_time_ack");
+ Serial.print("id=");
+ Serial.println(CURRENT_MESSAGE.id);
+ print_current_time();
+ Serial.println("");
+
+ CURRENT_MESSAGE.id = 0;
+
default:
// no-op -- actually means main loop will handle it
break;
@@ -155,29 +303,6 @@
}
}
-
-/* Dumps the full state of the system for the other side to peruse. Because we dump our state
- * periodically, we don't need to worry about responding to commands -- the other side can
- * just monitor for changes in state.
- */
-void dump_state() {
- Serial.print("current_time=");
- Serial.print(WALL_TIME.hours, DEC);
- Serial.print(":");
- if (WALL_TIME.minutes < 10)
- Serial.print("0");
- Serial.print(WALL_TIME.minutes, DEC);
- Serial.print(":");
- if (WALL_TIME.seconds < 10)
- Serial.print("0");
- Serial.println(WALL_TIME.seconds, DEC);
-
- // TODO
-
- Serial.println("");
-}
-
-
/*
* Pumps the system wall clock. This checks the device's monotonic clock to
* determine elapsed time since last invocation, and updates wall clock time
@@ -190,8 +315,14 @@
*/
void pump_clock() {
static uint32_t prev_millis = 0;
+ static uint32_t tmp_prev_millis = 0;
uint32_t tmp = 0;
+ if (millis() / 1000 != tmp_prev_millis) {
+ tmp_prev_millis = millis() / 1000;
+ print_current_time();
+ }
+
if (WALL_TIME.initialized) {
tmp = millis() / 1000;
if (tmp != prev_millis) {
diff --git a/apps/CtsVerifier/res/layout/fs_info.xml b/apps/CtsVerifier/res/layout/fs_info.xml
new file mode 100644
index 0000000..3fe6815
--- /dev/null
+++ b/apps/CtsVerifier/res/layout/fs_info.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent" android:layout_height="wrap_content">
+
+ <ImageView android:id="@+id/fs_legend_good_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_good"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true" />
+ <TextView android:id="@+id/fs_legend_good_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/fs_legend_good"
+ android:layout_toRightOf="@id/fs_legend_good_image"
+ android:layout_alignTop="@id/fs_legend_good_image"
+ android:layout_marginLeft="3dip" />
+
+ <ImageView android:id="@+id/fs_legend_indeterminate_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_indeterminate"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@id/fs_legend_good_image" />
+ <TextView android:id="@+id/fs_legend_indeterminate_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/fs_legend_indeterminate"
+ android:layout_toRightOf="@id/fs_legend_indeterminate_image"
+ android:layout_alignTop="@id/fs_legend_indeterminate_image"
+ android:layout_marginLeft="3dip" />
+
+ <ImageView android:id="@+id/fs_legend_warning_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_warning"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@id/fs_legend_indeterminate_image" />
+ <TextView android:id="@+id/fs_legend_warning_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/fs_legend_warning"
+ android:layout_toRightOf="@id/fs_legend_warning_image"
+ android:layout_alignTop="@id/fs_legend_warning_image"
+ android:layout_marginLeft="3dip" />
+
+ <ImageView android:id="@+id/fs_legend_error_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/fs_error"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@id/fs_legend_warning_image" />
+ <TextView android:id="@+id/fs_legend_error_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/fs_legend_error"
+ android:layout_toRightOf="@id/fs_legend_error_image"
+ android:layout_alignTop="@id/fs_legend_error_image"
+ android:layout_marginLeft="3dip" />
+</RelativeLayout>
diff --git a/apps/CtsVerifier/res/layout/fs_main.xml b/apps/CtsVerifier/res/layout/fs_main.xml
index a94f326..7473f0f 100644
--- a/apps/CtsVerifier/res/layout/fs_main.xml
+++ b/apps/CtsVerifier/res/layout/fs_main.xml
@@ -22,7 +22,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/empty"/>
-
+
<ListView android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index ba82f6e..c386a1b 100644
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -46,13 +46,18 @@
<string name="fs_disallowed">WARNING: device reports a disallowed feature name</string>
<string name="fs_missing_wifi_telephony">WARNING: device reports neither WiFi nor telephony</string>
<string name="fs_no_data">No data.</string>
+ <string name="fs_legend_good">standard feature reported by device</string>
+ <string name="fs_legend_indeterminate">optional feature not reported by device</string>
+ <string name="fs_legend_warning">non-standard feature reported by device</string>
+ <string name="fs_legend_error">required feature not reported, or forbidden feature reported</string>
+
<string name="empty"></string>
<!-- Strings for AccelerometerTestActivity and MagnetometerTestActivity -->
<string name="snsr_accel_test">Accelerometer Test</string>
- <string name="snsr_accel_test_info">This is a test for...</string>
+ <string name="snsr_accel_test_info">This test verifies that the accelerometer is working properly. As you move the device around through space, the triangle should always point down (i.e. in the direction of gravity.) If it does not, the accelerometer is improperly configured.</string>
<string name="snsr_mag_test">Magnetometer Test</string>
- <string name="snsr_mag_test_info">This is a test for...</string>
+ <string name="snsr_mag_test_info">This test verifies that the magnetometer (compass) is working properly. As you move the device around through space, the triangle should always point toward the north pole (which may point through the ground.) If it does not, the magnetometer is improperly configured. Be sure not to run this test with the device near any strong magnetic field generators.</string>
<!-- Strings for SuidFilesActivity -->
<string name="suid_files">SUID File Scanner</string>
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java b/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java
index 6b55c72..1c407b8 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java
@@ -19,9 +19,11 @@
import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.ContentValues;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.database.Cursor;
+import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@@ -53,7 +55,7 @@
* @param titleId for the text shown in the dialog title area
* @param messageId for the text shown in the dialog's body area
*/
- void setInfoTextResources(int titleId, int messageId);
+ void setInfoResources(int titleId, int messageId, int viewId);
/**
* Click handler for the pass and fail buttons. No need to call this ever as the XML
@@ -64,8 +66,8 @@
public static class Activity extends android.app.Activity implements PassFailActivity {
- public void setInfoTextResources(int titleId, int messageId) {
- setInfoText(this, titleId, messageId);
+ public void setInfoResources(int titleId, int messageId, int viewId) {
+ setInfo(this, titleId, messageId, viewId);
}
public void passFailButtonsClickHandler(View target) {
@@ -75,8 +77,8 @@
public static class ListActivity extends android.app.ListActivity implements PassFailActivity {
- public void setInfoTextResources(int titleId, int messageId) {
- setInfoText(this, titleId, messageId);
+ public void setInfoResources(int titleId, int messageId, int viewId) {
+ setInfo(this, titleId, messageId, viewId);
}
public void passFailButtonsClickHandler(View target) {
@@ -84,20 +86,20 @@
}
}
- private static void setInfoText(final android.app.Activity activity, final int titleId,
- final int messageId) {
+ private static void setInfo(final android.app.Activity activity, final int titleId,
+ final int messageId, final int viewId) {
// Show the middle "info" button and make it show the info dialog when clicked.
View infoButton = activity.findViewById(R.id.info_button);
infoButton.setVisibility(View.VISIBLE);
infoButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
- showInfoDialog(activity, titleId, messageId);
+ showInfoDialog(activity, titleId, messageId, viewId);
}
});
// Show the info dialog if the user has never seen it before.
if (!hasSeenInfoDialog(activity)) {
- showInfoDialog(activity, titleId, messageId);
+ showInfoDialog(activity, titleId, messageId, viewId);
}
}
@@ -117,22 +119,26 @@
}
private static void showInfoDialog(final android.app.Activity activity, int titleId,
- int messageId) {
- new AlertDialog.Builder(activity)
- .setIcon(android.R.drawable.ic_dialog_info)
- .setTitle(titleId)
- .setMessage(messageId)
- .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- markSeenInfoDialog(activity);
- }
- })
- .setOnCancelListener(new OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- markSeenInfoDialog(activity);
- }
- })
- .show();
+ int messageId, int viewId) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(activity).setIcon(
+ android.R.drawable.ic_dialog_info).setTitle(titleId);
+ if (viewId > 0) {
+ LayoutInflater inflater = (LayoutInflater) activity
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ builder.setView(inflater.inflate(viewId, null));
+ } else {
+ builder.setMessage(messageId);
+ }
+ builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ markSeenInfoDialog(activity);
+ }
+ }).setOnCancelListener(new OnCancelListener() {
+ public void onCancel(DialogInterface dialog) {
+ markSeenInfoDialog(activity);
+ }
+ })
+ .show();
}
private static void markSeenInfoDialog(android.app.Activity activity) {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
index 2277876..4f6e0a3 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
@@ -21,6 +21,7 @@
* http://www.fatcow.com/free-icons/
* http://creativecommons.org/licenses/by/3.0/us/
*/
+
package com.android.cts.verifier.features;
import com.android.cts.verifier.PassFailButtons;
@@ -28,6 +29,7 @@
import android.content.pm.FeatureInfo;
import android.content.pm.PackageManager;
+import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
@@ -63,7 +65,7 @@
/**
* Constructor does not include 'present' because that's a detected
* value, and not set during creation.
- *
+ *
* @param name value for this.name
* @param required value for this.required
*/
@@ -75,47 +77,57 @@
}
/**
- * A list of all known features. If a constant is added to PackageManager,
- * this list needs to be updated. We could detect these fields via
- * Reflection, but we can't determine whether the features are required or
- * not that way, so we need this block anyway.
+ * A list of all features added in Eclair (API=7).
*/
- public static final Feature[] ALL_FEATURES = {
- new Feature(PackageManager.FEATURE_BLUETOOTH, true),
+ public static final Feature[] ALL_ECLAIR_FEATURES = {
new Feature(PackageManager.FEATURE_CAMERA, true),
new Feature(PackageManager.FEATURE_CAMERA_AUTOFOCUS, false),
new Feature(PackageManager.FEATURE_CAMERA_FLASH, false),
new Feature(PackageManager.FEATURE_LIVE_WALLPAPER, false),
- new Feature(PackageManager.FEATURE_LOCATION, true),
- new Feature(PackageManager.FEATURE_LOCATION_GPS, true),
- new Feature(PackageManager.FEATURE_LOCATION_NETWORK, true),
- new Feature(PackageManager.FEATURE_MICROPHONE, true),
- new Feature(PackageManager.FEATURE_SENSOR_ACCELEROMETER, true),
- new Feature(PackageManager.FEATURE_SENSOR_COMPASS, true),
new Feature(PackageManager.FEATURE_SENSOR_LIGHT, false),
new Feature(PackageManager.FEATURE_SENSOR_PROXIMITY, false),
new Feature(PackageManager.FEATURE_TELEPHONY, false),
new Feature(PackageManager.FEATURE_TELEPHONY_CDMA, false),
new Feature(PackageManager.FEATURE_TELEPHONY_GSM, false),
- new Feature(PackageManager.FEATURE_TOUCHSCREEN, true),
- new Feature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH, false),
- new Feature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT, false),
- new Feature(PackageManager.FEATURE_WIFI, false),
+ };
+
+ /**
+ * A list of all features added in FroYo (API=8). Because we want to run on
+ * Eclair devices, we can't use static references to constants added later
+ * than Eclair. We could use Reflection, but we'd still need a list of
+ * string literals (for constant names) anyway, and there's little point in
+ * using Reflection to to look up a constant String value for a constant
+ * String name.
+ */
+ public static final Feature[] ALL_FROYO_FEATURES = {
+ new Feature("android.hardware.bluetooth", true),
+ new Feature("android.hardware.location", true),
+ new Feature("android.hardware.location.gps", true),
+ new Feature("android.hardware.location.network", true),
+ new Feature("android.hardware.microphone", true),
+ new Feature("android.hardware.sensor.accelerometer", true),
+ new Feature("android.hardware.sensor.compass", true),
+ new Feature("android.hardware.touchscreen", true),
+ new Feature("android.hardware.touchscreen.multitouch", false),
+ new Feature("android.hardware.touchscreen.multitouch.distinct", false),
+ new Feature("android.hardware.wifi", false),
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fs_main);
- setInfoTextResources(R.string.feature_summary, R.string.feature_summary_info);
+ setInfoResources(R.string.feature_summary, R.string.feature_summary_info, R.layout.fs_info);
setResult(RESULT_CANCELED);
- // some values used to detect warn-able conditions involving multiple features
+ // some values used to detect warn-able conditions involving multiple
+ // features
boolean hasWifi = false;
boolean hasTelephony = false;
boolean hasIllegalFeature = false;
- // get list of all features device thinks it has, & store in a HashMap for fast lookups
+ // get list of all features device thinks it has, & store in a HashMap
+ // for fast lookups
HashMap<String, String> actualFeatures = new HashMap<String, String>();
for (FeatureInfo fi : getPackageManager().getSystemAvailableFeatures()) {
actualFeatures.put(fi.name, fi.name);
@@ -127,7 +139,15 @@
// roll over all known features & check whether device reports them
boolean present = false;
int statusIcon;
- for (Feature f : ALL_FEATURES) {
+ ArrayList<Feature> features = new ArrayList<Feature>();
+ int apiVersion = Build.VERSION.SDK_INT;
+ if (apiVersion >= Build.VERSION_CODES.ECLAIR_MR1) {
+ Collections.addAll(features, ALL_ECLAIR_FEATURES);
+ }
+ if (apiVersion >= Build.VERSION_CODES.FROYO) {
+ Collections.addAll(features, ALL_FROYO_FEATURES);
+ }
+ for (Feature f : features) {
HashMap<String, Object> row = new HashMap<String, Object>();
listViewData.add(row);
present = actualFeatures.containsKey(f.name);
@@ -138,10 +158,12 @@
statusIcon = R.drawable.fs_good;
actualFeatures.remove(f.name);
} else if (!present && f.required) {
- // it's required, but device doesn't report it. Boo, set the bogus icon
+ // it's required, but device doesn't report it. Boo, set the
+ // bogus icon
statusIcon = R.drawable.fs_error;
} else {
- // device doesn't report it, but it's not req'd, so can't tell if there's a problem
+ // device doesn't report it, but it's not req'd, so can't tell
+ // if there's a problem
statusIcon = R.drawable.fs_indeterminate;
}
row.put("feature", f.name);
@@ -156,7 +178,8 @@
listViewData.add(row);
row.put("feature", feature);
if (feature.startsWith("android")) { // intentionally not "android."
- // sorry, you're not allowed to squat in the official namespace; set bogus icon
+ // sorry, you're not allowed to squat in the official namespace;
+ // set bogus icon
row.put("icon", R.drawable.fs_error);
hasIllegalFeature = true;
} else {
@@ -165,7 +188,8 @@
}
}
- // sort the ListView's data to group by icon type, for easier reading by humans
+ // sort the ListView's data to group by icon type, for easier reading by
+ // humans
final HashMap<Integer, Integer> idMap = new HashMap<Integer, Integer>();
idMap.put(R.drawable.fs_error, 0);
idMap.put(R.drawable.fs_warning, 1);
@@ -186,8 +210,11 @@
// Set up the SimpleAdapter used to populate the ListView
SimpleAdapter adapter = new SimpleAdapter(this, listViewData, R.layout.fs_row,
- new String[] { "feature", "icon" },
- new int[] { R.id.fs_feature, R.id.fs_icon });
+ new String[] {
+ "feature", "icon"
+ }, new int[] {
+ R.id.fs_feature, R.id.fs_icon
+ });
adapter.setViewBinder(new SimpleAdapter.ViewBinder() {
public boolean setViewValue(View view, Object data, String repr) {
try {
@@ -206,7 +233,8 @@
});
setListAdapter(adapter);
- // finally, check for our second-order error cases and set warning text if necessary
+ // finally, check for our second-order error cases and set warning text
+ // if necessary
StringBuffer sb = new StringBuffer();
if (hasIllegalFeature) {
sb.append(getResources().getString(R.string.fs_disallowed)).append("\n");
@@ -214,6 +242,11 @@
if (!hasWifi && !hasTelephony) {
sb.append(getResources().getString(R.string.fs_missing_wifi_telephony)).append("\n");
}
- ((TextView) (findViewById(R.id.fs_warnings))).setText(sb.toString());
+ String warnings = sb.toString().trim();
+ if (warnings == null || "".equals(warnings)) {
+ ((TextView) (findViewById(R.id.fs_warnings))).setVisibility(View.GONE);
+ } else {
+ ((TextView) (findViewById(R.id.fs_warnings))).setText(warnings);
+ }
}
}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerTestActivity.java
index 2c07882..2100c0f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerTestActivity.java
@@ -49,7 +49,7 @@
mListener = renderer;
setContentView(R.layout.pass_fail_gl);
- setInfoTextResources(R.string.snsr_accel_test, R.string.snsr_accel_test_info);
+ setInfoResources(R.string.snsr_accel_test, R.string.snsr_accel_test_info, -1);
mGLSurfaceView = (GLSurfaceView) findViewById(R.id.gl_surface_view);
mGLSurfaceView.setRenderer(renderer);
}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagnetometerTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagnetometerTestActivity.java
index f5ad701..479a2fb 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagnetometerTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagnetometerTestActivity.java
@@ -48,7 +48,7 @@
mListener = renderer;
setContentView(R.layout.pass_fail_gl);
- setInfoTextResources(R.string.snsr_mag_test, R.string.snsr_mag_test_info);
+ setInfoResources(R.string.snsr_mag_test, R.string.snsr_mag_test_info, -1);
mGLSurfaceView = (GLSurfaceView) findViewById(R.id.gl_surface_view);
mGLSurfaceView.setRenderer(renderer);
}
diff --git a/apps/CtsVerifier/tests/src/com/android/cts/verifier/features/FeatureSummaryActivityTest.java b/apps/CtsVerifier/tests/src/com/android/cts/verifier/features/FeatureSummaryActivityTest.java
index 43f5da4..ca7ced4 100644
--- a/apps/CtsVerifier/tests/src/com/android/cts/verifier/features/FeatureSummaryActivityTest.java
+++ b/apps/CtsVerifier/tests/src/com/android/cts/verifier/features/FeatureSummaryActivityTest.java
@@ -19,6 +19,7 @@
import com.android.cts.verifier.features.FeatureSummaryActivity.Feature;
import android.content.pm.PackageManager;
+import android.os.Build;
import java.lang.reflect.Field;
import java.util.HashSet;
@@ -29,12 +30,19 @@
public class FeatureSummaryActivityTest extends TestCase {
public void testAllFeatures() throws Exception {
+ int version = Build.VERSION.SDK_INT;
+
Set<String> expectedFeatures = getFeatureConstants();
Set<String> actualFeatures = new HashSet<String>();
- for (Feature feature : FeatureSummaryActivity.ALL_FEATURES) {
+ for (Feature feature : FeatureSummaryActivity.ALL_ECLAIR_FEATURES) {
actualFeatures.add(feature.name);
}
+ if (version >= Build.VERSION_CODES.FROYO) {
+ for (Feature feature : FeatureSummaryActivity.ALL_FROYO_FEATURES) {
+ actualFeatures.add(feature.name);
+ }
+ }
assertEquals("Feature list needs to be updated.",
expectedFeatures.size(), actualFeatures.size());
diff --git a/development/ide/eclipse/.classpath b/development/ide/eclipse/.classpath
index 59c1521..3f11bd1 100644
--- a/development/ide/eclipse/.classpath
+++ b/development/ide/eclipse/.classpath
@@ -37,6 +37,7 @@
<classpathentry kind="src" path="cts/tests/tests/performance5/src"/>
<classpathentry kind="src" path="cts/tests/tests/permission/src"/>
<classpathentry kind="src" path="cts/tests/tests/permission2/src"/>
+ <classpathentry kind="src" path="cts/tests/tests/preference/src"/>
<classpathentry kind="src" path="cts/tests/tests/provider/src"/>
<classpathentry kind="src" path="cts/tests/tests/speech/src"/>
<classpathentry kind="src" path="cts/tests/tests/telephony/src"/>
@@ -46,6 +47,7 @@
<classpathentry kind="src" path="cts/tests/tests/webkit/src"/>
<classpathentry kind="src" path="cts/tests/tests/widget/src"/>
<classpathentry kind="src" path="cts/tools/annotation-helper/src"/>
+ <classpathentry kind="src" path="cts/tools/cts-api-coverage/src"/>
<classpathentry kind="src" path="cts/tools/cts-reference-app-lib/src"/>
<classpathentry kind="src" path="cts/tools/dasm/src"/>
<classpathentry kind="src" path="cts/tools/device-setup/TestDeviceSetup/src"/>
diff --git a/libs/annotation/src/android/annotation/cts/Profile.java b/libs/annotation/src/android/annotation/cts/Profile.java
deleted file mode 100644
index 35769ad..0000000
--- a/libs/annotation/src/android/annotation/cts/Profile.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 android.annotation.cts;
-
-/**
- * Profile of the device being tested. Certain tests are applicable only to certain device profiles
- * when annotated with the {@link SupportedProfiles} annotation and this enum.
- */
-public enum Profile {
- ALL,
- HANDHELD,
- STB,
-}
diff --git a/libs/annotation/src/android/annotation/cts/SupportedProfiles.java b/libs/annotation/src/android/annotation/cts/SupportedProfiles.java
deleted file mode 100644
index 24a9e21..0000000
--- a/libs/annotation/src/android/annotation/cts/SupportedProfiles.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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 android.annotation.cts;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation for specifying what device profiles are supported by the test. The device's profile
- * must match one of the profiles specified by the annotation. Not having the annotation means the
- * test should be executed for all devices.
- * <p>
- * Examples:
- * <pre>
- * @SupportedProfiles(Profile.HANDHELD)
- * @SupportedProfiles({Profile.HANDHELD, Profile.STB})
- * </pre>
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-public @interface SupportedProfiles {
- Profile[] value();
-}
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index 1c79ece..43eb5fc 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -932,6 +932,11 @@
<activity android:name="android.opengl.cts.OpenGlEsVersionStubActivity"/>
+ <activity android:name="android.preference.cts.PreferenceStubActivity">
+ <meta-data android:name="android.preference"
+ android:resource="@xml/preferences_from_intent" />
+ </activity>
+
</application>
<!--Test for PackageManager, please put this at the very beginning-->
diff --git a/tests/core/runner/src/android/test/InstrumentationCtsTestRunner.java b/tests/core/runner/src/android/test/InstrumentationCtsTestRunner.java
index f2098ea..b5f1919 100644
--- a/tests/core/runner/src/android/test/InstrumentationCtsTestRunner.java
+++ b/tests/core/runner/src/android/test/InstrumentationCtsTestRunner.java
@@ -22,9 +22,8 @@
import dalvik.annotation.BrokenTest;
import dalvik.annotation.SideEffect;
-import android.annotation.cts.Profile;
import android.annotation.cts.RequiredFeatures;
-import android.annotation.cts.SupportedProfiles;
+import android.app.Instrumentation;
import android.app.KeyguardManager;
import android.content.Context;
import android.content.pm.FeatureInfo;
@@ -66,10 +65,9 @@
*/
private static final String TAG = "InstrumentationCtsTestRunner";
- private static final String ARGUMENT_PROFILE = "profile";
+ private static final String REPORT_VALUE_ID = "InstrumentationCtsTestRunner";
- /** Profile of the device being tested or null to run all tests regardless of profile. */
- private Profile mProfile;
+ private static final int REPORT_VALUE_RESULT_OMITTED = -3;
/**
* True if (and only if) we are running in single-test mode (as opposed to
@@ -97,15 +95,6 @@
if (arguments != null) {
String classArg = arguments.getString(ARGUMENT_TEST_CLASS);
mSingleTest = classArg != null && classArg.contains("#");
-
- String profileArg = arguments.getString(ARGUMENT_PROFILE);
- if (profileArg != null) {
- mProfile = Profile.valueOf(profileArg.toUpperCase());
- } else {
- mProfile = Profile.ALL;
- }
- } else {
- mProfile = Profile.ALL;
}
// attempt to disable keyguard, if current test has permission to do so
@@ -245,7 +234,6 @@
Predicates.not(new HasAnnotation(BrokenTest.class));
builderRequirements.add(brokenTestPredicate);
- builderRequirements.add(getProfilePredicate(mProfile));
builderRequirements.add(getFeaturePredicate());
if (!mSingleTest) {
@@ -256,40 +244,43 @@
return builderRequirements;
}
- private Predicate<TestMethod> getProfilePredicate(final Profile specifiedProfile) {
- return new Predicate<TestMethod>() {
- public boolean apply(TestMethod t) {
- Set<Profile> profiles = new HashSet<Profile>();
- add(profiles, t.getAnnotation(SupportedProfiles.class));
- add(profiles, t.getEnclosingClass().getAnnotation(SupportedProfiles.class));
+ /**
+ * Send back an indication that a test was omitted. InstrumentationTestRunner won't run omitted
+ * tests, but CTS needs to know that the test was omitted. Otherwise, it will attempt to rerun
+ * the test thinking that ADB must have crashed or something.
+ */
+ private void sendOmittedStatus(TestMethod t) {
+ Bundle bundle = new Bundle();
+ bundle.putString(Instrumentation.REPORT_KEY_IDENTIFIER, REPORT_VALUE_ID);
+ bundle.putInt(InstrumentationTestRunner.REPORT_KEY_NUM_TOTAL, 1);
+ bundle.putInt(InstrumentationTestRunner.REPORT_KEY_NUM_CURRENT, 1);
+ bundle.putString(InstrumentationTestRunner.REPORT_KEY_NAME_CLASS,
+ t.getEnclosingClassname());
+ bundle.putString(InstrumentationTestRunner.REPORT_KEY_NAME_TEST,
+ t.getName());
- /*
- * Run the test if any of the following conditions are met:
- *
- * 1. No profile for the device was specified. This means run all tests.
- * 2. Specified profile is the ALL profile. This also means run all tests.
- * 3. The test does not require a specific type of profile.
- * 4. The test specifies that all profiles are supported by the test.
- * 5. The test requires a profile which matches the specified profile.
- */
- return specifiedProfile == null
- || specifiedProfile == Profile.ALL
- || profiles.isEmpty()
- || profiles.contains(Profile.ALL)
- || profiles.contains(specifiedProfile);
- }
+ // First status message causes CTS to print out the test name like "Class#test..."
+ sendStatus(InstrumentationTestRunner.REPORT_VALUE_RESULT_START, bundle);
- private void add(Set<Profile> profiles, SupportedProfiles annotation) {
- if (annotation != null) {
- Collections.addAll(profiles, annotation.value());
- }
- }
- };
+ // Second status message causes CTS to complete the line like "Class#test...(omitted)"
+ sendStatus(REPORT_VALUE_RESULT_OMITTED, bundle);
}
+
private Predicate<TestMethod> getFeaturePredicate() {
return new Predicate<TestMethod>() {
public boolean apply(TestMethod t) {
+ if (isValidTest(t)) {
+ // InstrumentationTestRunner will run the test and send back results.
+ return true;
+ } else {
+ // InstrumentationTestRunner WON'T run the test, so send back omitted status.
+ sendOmittedStatus(t);
+ return false;
+ }
+ }
+
+ private boolean isValidTest(TestMethod t) {
Set<String> features = new HashSet<String>();
add(features, t.getAnnotation(RequiredFeatures.class));
add(features, t.getEnclosingClass().getAnnotation(RequiredFeatures.class));
diff --git a/tests/res/layout/textview_layout.xml b/tests/res/layout/textview_layout.xml
index 5689bc5..d0ed1e0 100644
--- a/tests/res/layout/textview_layout.xml
+++ b/tests/res/layout/textview_layout.xml
@@ -15,43 +15,39 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <TextView android:id="@+id/textview_textAttr"
- android:text="@string/text_view_hello"
- android:textColor="@drawable/black"
- android:textColorHighlight="@drawable/yellow"
- android:textColorHint="@drawable/red"
- android:textColorLink="@drawable/blue"
- android:textScaleX="1.2"
- android:textSize="20px"
- android:textStyle="normal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- <TextView android:id="@+id/textview_password"
- android:password="true"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- <TextView android:id="@+id/textview_singleLine"
- android:singleLine="true"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- <TextView android:id="@+id/textview_compound"
- android:drawablePadding="2px"
- android:drawableLeft="@drawable/red"
- android:drawableTop="@drawable/yellow"
- android:drawableRight="@drawable/blue"
- android:drawableBottom="@drawable/black"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- <TextView android:id="@+id/textview_text"
- android:text="@string/text_view_hello"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <ScrollView android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView android:id="@+id/textview_textAttr"
+ android:text="@string/text_view_hello"
+ android:textColor="@drawable/black"
+ android:textColorHighlight="@drawable/yellow"
+ android:textColorHint="@drawable/red"
+ android:textColorLink="@drawable/blue"
+ android:textScaleX="1.2"
+ android:textSize="20px"
+ android:textStyle="normal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
+ <TextView android:id="@+id/textview_password"
+ android:password="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
+ <TextView android:id="@+id/textview_singleLine"
+ android:singleLine="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
+ <TextView android:id="@+id/textview_text"
+ android:text="@string/text_view_hello"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+ </LinearLayout>
+ </ScrollView>
</LinearLayout>
diff --git a/tests/res/xml/preferences_from_intent.xml b/tests/res/xml/preferences_from_intent.xml
new file mode 100644
index 0000000..0911403
--- /dev/null
+++ b/tests/res/xml/preferences_from_intent.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <CheckBoxPreference android:key="check_box_preference_from_intent"
+ android:defaultValue="false"
+ android:title="Check box preference"
+ android:summary="This is a check box preference."
+ />
+</PreferenceScreen>
diff --git a/tests/res/xml/preferences_from_resource.xml b/tests/res/xml/preferences_from_resource.xml
new file mode 100644
index 0000000..d954032
--- /dev/null
+++ b/tests/res/xml/preferences_from_resource.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <CheckBoxPreference android:key="check_box_preference_from_resource"
+ android:defaultValue="false"
+ android:title="Check box preference"
+ android:summary="This is a check box preference."
+ />
+</PreferenceScreen>
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tests/src/android/preference/cts/PreferenceStubActivity.java
similarity index 73%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tests/src/android/preference/cts/PreferenceStubActivity.java
index d01314b..4b6062b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tests/src/android/preference/cts/PreferenceStubActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package android.preference.cts;
+import android.preference.PreferenceActivity;
-public class T_invoke_interface_17 {
-
- public void run() {
- }
+public class PreferenceStubActivity extends PreferenceActivity {
}
diff --git a/tests/src/android/text/format/cts/LocaleUtils.java b/tests/src/android/text/format/cts/LocaleUtils.java
new file mode 100644
index 0000000..d6001c4
--- /dev/null
+++ b/tests/src/android/text/format/cts/LocaleUtils.java
@@ -0,0 +1,35 @@
+/*
+ * 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 android.text.format.cts;
+
+import android.content.Context;
+
+import java.util.Locale;
+
+public class LocaleUtils {
+
+ /** Return whether or not the specified locale is available on the system. */
+ public static boolean isSupportedLocale(Context context, Locale locale) {
+ String[] locales = context.getAssets().getLocales();
+ for (String availableLocale : locales) {
+ if (locale.toString().equals(availableLocale)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java b/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java
index 1a857ea..e72e4db 100644
--- a/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java
+++ b/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java
@@ -1171,14 +1171,14 @@
public void testHasFeature()
throws IOException, AuthenticatorException, OperationCanceledException {
- testHasFeature(null /* handler */);
- testHasFeature(new Handler());
+ assertHasFeature(null /* handler */);
+ assertHasFeature(new Handler());
- testHasFeatureWithCallback(null /* handler */);
- testHasFeatureWithCallback(new Handler());
+ assertHasFeatureWithCallback(null /* handler */);
+ assertHasFeatureWithCallback(new Handler());
}
- public void testHasFeature(Handler handler)
+ private void assertHasFeature(Handler handler)
throws IOException, AuthenticatorException, OperationCanceledException {
Bundle resultBundle = addAccount(am,
ACCOUNT_TYPE,
@@ -1269,7 +1269,7 @@
}
}
- public void testHasFeatureWithCallback(Handler handler)
+ private void assertHasFeatureWithCallback(Handler handler)
throws IOException, AuthenticatorException, OperationCanceledException {
Bundle resultBundle = addAccount(am,
ACCOUNT_TYPE,
diff --git a/tests/tests/app/src/android/app/cts/DatePickerDialogTest.java b/tests/tests/app/src/android/app/cts/DatePickerDialogTest.java
deleted file mode 100644
index 140ccaa..0000000
--- a/tests/tests/app/src/android/app/cts/DatePickerDialogTest.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (C) 2008 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 android.app.cts;
-
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-import android.app.DatePickerDialog;
-import android.app.Instrumentation;
-import android.app.DatePickerDialog.OnDateSetListener;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.test.ActivityInstrumentationTestCase2;
-import android.text.TextUtils.TruncateAt;
-import android.view.KeyEvent;
-import android.widget.DatePicker;
-import android.widget.TextView;
-
-@TestTargetClass(DatePickerDialog.class)
-public class DatePickerDialogTest extends ActivityInstrumentationTestCase2<DialogStubActivity> {
-
- private Instrumentation mInstrumentation;
- private DialogStubActivity mActivity;
-
- public DatePickerDialogTest() {
- super("com.android.cts.stub", DialogStubActivity.class);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mInstrumentation = getInstrumentation();
- mActivity = getActivity();
- }
-
- @Override
- protected void tearDown() throws Exception {
- if (mActivity != null) {
- mActivity.finish();
- }
- super.tearDown();
- }
-
- @TestTargets({
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "DatePickerDialog",
- args = {Context.class, int.class, OnDateSetListener.class, int.class, int.class,
- int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onSaveInstanceState",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onClick",
- args = {DialogInterface.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onDateChanged",
- args = {DatePicker.class, int.class, int.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onRestoreInstanceState",
- args = {android.os.Bundle.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "show",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "updateDate",
- args = {int.class, int.class, int.class}
- )
- })
- @BrokenTest("assume layout of DatePickerDialog")
- public void testDatePickerDialogWithTheme() throws Exception {
- doTestDatePickerDialog(DialogStubActivity.TEST_DATEPICKERDIALOG_WITH_THEME);
- }
-
- @TestTargets({
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "DatePickerDialog",
- args = {Context.class, OnDateSetListener.class, int.class, int.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onSaveInstanceState",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onClick",
- args = {DialogInterface.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onDateChanged",
- args = {DatePicker.class, int.class, int.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onRestoreInstanceState",
- args = {android.os.Bundle.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "show",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "updateDate",
- args = {int.class, int.class, int.class}
- )
- })
- @BrokenTest("assume layout of DatePickerDialog")
- public void testDatePickerDialog() throws Exception {
- doTestDatePickerDialog(DialogStubActivity.TEST_DATEPICKERDIALOG);
- }
-
- private void doTestDatePickerDialog(int index) throws Exception {
- popDialog(index);
- final DatePickerDialog datePickerDialog = (DatePickerDialog) mActivity.getDialog();
- assertTrue(datePickerDialog.isShowing());
- final TextView title = (TextView) datePickerDialog.findViewById(
- com.android.internal.R.id.alertTitle);
- assertEquals(TruncateAt.END, title.getEllipsize());
-
- // move the focus to the 'set' button
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
- // move the focus up to the '-' button under the month
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_UP);
- // decrement the month (moves focus to date field)
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_ENTER);
- // move focus down to '-' button under the month
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
- // move focus down to 'set' button
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
- // click the 'set' button to accept changes
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_ENTER);
-
- mInstrumentation.waitForIdleSync();
- assertTrue(mActivity.onClickCalled);
- assertEquals(mActivity.updatedYear, mActivity.INITIAL_YEAR);
- assertEquals(mActivity.updatedMonth + 1, mActivity.INITIAL_MONTH);
- assertEquals(mActivity.updatedDay, mActivity.INITIAL_DAY_OF_MONTH);
- assertTrue(DialogStubActivity.onDateChangedCalled);
-
- assertFalse(mActivity.onSaveInstanceStateCalled);
- assertFalse(DialogStubActivity.onRestoreInstanceStateCalled);
- OrientationTestUtils.toggleOrientationSync(mActivity, mInstrumentation);
- assertTrue(mActivity.onSaveInstanceStateCalled);
- assertTrue(DialogStubActivity.onRestoreInstanceStateCalled);
- }
-
- private void popDialog(int index) {
- assertTrue(index > 0);
-
- while (index != 0) {
- sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
- index--;
- }
-
- sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
- }
-
-}
diff --git a/tests/tests/app/src/android/app/cts/ProfileFeaturesTest.java b/tests/tests/app/src/android/app/cts/ProfileFeaturesTest.java
deleted file mode 100644
index 328300f..0000000
--- a/tests/tests/app/src/android/app/cts/ProfileFeaturesTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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 android.app.cts;
-
-import android.annotation.cts.Profile;
-import android.annotation.cts.RequiredFeatures;
-import android.annotation.cts.SupportedProfiles;
-import android.content.pm.PackageManager;
-import android.test.AndroidTestCase;
-
-/**
- * Test for checking that devices with different profiles report the correct combination of
- * features mandated by the CDD.
- * <p>
- * It is also currently a demonstration of the {@link SupportedProfiles} and
- * {@link RequiredFeatures} annotations.
- */
-public class ProfileFeaturesTest extends AndroidTestCase {
-
- @SupportedProfiles(Profile.HANDHELD)
- public void testHandheldFeatures() {
- // TODO: Add tests to check that this handheld reports a correct combination of features.
- }
-
- @SupportedProfiles(Profile.STB)
- public void testStbFeatures() {
- // TODO: Add tests to check that the STB reports a correct combination of features.
- }
-
- @RequiredFeatures(PackageManager.FEATURE_TELEPHONY_CDMA)
- public void testRequiredFeatures() {
- // This is just a demonstration and compilation test of the RequiredFeatures annotation
- // that can be removed later when the annotation starts being used.
- }
-}
diff --git a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
index b865c75..ac3d03a 100644
--- a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
+++ b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
@@ -38,7 +38,6 @@
import java.lang.reflect.Field;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -114,7 +113,7 @@
assertAvailable(PackageManager.FEATURE_CAMERA);
Camera.Parameters params = camera.getParameters();
- if (!Parameters.FOCUS_MODE_FIXED.equals(params.getFocusMode())) {
+ if (params.getSupportedFocusModes().contains(Parameters.FOCUS_MODE_AUTO)) {
assertAvailable(PackageManager.FEATURE_CAMERA_AUTOFOCUS);
} else {
assertNotAvailable(PackageManager.FEATURE_CAMERA_AUTOFOCUS);
@@ -240,17 +239,19 @@
int phoneType = mTelephonyManager.getPhoneType();
switch (phoneType) {
case TelephonyManager.PHONE_TYPE_GSM:
- assertTelephonyFeatures(PackageManager.FEATURE_TELEPHONY,
- PackageManager.FEATURE_TELEPHONY_GSM);
+ assertAvailable(PackageManager.FEATURE_TELEPHONY);
+ assertAvailable(PackageManager.FEATURE_TELEPHONY_GSM);
break;
case TelephonyManager.PHONE_TYPE_CDMA:
- assertTelephonyFeatures(PackageManager.FEATURE_TELEPHONY,
- PackageManager.FEATURE_TELEPHONY_CDMA);
+ assertAvailable(PackageManager.FEATURE_TELEPHONY);
+ assertAvailable(PackageManager.FEATURE_TELEPHONY_CDMA);
break;
case TelephonyManager.PHONE_TYPE_NONE:
- assertTelephonyFeatures();
+ assertNotAvailable(PackageManager.FEATURE_TELEPHONY);
+ assertNotAvailable(PackageManager.FEATURE_TELEPHONY_CDMA);
+ assertNotAvailable(PackageManager.FEATURE_TELEPHONY_GSM);
break;
default:
@@ -258,40 +259,6 @@
}
}
- /**
- * Checks that the given features are enabled and also that all the other telephony features
- * are disabled.
- *
- * @param expectedFeaturesEnabled that {@link PackageManager} should report
- */
- private void assertTelephonyFeatures(String... expectedFeaturesEnabled) {
- // Create sets of enabled and disabled features.
- Set<String> enabledFeatures = new HashSet<String>();
- Collections.addAll(enabledFeatures, expectedFeaturesEnabled);
-
- Set<String> disabledFeatures = new HashSet<String>();
- Collections.addAll(disabledFeatures,
- PackageManager.FEATURE_TELEPHONY,
- PackageManager.FEATURE_TELEPHONY_GSM,
- PackageManager.FEATURE_TELEPHONY_CDMA);
- disabledFeatures.removeAll(enabledFeatures);
-
- // Get all available features to test not only hasFeature but getSystemAvailableFeatures.
- PackageManager packageManager = mContext.getPackageManager();
- Set<String> availableFeatures = new HashSet<String>();
- for (FeatureInfo featureInfo : packageManager.getSystemAvailableFeatures()) {
- availableFeatures.add(featureInfo.name);
- }
-
- for (String feature : enabledFeatures) {
- assertAvailable(feature);
- }
-
- for (String feature : disabledFeatures) {
- assertNotAvailable(feature);
- }
- }
-
public void testTouchScreenFeatures() {
ConfigurationInfo configInfo = mActivityManager.getDeviceConfigurationInfo();
if (configInfo.reqTouchScreen != Configuration.TOUCHSCREEN_NOTOUCH) {
diff --git a/tests/tests/content/src/android/content/cts/ContextWrapperTest.java b/tests/tests/content/src/android/content/cts/ContextWrapperTest.java
index 265ec06..ac402ef 100644
--- a/tests/tests/content/src/android/content/cts/ContextWrapperTest.java
+++ b/tests/tests/content/src/android/content/cts/ContextWrapperTest.java
@@ -54,13 +54,9 @@
import android.view.animation.cts.DelayedCheck;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
/**
@@ -353,111 +349,6 @@
mContextWrapper.unregisterReceiver(broadcastReceiver);
}
- @TestTargets({
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "fileList",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getFilesDir",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "openFileOutput",
- args = {String.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "deleteFile",
- args = {String.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "openFileInput",
- args = {String.class}
- )
- })
- @BrokenTest(value="bug 2323047")
- public void testAccessOfFiles() throws IOException, FileNotFoundException {
- int TEST_LENGTH = 10;
- String[] fileLst;
- ArrayList<String> filenameList = new ArrayList<String>();
- String filePath;
-
- // Test getFilesDir()
- filePath = mContextWrapper.getFilesDir().toString();
- assertNotNull(filePath);
-
- int originalNumFiles = mContextWrapper.fileList().length;
-
- // Build test datum
- byte[][] buffers = new byte[3][];
- for (int i = 0; i < 3; i++) {
- buffers[i] = new byte[TEST_LENGTH];
- Arrays.fill(buffers[i], (byte) (i + 1));
- }
-
- String tmpName = "";
- // Test openFileOutput
- FileOutputStream os = null;
- for (int i = 1; i < 4; i++) {
- try {
- tmpName = "contexttest" + i;
- os = mContextWrapper.openFileOutput(tmpName, ContextWrapper.MODE_WORLD_WRITEABLE);
- os.write(buffers[i - 1]);
- os.flush();
- filenameList.add(tmpName);
- } finally {
- if (null != os) {
- try {
- os.close();
- } catch (IOException e1) {
- }
- }
- }
- }
-
- byte[] testBuffer = new byte[TEST_LENGTH];
- // Test openFileInput(String)
- FileInputStream fileIS[] = { null, null, null };
- try {
- for (int i = 0; i < 3; i++) {
- fileIS[i] = mContextWrapper.openFileInput("contexttest" + (i + 1));
- assertNotNull(fileIS[i]);
- fileIS[i].read(testBuffer);
- assertTrue(Arrays.equals(buffers[i], testBuffer));
- }
- } finally {
- for (int i = 0; i < 3; i++) {
- if (null != fileIS[i]) {
- try {
- fileIS[i].close();
- } catch (IOException e1) {
- }
- }
- }
- }
-
- // Test fileList()
- fileLst = mContextWrapper.fileList();
- assertEquals(originalNumFiles + 3, fileLst.length);
-
- List<String> list = Arrays.asList(fileLst);
- assertTrue(list.contains("contexttest1"));
- assertTrue(list.contains("contexttest2"));
- assertTrue(list.contains("contexttest3"));
-
- for (String file: fileLst) {
- // Test deleteFile(String)
- assertTrue(mContextWrapper.deleteFile(file));
- }
- fileLst = mContextWrapper.fileList();
- assertEquals(originalNumFiles, fileLst.length);
- }
-
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "enforceCallingOrSelfPermission",
diff --git a/tests/tests/database/src/android/database/cts/DatabaseCursorTest.java b/tests/tests/database/src/android/database/cts/DatabaseCursorTest.java
index f60638a..9969f40 100644
--- a/tests/tests/database/src/android/database/cts/DatabaseCursorTest.java
+++ b/tests/tests/database/src/android/database/cts/DatabaseCursorTest.java
@@ -16,13 +16,6 @@
package android.database.cts;
-import dalvik.annotation.BrokenTest;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Random;
-
-import junit.framework.TestCase;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
@@ -40,9 +33,12 @@
import android.test.PerformanceTestCase;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
-import android.test.suitebuilder.annotation.Suppress;
import android.util.Log;
+import java.io.File;
+import java.util.Arrays;
+import java.util.Random;
+
public class DatabaseCursorTest extends AndroidTestCase implements PerformanceTestCase {
private static final String sString1 = "this is a test";
private static final String sString2 = "and yet another test";
@@ -370,59 +366,6 @@
}
}
- //@Large
- @Suppress
- public void testLoadingThreadDelayRegisterData() throws Exception {
- mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data INT);");
-
- final int count = 505;
- String sql = "INSERT INTO test (data) VALUES (?);";
- SQLiteStatement s = mDatabase.compileStatement(sql);
- for (int i = 0; i < count; i++) {
- s.bindLong(1, i);
- s.execute();
- }
-
- int maxRead = 500;
- int initialRead = 5;
- SQLiteCursor testCursor = (SQLiteCursor) mDatabase.rawQuery("select * from test;", null,
- initialRead, maxRead);
-
- TestObserver observer = new TestObserver(count, testCursor);
- testCursor.getCount();
- testCursor.registerDataSetObserver(observer);
- if (!observer.quit) {
- Looper.loop();
- }
- testCursor.close();
- }
-
- @LargeTest
- @BrokenTest("Consistently times out, even with count reduced to 30000")
- public void testLoadingThread() throws Exception {
- mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data INT);");
-
- final int count = 50000;
- String sql = "INSERT INTO test (data) VALUES (?);";
- SQLiteStatement s = mDatabase.compileStatement(sql);
- for (int i = 0; i < count; i++) {
- s.bindLong(1, i);
- s.execute();
- }
-
- int maxRead = 1000;
- int initialRead = 5;
- SQLiteCursor testCursor = (SQLiteCursor) mDatabase.rawQuery("select * from test;", null,
- initialRead, maxRead);
-
- TestObserver observer = new TestObserver(count, testCursor);
- testCursor.registerDataSetObserver(observer);
- testCursor.getCount();
-
- Looper.loop();
- testCursor.close();
- }
-
@LargeTest
public void testLoadingThreadClose() throws Exception {
mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data INT);");
diff --git a/tests/tests/graphics/src/android/graphics/cts/YuvImageTest.java b/tests/tests/graphics/src/android/graphics/cts/YuvImageTest.java
old mode 100644
new mode 100755
index ccacc62..6613e92
--- a/tests/tests/graphics/src/android/graphics/cts/YuvImageTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/YuvImageTest.java
@@ -245,9 +245,13 @@
Bitmap expected = null;
Bitmap actual = null;
boolean sameRect = rect1.equals(rect2) ? true : false;
- expected = Bitmap.createBitmap(testBitmap, rect1.left, rect1.top,
- rect1.width(), rect1.height());
- actual = compressDecompress(image, rect2);
+
+ Rect actualRect = new Rect(rect2);
+ actual = compressDecompress(image, actualRect);
+
+ Rect expectedRect = sameRect ? actualRect : rect1;
+ expected = Bitmap.createBitmap(testBitmap, expectedRect.left, expectedRect.top, expectedRect.width(), expectedRect.height());
+
compareBitmaps(expected, actual, mMseMargin, sameRect);
}
diff --git a/tests/tests/graphics/src/android/graphics/drawable/cts/InsetDrawableTest.java b/tests/tests/graphics/src/android/graphics/drawable/cts/InsetDrawableTest.java
index 6ca1806..32dc5ca 100644
--- a/tests/tests/graphics/src/android/graphics/drawable/cts/InsetDrawableTest.java
+++ b/tests/tests/graphics/src/android/graphics/drawable/cts/InsetDrawableTest.java
@@ -18,7 +18,6 @@
import com.android.cts.stub.R;
-import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargetNew;
@@ -305,15 +304,14 @@
method = "getOpacity",
args = {}
)
- @BrokenTest(value="bug 2397630 - needs investigation")
public void testGetOpacity() {
- Drawable d = mContext.getResources().getDrawable(R.drawable.pass);
+ Drawable d = mContext.getResources().getDrawable(R.drawable.testimage);
InsetDrawable insetDrawable = new InsetDrawable(d, 0);
+ insetDrawable.setAlpha(255);
assertEquals(PixelFormat.OPAQUE, insetDrawable.getOpacity());
- d = mContext.getResources().getDrawable(R.drawable.testimage);
- insetDrawable = new InsetDrawable(d, 0);
- assertEquals(PixelFormat.OPAQUE, insetDrawable.getOpacity());
+ insetDrawable.setAlpha(100);
+ assertEquals(PixelFormat.TRANSLUCENT, insetDrawable.getOpacity());
}
@TestTargetNew(
@@ -443,22 +441,6 @@
assertNotNull(constantState);
}
- @TestTargetNew(
- level = TestLevel.SUFFICIENT,
- method = "mutate",
- args = {}
- )
- public void testMutate() {
- Resources resources = mContext.getResources();
- InsetDrawable d1 = (InsetDrawable) resources.getDrawable(R.drawable.insetdrawable);
-
- d1.setAlpha(100);
- d1.mutate();
- d1.setAlpha(200);
-
- // Cannot test whether alpha was set properly.
- }
-
private class MockInsetDrawable extends InsetDrawable {
public MockInsetDrawable(Drawable drawable, int inset) {
super(drawable, inset);
diff --git a/tests/tests/hardware/src/android/hardware/cts/SensorManagerTest.java b/tests/tests/hardware/src/android/hardware/cts/SensorManagerTest.java
deleted file mode 100644
index 136d077..0000000
--- a/tests/tests/hardware/src/android/hardware/cts/SensorManagerTest.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Copyright (C) 2008 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 android.hardware.cts;
-
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.ToBeFixed;
-
-import android.content.Context;
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorListener;
-import android.hardware.SensorManager;
-import android.test.AndroidTestCase;
-import android.util.Log;
-
-import java.util.List;
-
-@SuppressWarnings("deprecation")
-@TestTargetClass(SensorManager.class)
-public class SensorManagerTest extends AndroidTestCase {
-
- private static final String TAG = "SensorManagerTest";
- private static final float[] GRAVITY = { 0, 0, SensorManager.GRAVITY_EARTH };
- private static final double TWO_PI = 2 * Math.PI;
- private static final int MATRIX = 9;
- private static final int VECTOR = 3;
- private static final int MAX_COUNT = 10;
- private static final long TIME_OUT = 10000;
- private static Object mSync;
- private static int mCounter;
- private static boolean mHasNotified;
- private static float[] mR;
- private static float[] mI;
- private static float[] mGeomagnetic;
- private static SensorManager mSensorManager;
-
- private static int[] mSensorListenerOnChangedSensor;
- private static float[][] mSensorListenerOnChangedValus;
- private static SensorEvent[] mSensorEvents;
-
- @SuppressWarnings("serial")
- private static class SensorTestTimeOutException extends Exception {
- public SensorTestTimeOutException() {
- super("Time out while waiting for sensor events. "
- + "Please move the device to generate events.");
- }
- }
-
- private static void waitForSensorEvent() throws InterruptedException,
- SensorTestTimeOutException {
- mCounter = 0;
- mHasNotified = false;
- synchronized (mSync) {
- if (!mHasNotified) {
- mSync.wait(TIME_OUT);
- }
- if (!mHasNotified) {
- throw new SensorTestTimeOutException();
- }
- }
- }
-
- private static void addSyncCount() {
- synchronized (mSync) {
- if (++mCounter >= MAX_COUNT) {
- mCounter = MAX_COUNT -1;
- mHasNotified = true;
- mSync.notify();
- }
- }
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mSensorManager = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);
- mR = new float[MATRIX];
- mI = new float[MATRIX];
- mGeomagnetic = new float[VECTOR];
- mSync = new Object();
- mSensorListenerOnChangedSensor = new int[MAX_COUNT];
- mSensorListenerOnChangedValus = new float[MAX_COUNT][];
- mSensorEvents = new SensorEvent[MAX_COUNT];
- }
-
- @TestTargets({
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getSensors",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "registerListener",
- args = {SensorListener.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "registerListener",
- args = {SensorListener.class, int.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "unregisterListener",
- args = {SensorListener.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "unregisterListener",
- args = {SensorListener.class, int.class}
- )
- })
- @ToBeFixed(bug="1852042", explanation="Error values in onSensorChanged() from system")
- @BrokenTest("Relies on earthquakes or user to generate sensor events")
- public void testSensorManagerOldAPIs() throws InterruptedException, SensorTestTimeOutException {
- assertEquals(SensorManager.SENSOR_ACCELEROMETER
- | SensorManager.SENSOR_MAGNETIC_FIELD
- | SensorManager.SENSOR_ORIENTATION
- | SensorManager.SENSOR_ORIENTATION_RAW,
- mSensorManager.getSensors());
-
- final SensorListener sensorListener = new SensorListener() {
-
- public void onAccuracyChanged(int sensor, int accuracy) {
- }
-
- public void onSensorChanged(int sensor, float[] values) {
- mSensorListenerOnChangedSensor[mCounter] = sensor;
- mSensorListenerOnChangedValus[mCounter] = values;
- if(sensor == SensorManager.SENSOR_ACCELEROMETER) {
- Log.d(TAG, "Deprecated Accelerometer value X="
- + values[0] + " Y=" + values[1] + " Z=" + values[2]);
- } else {
- Log.d(TAG, "Deprecated Orientation value X="
- + values[0] + " Y=" + values[1] + " Z=" + values[2]);
- }
- addSyncCount();
- }
- };
- mSensorManager.registerListener(sensorListener,
- SensorManager.SENSOR_ACCELEROMETER
- | SensorManager.SENSOR_ORIENTATION
- | SensorManager.SENSOR_ORIENTATION_RAW,
- SensorManager.SENSOR_DELAY_NORMAL);
- waitForSensorEvent();
-
- mSensorManager.unregisterListener(sensorListener, SensorManager.SENSOR_ACCELEROMETER);
- // Following should unregister sensorListener for all sensor type but it didn't.
- // So we unregisterListener by the other unregister method.
- // mSensorManager.unregisterListener(sensorListener);
- mSensorManager.unregisterListener(sensorListener, SensorManager.SENSOR_ORIENTATION |
- SensorManager.SENSOR_ORIENTATION_RAW);
- try {
- waitForSensorEvent();
- fail("SensorListener have been unregistered, shouldn't get any more sensor events.");
- } catch (SensorTestTimeOutException e) {
- // expected
- }
- }
-
- @TestTargets({
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getDefaultSensor",
- args = {int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getInclination",
- args = {float[].class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getOrientation",
- args = {float[].class, float[].class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getRotationMatrix",
- args = {float[].class, float[].class, float[].class, float[].class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getSensorList",
- args = {int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "registerListener",
- args = {SensorEventListener.class, Sensor.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "registerListener",
- args = {SensorEventListener.class, Sensor.class, int.class, android.os.Handler.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "remapCoordinateSystem",
- args = {float[].class, int.class, int.class, float[].class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "unregisterListener",
- args = {SensorEventListener.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "unregisterListener",
- args = {SensorEventListener.class, Sensor.class}
- )
- })
- @ToBeFixed(bug="1852042", explanation="Error values in onSensorChanged() from system")
- @BrokenTest("Relies on earthquakes or user to generate sensor events")
- public void testSensorManager() throws InterruptedException, SensorTestTimeOutException {
- final List<Sensor> sensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);
- assertNotNull(sensorList);
- Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
- assertEquals(Sensor.TYPE_ACCELEROMETER, sensor.getType());
- final SensorEventListener sensorAccListener = new SensorEventListener() {
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
- }
-
- public void onSensorChanged(SensorEvent event) {
- assertEquals(Sensor.TYPE_ACCELEROMETER, event.sensor.getType());
- Log.d(TAG, "Accelerometer value X="
- + event.values[0] + " Y=" + event.values[1] + " Z=" + event.values[2]);
- addSyncCount();
- }
- };
-
- mSensorManager.registerListener(sensorAccListener,
- sensor, SensorManager.SENSOR_DELAY_NORMAL);
- waitForSensorEvent();
-
- mSensorManager.unregisterListener(sensorAccListener);
- try {
- waitForSensorEvent();
- fail("SensorListener have been unregistered, shouldn't get any more sensor events.");
- } catch (SensorTestTimeOutException e) {
- // expected
- }
-
- sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
- assertEquals(Sensor.TYPE_MAGNETIC_FIELD, sensor.getType());
- final SensorEventListener sensorMagListener = new SensorEventListener() {
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
- }
-
- public void onSensorChanged(SensorEvent event) {
- mSensorEvents[mCounter] = event;
- Log.d(TAG, "Magnetic field value X="
- + event.values[0] + " Y=" + event.values[1] + " Z=" + event.values[2]);
- addSyncCount();
- }
- };
-
- mSensorManager.registerListener(sensorMagListener, sensor,
- SensorManager.SENSOR_DELAY_FASTEST, null);
- waitForSensorEvent();
- mSensorManager.unregisterListener(sensorMagListener, sensor);
-
- assertSensorEvents();
-
- assertTrue(SensorManager.remapCoordinateSystem(mR, SensorManager.AXIS_Y,
- SensorManager.AXIS_MINUS_X, mR));
- final float[] outR = new float[VECTOR];
- assertFalse(SensorManager.remapCoordinateSystem(mR, SensorManager.AXIS_Y,
- SensorManager.AXIS_MINUS_X, outR));
- }
-
- private static void assertSensorEvents() {
- for (int i = 0; i < MAX_COUNT; i++) {
- assertEquals(Sensor.TYPE_MAGNETIC_FIELD, mSensorEvents[i].sensor.getType());
- mGeomagnetic[0] = mSensorEvents[i].values[0];
- mGeomagnetic[1] = mSensorEvents[i].values[1];
- mGeomagnetic[2] = mSensorEvents[i].values[2];
-
- assertTrue(SensorManager.getRotationMatrix(mR, mI, GRAVITY, mGeomagnetic));
- float inclination = SensorManager.getInclination(mI);
- assertTrue(Math.abs(inclination) <= TWO_PI);
- float[] values = new float[3];
- float[] orientation = SensorManager.getOrientation(mR, values);
- assertTrue(Math.abs(orientation[0]) <= TWO_PI);
- assertTrue(Math.abs(orientation[1]) <= TWO_PI);
- assertTrue(Math.abs(orientation[2]) <= TWO_PI);
- }
- }
-}
diff --git a/tests/tests/media/src/android/media/cts/AudioManagerTest.java b/tests/tests/media/src/android/media/cts/AudioManagerTest.java
index 3558fa3..3de8a51 100644
--- a/tests/tests/media/src/android/media/cts/AudioManagerTest.java
+++ b/tests/tests/media/src/android/media/cts/AudioManagerTest.java
@@ -27,9 +27,6 @@
import static android.media.AudioManager.RINGER_MODE_NORMAL;
import static android.media.AudioManager.RINGER_MODE_SILENT;
import static android.media.AudioManager.RINGER_MODE_VIBRATE;
-import static android.media.AudioManager.ROUTE_BLUETOOTH_SCO;
-import static android.media.AudioManager.ROUTE_EARPIECE;
-import static android.media.AudioManager.ROUTE_SPEAKER;
import static android.media.AudioManager.STREAM_MUSIC;
import static android.media.AudioManager.USE_DEFAULT_STREAM_TYPE;
import static android.media.AudioManager.VIBRATE_SETTING_OFF;
@@ -584,6 +581,13 @@
assertTrue(mAudioManager.getRingerMode() == RINGER_MODE_VIBRATE ||
mAudioManager.getRingerMode() == RINGER_MODE_SILENT);
mAudioManager.adjustStreamVolume(streams[i], ADJUST_RAISE, FLAG_ALLOW_RINGER_MODES);
+ // There are two possible ways the device may work. It may have a silent/vibrate
+ // mode or it may have distinct silent and vibrate modes.
+ assertTrue(mAudioManager.getRingerMode() == RINGER_MODE_NORMAL ||
+ mAudioManager.getRingerMode() == RINGER_MODE_VIBRATE);
+ // Increase the volume one more time to get out of the vibrate mode which may
+ // be separate from silent mode.
+ mAudioManager.adjustStreamVolume(streams[i], ADJUST_RAISE, FLAG_ALLOW_RINGER_MODES);
assertEquals(RINGER_MODE_NORMAL, mAudioManager.getRingerMode());
}
diff --git a/tests/tests/media/src/android/media/cts/RingtoneManagerTest.java b/tests/tests/media/src/android/media/cts/RingtoneManagerTest.java
index 31aab6d..dcc45c3 100644
--- a/tests/tests/media/src/android/media/cts/RingtoneManagerTest.java
+++ b/tests/tests/media/src/android/media/cts/RingtoneManagerTest.java
@@ -63,9 +63,7 @@
mOriginalVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_RING);
mDefaultUri = RingtoneManager.getActualDefaultRingtoneUri(mContext,
RingtoneManager.TYPE_RINGTONE);
- // set ringer to a reasonable volume
- int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_RING);
- mAudioManager.setStreamVolume(AudioManager.STREAM_RING, maxVolume / 2,
+ mAudioManager.adjustStreamVolume(AudioManager.STREAM_RING, AudioManager.ADJUST_RAISE,
AudioManager.FLAG_ALLOW_RINGER_MODES);
}
diff --git a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
index edcea9a..354428b 100644
--- a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
+++ b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
@@ -204,8 +204,8 @@
NetworkInfo[] ni = mCm.getAllNetworkInfo();
for (NetworkInfo n : ni) {
- // make sure network is up
- if (n.isConnected()) {
+ // make sure network is up (except WIFI due to always fail)
+ if (n.isConnected() && (n.getType() != TYPE_WIFI)) {
assertTrue(mCm.requestRouteToHost(n.getType(), HOST_ADDRESS));
}
}
diff --git a/tests/tests/net/src/android/net/cts/ProxyTest.java b/tests/tests/net/src/android/net/cts/ProxyTest.java
index 357935a..0c0586e 100644
--- a/tests/tests/net/src/android/net/cts/ProxyTest.java
+++ b/tests/tests/net/src/android/net/cts/ProxyTest.java
@@ -16,29 +16,17 @@
package android.net.cts;
-import android.content.Context;
-import android.net.Proxy;
-import android.provider.Settings.Secure;
-import android.test.AndroidTestCase;
-
-import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargetNew;
import dalvik.annotation.TestTargets;
+import android.net.Proxy;
+import android.test.AndroidTestCase;
+
@TestTargetClass(Proxy.class)
public class ProxyTest extends AndroidTestCase {
- private Context mContext;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- mContext = getContext();
- }
-
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "Proxy",
@@ -58,19 +46,8 @@
level = TestLevel.COMPLETE,
method = "getDefaultHost",
args = {}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getPort",
- args = {Context.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getHost",
- args = {Context.class}
)
})
- @BrokenTest("Cannot write secure settings table")
public void testAccessProperties() {
final int minValidPort = 0;
final int maxValidPort = 65535;
@@ -80,12 +57,5 @@
} else {
assertTrue(defaultPort >= minValidPort && defaultPort <= maxValidPort);
}
-
- final String host = "proxy.example.com";
- final int port = 2008;
-
- Secure.putString(mContext.getContentResolver(), Secure.HTTP_PROXY, host + ":" + port);
- assertEquals(host, Proxy.getHost(mContext));
- assertEquals(port, Proxy.getPort(mContext));
}
}
diff --git a/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java b/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java
index 132ca92..e2a583b 100644
--- a/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java
@@ -16,7 +16,10 @@
package android.net.wifi.cts;
-import java.util.List;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.TestTargets;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -28,10 +31,11 @@
import android.net.wifi.WifiConfiguration.Status;
import android.net.wifi.WifiManager.WifiLock;
import android.test.AndroidTestCase;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
+import android.util.Log;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
@TestTargetClass(WifiManager.class)
public class WifiManagerTest extends AndroidTestCase {
@@ -341,58 +345,87 @@
)
})
public void testWifiManagerNetWork() throws Exception {
- WifiConfiguration wifiConfiguration;
- // add a WifiConfig
- final int notExist = -1;
- List<WifiConfiguration> wifiConfiguredNetworks = mWifiManager.getConfiguredNetworks();
- int pos = findConfiguredNetworks(SSID1, wifiConfiguredNetworks);
- if (notExist != pos) {
+ // store the list of enabled networks, so they can be re-enabled after test completes
+ Set<String> enabledSsids = getEnabledNetworks(mWifiManager.getConfiguredNetworks());
+ try {
+ WifiConfiguration wifiConfiguration;
+ // add a WifiConfig
+ final int notExist = -1;
+ List<WifiConfiguration> wifiConfiguredNetworks = mWifiManager.getConfiguredNetworks();
+ int pos = findConfiguredNetworks(SSID1, wifiConfiguredNetworks);
+ if (notExist != pos) {
+ wifiConfiguration = wifiConfiguredNetworks.get(pos);
+ mWifiManager.removeNetwork(wifiConfiguration.networkId);
+ }
+ pos = findConfiguredNetworks(SSID1, wifiConfiguredNetworks);
+ assertEquals(notExist, pos);
+ final int size = wifiConfiguredNetworks.size();
+
+ wifiConfiguration = new WifiConfiguration();
+ wifiConfiguration.SSID = SSID1;
+ int netId = mWifiManager.addNetwork(wifiConfiguration);
+ assertTrue(existSSID(SSID1));
+
+ wifiConfiguredNetworks = mWifiManager.getConfiguredNetworks();
+ assertEquals(size + 1, wifiConfiguredNetworks.size());
+ pos = findConfiguredNetworks(SSID1, wifiConfiguredNetworks);
+ assertTrue(notExist != pos);
+
+ // Enable & disable network
+ boolean disableOthers = false;
+ assertTrue(mWifiManager.enableNetwork(netId, disableOthers));
+ wifiConfiguration = mWifiManager.getConfiguredNetworks().get(pos);
+ assertDisableOthers(wifiConfiguration, disableOthers);
+ assertEquals(Status.ENABLED, wifiConfiguration.status);
+ disableOthers = true;
+
+ assertTrue(mWifiManager.enableNetwork(netId, disableOthers));
+ wifiConfiguration = mWifiManager.getConfiguredNetworks().get(pos);
+ assertDisableOthers(wifiConfiguration, disableOthers);
+
+ assertTrue(mWifiManager.disableNetwork(netId));
+ wifiConfiguration = mWifiManager.getConfiguredNetworks().get(pos);
+ assertEquals(Status.DISABLED, wifiConfiguration.status);
+
+ // Update a WifiConfig
wifiConfiguration = wifiConfiguredNetworks.get(pos);
- mWifiManager.removeNetwork(wifiConfiguration.networkId);
+ wifiConfiguration.SSID = SSID2;
+ netId = mWifiManager.updateNetwork(wifiConfiguration);
+ assertFalse(existSSID(SSID1));
+ assertTrue(existSSID(SSID2));
+
+ // Remove a WifiConfig
+ assertTrue(mWifiManager.removeNetwork(netId));
+ assertFalse(mWifiManager.removeNetwork(notExist));
+ assertFalse(existSSID(SSID1));
+ assertFalse(existSSID(SSID2));
+
+ assertTrue(mWifiManager.saveConfiguration());
+ } finally {
+ reEnableNetworks(enabledSsids, mWifiManager.getConfiguredNetworks());
+ mWifiManager.saveConfiguration();
}
- pos = findConfiguredNetworks(SSID1, wifiConfiguredNetworks);
- assertEquals(notExist, pos);
- final int size = wifiConfiguredNetworks.size();
+ }
- wifiConfiguration = new WifiConfiguration();
- wifiConfiguration.SSID = SSID1;
- int netId = mWifiManager.addNetwork(wifiConfiguration);
- assertTrue(existSSID(SSID1));
+ private Set<String> getEnabledNetworks(List<WifiConfiguration> configuredNetworks) {
+ Set<String> ssids = new HashSet<String>();
+ for (WifiConfiguration wifiConfig : configuredNetworks) {
+ if (Status.ENABLED == wifiConfig.status || Status.CURRENT == wifiConfig.status) {
+ ssids.add(wifiConfig.SSID);
+ Log.i(TAG, String.format("remembering enabled network %s", wifiConfig.SSID));
+ }
+ }
+ return ssids;
+ }
- wifiConfiguredNetworks = mWifiManager.getConfiguredNetworks();
- assertEquals(size + 1, wifiConfiguredNetworks.size());
- pos = findConfiguredNetworks(SSID1, wifiConfiguredNetworks);
- assertTrue(notExist != pos);
-
- // Enable & disable network
- boolean disableOthers = false;
- assertTrue(mWifiManager.enableNetwork(netId, disableOthers));
- wifiConfiguration = mWifiManager.getConfiguredNetworks().get(pos);
- assertDisableOthers(wifiConfiguration, disableOthers);
- assertEquals(Status.ENABLED, wifiConfiguration.status);
- disableOthers = true;
- assertTrue(mWifiManager.enableNetwork(netId, disableOthers));
- wifiConfiguration = mWifiManager.getConfiguredNetworks().get(pos);
- assertDisableOthers(wifiConfiguration, disableOthers);
-
- assertTrue(mWifiManager.disableNetwork(netId));
- wifiConfiguration = mWifiManager.getConfiguredNetworks().get(pos);
- assertEquals(Status.DISABLED, wifiConfiguration.status);
-
- // Update a WifiConfig
- wifiConfiguration = wifiConfiguredNetworks.get(pos);
- wifiConfiguration.SSID = SSID2;
- netId = mWifiManager.updateNetwork(wifiConfiguration);
- assertFalse(existSSID(SSID1));
- assertTrue(existSSID(SSID2));
-
- // Remove a WifiConfig
- assertTrue(mWifiManager.removeNetwork(netId));
- assertFalse(mWifiManager.removeNetwork(notExist));
- assertFalse(existSSID(SSID1));
- assertFalse(existSSID(SSID2));
-
- assertTrue(mWifiManager.saveConfiguration());
+ private void reEnableNetworks(Set<String> enabledSsids,
+ List<WifiConfiguration> configuredNetworks) {
+ for (WifiConfiguration wifiConfig : configuredNetworks) {
+ if (enabledSsids.contains(wifiConfig.SSID)) {
+ mWifiManager.enableNetwork(wifiConfig.networkId, false);
+ Log.i(TAG, String.format("re-enabling network %s", wifiConfig.SSID));
+ }
+ }
}
@TestTargets({
diff --git a/tests/tests/os/src/android/os/cts/BuildTest.java b/tests/tests/os/src/android/os/cts/BuildTest.java
index ada90ee..62abc5a 100644
--- a/tests/tests/os/src/android/os/cts/BuildTest.java
+++ b/tests/tests/os/src/android/os/cts/BuildTest.java
@@ -107,7 +107,7 @@
}
private static final Pattern DEVICE_PATTERN =
- Pattern.compile("^([0-9a-z_]+)$");
+ Pattern.compile("^([0-9A-Za-z_-]+)$");
/** Tests that check for valid values of constants in Build. */
public void testBuildConstants() {
diff --git a/tests/tests/os/src/android/os/cts/BuildVersionTest.java b/tests/tests/os/src/android/os/cts/BuildVersionTest.java
index e353be9..61e1837 100644
--- a/tests/tests/os/src/android/os/cts/BuildVersionTest.java
+++ b/tests/tests/os/src/android/os/cts/BuildVersionTest.java
@@ -27,7 +27,7 @@
public class BuildVersionTest extends TestCase {
private static final String LOG_TAG = "BuildVersionTest";
- private static final String EXPECTED_RELEASE = "2.2";
+ private static final String EXPECTED_RELEASE = "2.2.1";
private static final String EXPECTED_SDK = "8";
public void testReleaseVersion() {
diff --git a/tests/tests/os/src/android/os/cts/FileAccessPermissionTest.java b/tests/tests/os/src/android/os/cts/FileAccessPermissionTest.java
old mode 100644
new mode 100755
index cb1f0ab..c5418bc
--- a/tests/tests/os/src/android/os/cts/FileAccessPermissionTest.java
+++ b/tests/tests/os/src/android/os/cts/FileAccessPermissionTest.java
@@ -21,6 +21,7 @@
import java.io.File;
import java.io.FileInputStream;
+import java.io.FilenameFilter;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -63,15 +64,33 @@
file = new File("/system/app");
assertTrue(file.canRead());
assertFalse(file.canWrite());
- File[] apkFiles = file.listFiles();
- for (File f : apkFiles) {
- assertTrue(f.canRead());
+
+ // Test not writable / deletable for all files
+ File[] allFiles = file.listFiles();
+ for (File f : allFiles) {
assertFalse(f.canWrite());
assertFalse(f.delete());
}
}
/**
+ * Test apks in /system/app.
+ */
+ public void testApksAlwaysReadable() {
+ File file = new File("/system/app");
+
+ // Test readable for only apk files
+ File[] apkFiles = file.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String filename) {
+ return filename.endsWith(".apk");
+ }
+ });
+ for (File f : apkFiles) {
+ assertTrue(f.canRead());
+ }
+ }
+
+ /**
* Test dir which app can and cannot access.
*/
public void testAccessAppDataDir() {
diff --git a/tests/tests/performance/src/android/performance/cts/MultiAppStartupTest.java b/tests/tests/performance/src/android/performance/cts/MultiAppStartupTest.java
index d102497..a736d89 100644
--- a/tests/tests/performance/src/android/performance/cts/MultiAppStartupTest.java
+++ b/tests/tests/performance/src/android/performance/cts/MultiAppStartupTest.java
@@ -17,19 +17,10 @@
package android.performance.cts;
import android.app.Activity;
-import android.app.ActivityManager;
-import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.content.Intent;
-import android.os.Handler;
import android.test.InstrumentationTestCase;
-
-import java.lang.Runnable;
-import java.lang.String;
-import java.lang.System;
-import java.util.List;
-
public class MultiAppStartupTest extends InstrumentationTestCase {
private static final String PACKAGE_UNDER_TEST = "com.android.calculator2";
private static final String ACTIVITY_UNDER_TEST = "Calculator";
@@ -80,14 +71,10 @@
Thread.sleep(ACTIVITY_STARTUP_WAIT_TIME);
launchActivity("com.android.mms", "ui.ConversationList", true);
Thread.sleep(ACTIVITY_STARTUP_WAIT_TIME);
- launchActivity("com.android.alarmclock", "AlarmClock", true);
- Thread.sleep(ACTIVITY_STARTUP_WAIT_TIME);
launchActivity("com.android.contacts", "TwelveKeyDialer", false);
Thread.sleep(ACTIVITY_STARTUP_WAIT_TIME);
launchActivity("com.android.contacts", "RecentCallsListActivity", false);
Thread.sleep(ACTIVITY_STARTUP_WAIT_TIME);
- launchActivity("com.android.calendar", "LaunchActivity", true);
- Thread.sleep(ACTIVITY_STARTUP_WAIT_TIME);
long finalStartDuration = launchActivityUnderTest();
diff --git a/tests/tests/permission/src/android/permission/cts/DebuggableTest.java b/tests/tests/permission/src/android/permission/cts/DebuggableTest.java
new file mode 100644
index 0000000..58751a5
--- /dev/null
+++ b/tests/tests/permission/src/android/permission/cts/DebuggableTest.java
@@ -0,0 +1,52 @@
+/*
+ * 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 android.permission.cts;
+
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.test.AndroidTestCase;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Verify that pre-installed packages don't have the debuggable
+ * flag set. The debuggable flag allows should only be used during
+ * development, and never for shipping devices.
+ */
+public class DebuggableTest extends AndroidTestCase {
+
+ // Remove whitelist in future release.
+ private static final Set<String> WHITELISTED_APPS = new HashSet<String>(Arrays.asList(
+ "com.google.android.apps.uploader"
+ ));
+
+ public void testNoDebuggable() {
+ List<ApplicationInfo> apps = getContext()
+ .getPackageManager()
+ .getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
+ for (ApplicationInfo app : apps) {
+ String appName = app.packageName;
+ if (!WHITELISTED_APPS.contains(appName)) {
+ assertTrue("Package " + appName + " is marked as debuggable.",
+ (app.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0);
+ }
+ }
+ }
+}
diff --git a/tests/tests/preference/Android.mk b/tests/tests/preference/Android.mk
new file mode 100644
index 0000000..886c166
--- /dev/null
+++ b/tests/tests/preference/Android.mk
@@ -0,0 +1,33 @@
+# 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.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
+
+LOCAL_JAVA_LIBRARIES := android.test.runner
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := CtsPreferenceTestCases
+
+LOCAL_INSTRUMENTATION_FOR := CtsTestStubs
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
diff --git a/tests/tests/preference/AndroidManifest.xml b/tests/tests/preference/AndroidManifest.xml
new file mode 100644
index 0000000..af57c86
--- /dev/null
+++ b/tests/tests/preference/AndroidManifest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * 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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.cts.preference">
+
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <instrumentation android:name="android.test.InstrumentationCtsTestRunner"
+ android:targetPackage="com.android.cts.stub"
+ android:label="CTS tests of android.os"/>
+
+</manifest>
+
diff --git a/tests/tests/preference/src/android/preference/cts/PreferenceActivityTest.java b/tests/tests/preference/src/android/preference/cts/PreferenceActivityTest.java
new file mode 100644
index 0000000..b0d5448
--- /dev/null
+++ b/tests/tests/preference/src/android/preference/cts/PreferenceActivityTest.java
@@ -0,0 +1,72 @@
+/*
+ * 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 android.preference.cts;
+
+import com.android.cts.stub.R;
+
+import android.content.Intent;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceManager;
+import android.preference.PreferenceScreen;
+import android.test.ActivityInstrumentationTestCase2;
+
+public class PreferenceActivityTest
+ extends ActivityInstrumentationTestCase2<PreferenceStubActivity> {
+
+ private PreferenceActivity mActivity;
+
+ public PreferenceActivityTest() {
+ super(PreferenceStubActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mActivity = getActivity();
+ }
+
+ public void testAddPreferencesFromIntent() {
+ assertNull(mActivity.findPreference("check_box_preference_from_intent"));
+
+ Intent intent = new Intent(mActivity, PreferenceStubActivity.class);
+ mActivity.addPreferencesFromIntent(intent);
+
+ assertNotNull(mActivity.findPreference("check_box_preference_from_intent"));
+ }
+
+ public void testAddPreferencesFromResource() {
+ assertNull(mActivity.findPreference("check_box_preference_from_resource"));
+
+ mActivity.addPreferencesFromResource(R.xml.preferences_from_resource);
+
+ assertNotNull(mActivity.findPreference("check_box_preference_from_resource"));
+ }
+
+ public void testGetPreferenceManager() {
+ assertNotNull(mActivity.getPreferenceManager());
+ }
+
+ public void testGetPreferenceScreen() {
+ assertNull(mActivity.getPreferenceScreen());
+
+ PreferenceManager prefManager = mActivity.getPreferenceManager();
+ PreferenceScreen prefScreen = prefManager.createPreferenceScreen(mActivity);
+ mActivity.setPreferenceScreen(prefScreen);
+
+ assertEquals(prefScreen, mActivity.getPreferenceScreen());
+ }
+}
\ No newline at end of file
diff --git a/tests/tests/provider/src/android/provider/cts/SettingsTest.java b/tests/tests/provider/src/android/provider/cts/SettingsTest.java
index e3ca242..3a789d1 100644
--- a/tests/tests/provider/src/android/provider/cts/SettingsTest.java
+++ b/tests/tests/provider/src/android/provider/cts/SettingsTest.java
@@ -16,7 +16,6 @@
package android.provider.cts;
-import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestTargetClass;
import android.content.ContentResolver;
@@ -169,50 +168,25 @@
}
}
- @BrokenTest("Cannot access secure settings table")
- public void testSecureTable() throws RemoteException {
+ public void testSecureTable() throws Exception {
final String[] SECURE_PROJECTION = new String[] {
Settings.Secure._ID, Settings.Secure.NAME, Settings.Secure.VALUE
};
- String insertName = "name_insert";
- String insertValue = "value_insert";
-
- // get provider
ContentResolver cr = mContext.getContentResolver();
IContentProvider provider = cr.acquireProvider(Settings.Secure.CONTENT_URI);
+ assertNotNull(provider);
- // Test: insert
- ContentValues value = new ContentValues();
- value.put(Settings.Secure.NAME, insertName);
- value.put(Settings.Secure.VALUE, insertValue);
-
- provider.insert(Settings.Secure.CONTENT_URI, value);
-
+ // Test that the secure table can be read from.
Cursor cursor = null;
try {
cursor = provider.query(Settings.Secure.CONTENT_URI, SECURE_PROJECTION,
- Settings.Secure.NAME + "=\"" + insertName + "\"", null, null);
+ Settings.Secure.NAME + "=\"" + Settings.Secure.ADB_ENABLED + "\"", null, null);
assertNotNull(cursor);
- assertEquals(1, cursor.getCount());
} finally {
- // TODO should clean up more better
- if (cursor != null)
+ if (cursor != null) {
cursor.close();
- }
-
- try {
- provider.delete(Settings.Secure.CONTENT_URI,
- Settings.Secure.NAME + "=\"" + insertName + "\"", null);
-
- cursor = provider.query(Settings.Secure.CONTENT_URI, SECURE_PROJECTION,
- Settings.Secure.NAME + "=\"" + insertName + "\"", null, null);
- assertNotNull(cursor);
- assertEquals(0, cursor.getCount());
- } finally {
- // TODO should clean up more better
- if (cursor != null)
- cursor.close();
+ }
}
}
diff --git a/tests/tests/provider/src/android/provider/cts/Settings_SecureTest.java b/tests/tests/provider/src/android/provider/cts/Settings_SecureTest.java
index 7cd586a..6ce4157 100644
--- a/tests/tests/provider/src/android/provider/cts/Settings_SecureTest.java
+++ b/tests/tests/provider/src/android/provider/cts/Settings_SecureTest.java
@@ -16,14 +16,12 @@
package android.provider.cts;
-import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargetNew;
import dalvik.annotation.TestTargets;
import android.content.ContentResolver;
-import android.database.Cursor;
import android.net.Uri;
import android.provider.Settings.Secure;
import android.provider.Settings.SettingNotFoundException;
@@ -31,6 +29,15 @@
@TestTargetClass(android.provider.Settings.Secure.class)
public class Settings_SecureTest extends AndroidTestCase {
+
+ private static final String NO_SUCH_SETTING = "NoSuchSetting";
+
+ /**
+ * Setting that will have a string value to trigger SettingNotFoundException caused by
+ * NumberFormatExceptions for getInt, getFloat, and getLong.
+ */
+ private static final String STRING_VALUE_SETTING = Secure.ENABLED_ACCESSIBILITY_SERVICES;
+
private ContentResolver cr;
@Override
@@ -39,124 +46,19 @@
cr = mContext.getContentResolver();
assertNotNull(cr);
+ assertSettingsForTests();
}
- @TestTargets({
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "putInt",
- args = {android.content.ContentResolver.class, java.lang.String.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "putLong",
- args = {android.content.ContentResolver.class, java.lang.String.class, long.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "putFloat",
- args = {android.content.ContentResolver.class, java.lang.String.class, float.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "putString",
- args = {android.content.ContentResolver.class, java.lang.String.class,
- java.lang.String.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getInt",
- args = {android.content.ContentResolver.class, java.lang.String.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getLong",
- args = {android.content.ContentResolver.class, java.lang.String.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getFloat",
- args = {android.content.ContentResolver.class, java.lang.String.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getString",
- args = {android.content.ContentResolver.class, java.lang.String.class}
- )
- })
- @BrokenTest("Cannot access secure settings table")
- public void testSecureSettings() throws SettingNotFoundException {
- /**
- * first query the exist settings in Secure table, and then insert four rows:
- * an int, a long, a float and a String. Get these four rows to check whether
- * insert success and then delete these four rows. At last backup an exist row,
- * update it, then check whether update success.
- */
- // first query exist rows
- Cursor c = cr.query(Secure.CONTENT_URI, null, null, null, null);
+ /** Check that the settings that will be used for testing have proper values. */
+ private void assertSettingsForTests() {
+ assertNull(Secure.getString(cr, NO_SUCH_SETTING));
+
+ String value = Secure.getString(cr, STRING_VALUE_SETTING);
+ assertNotNull(value);
try {
- assertNotNull(c);
- int count = c.getCount();
- c.close();
-
- // insert four rows
- assertTrue(Secure.putInt(cr, "IntField", 10));
- assertTrue(Secure.putLong(cr, "LongField", 20));
- assertTrue(Secure.putFloat(cr, "FloatField", 30));
- assertTrue(Secure.putString(cr, "StringField", "cts"));
-
- c = cr.query(Secure.CONTENT_URI, null, null, null, null);
- assertNotNull(c);
- assertEquals(count + 4, c.getCount());
- c.close();
-
- // get these four rows
- assertEquals(10, Secure.getInt(cr, "IntField"));
- assertEquals(20, Secure.getLong(cr, "LongField"));
- assertEquals(30.0f, Secure.getFloat(cr, "FloatField"), 0.001);
- assertEquals("cts", Secure.getString(cr, "StringField"));
-
- // delete these rows
- String selection = Secure.NAME + "=\"" + "IntField" + "\"";
- cr.delete(Secure.CONTENT_URI, selection, null);
-
- selection = Secure.NAME + "=\"" + "LongField" + "\"";
- cr.delete(Secure.CONTENT_URI, selection, null);
-
- selection = Secure.NAME + "=\"" + "FloatField" + "\"";
- cr.delete(Secure.CONTENT_URI, selection, null);
-
- selection = Secure.NAME + "=\"" + "StringField" + "\"";
- cr.delete(Secure.CONTENT_URI, selection, null);
-
- c = cr.query(Secure.CONTENT_URI, null, null, null, null);
- assertNotNull(c);
- assertEquals(count, c.getCount());
- c.close();
-
- // update an exist row, backup the value first
- selection = "name=\""+ Secure.BLUETOOTH_ON + "\"";
- c = cr.query(Secure.CONTENT_URI, null, selection, null, null);
- assertNotNull(c);
- assertEquals(1, c.getCount());
- c.moveToFirst();
- String name = c.getString(c.getColumnIndexOrThrow(Secure.NAME));
- String store = Secure.getString(cr, name);
- c.close();
-
- // update this row and check
- assertTrue(Secure.putString(cr, name, "1"));
- assertEquals("1", Secure.getString(cr, name));
-
- c = cr.query(Secure.CONTENT_URI, null, null, null, null);
- assertNotNull(c);
- assertEquals(count, c.getCount()); // here means no row added, just update
-
- // restore the value
- assertTrue(Secure.putString(cr, name, store));
- } finally {
- // TODO should clean up more better
- c.close();
+ Integer.parseInt(value);
+ fail("Shouldn't be able to parse this setting's value for later tests.");
+ } catch (NumberFormatException expected) {
}
}
@@ -183,6 +85,87 @@
assertEquals(30.0f, Secure.getFloat(cr, "float", 30), 0.001);
}
+ public void testGetPutInt() {
+ assertNull(Secure.getString(cr, NO_SUCH_SETTING));
+
+ try {
+ Secure.putInt(cr, NO_SUCH_SETTING, -1);
+ fail("SecurityException should have been thrown!");
+ } catch (SecurityException expected) {
+ }
+
+ try {
+ Secure.getInt(cr, NO_SUCH_SETTING);
+ fail("SettingNotFoundException should have been thrown!");
+ } catch (SettingNotFoundException expected) {
+ }
+
+ try {
+ Secure.getInt(cr, STRING_VALUE_SETTING);
+ fail("SettingNotFoundException should have been thrown!");
+ } catch (SettingNotFoundException expected) {
+ }
+ }
+
+ public void testGetPutFloat() throws SettingNotFoundException {
+ assertNull(Secure.getString(cr, NO_SUCH_SETTING));
+
+ try {
+ Secure.putFloat(cr, NO_SUCH_SETTING, -1);
+ fail("SecurityException should have been thrown!");
+ } catch (SecurityException expected) {
+ }
+
+ // TODO: Should be fixed to throw SettingNotFoundException.
+ try {
+ Secure.getFloat(cr, NO_SUCH_SETTING);
+ fail("NullPointerException should have been thrown!");
+ } catch (NullPointerException expected) {
+ }
+
+ try {
+ Secure.getFloat(cr, STRING_VALUE_SETTING);
+ fail("SettingNotFoundException should have been thrown!");
+ } catch (SettingNotFoundException expected) {
+ }
+ }
+
+ public void testGetPutLong() {
+ assertNull(Secure.getString(cr, NO_SUCH_SETTING));
+
+ try {
+ Secure.putLong(cr, NO_SUCH_SETTING, -1);
+ fail("SecurityException should have been thrown!");
+ } catch (SecurityException expected) {
+ }
+
+ try {
+ Secure.getLong(cr, NO_SUCH_SETTING);
+ fail("SettingNotFoundException should have been thrown!");
+ } catch (SettingNotFoundException expected) {
+ }
+
+ try {
+ Secure.getLong(cr, STRING_VALUE_SETTING);
+ fail("SettingNotFoundException should have been thrown!");
+ } catch (SettingNotFoundException expected) {
+ }
+ }
+
+ public void testGetPutString() {
+ assertNull(Secure.getString(cr, NO_SUCH_SETTING));
+
+ try {
+ Secure.putString(cr, NO_SUCH_SETTING, "-1");
+ fail("SecurityException should have been thrown!");
+ } catch (SecurityException expected) {
+ }
+
+ assertNotNull(Secure.getString(cr, STRING_VALUE_SETTING));
+
+ assertNull(Secure.getString(cr, NO_SUCH_SETTING));
+ }
+
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "getUriFor",
diff --git a/tests/tests/telephony/src/android/telephony/cts/PhoneNumberUtilsTest.java b/tests/tests/telephony/src/android/telephony/cts/PhoneNumberUtilsTest.java
index 5e45e67..57e610b 100644
--- a/tests/tests/telephony/src/android/telephony/cts/PhoneNumberUtilsTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/PhoneNumberUtilsTest.java
@@ -159,84 +159,6 @@
}
}
- /**
- * Tests which must be successful both in compareLoosely() and in compareStrictly().
- */
- private void testCompareCommon(final boolean strict) {
- assertTrue(PhoneNumberUtils.compare(null, null, strict));
- assertFalse(PhoneNumberUtils.compare(null, "", strict));
- assertFalse(PhoneNumberUtils.compare("", null, strict));
- assertFalse(PhoneNumberUtils.compare("", "", strict));
-
- assertTrue(PhoneNumberUtils.compare("911", "911", strict));
- assertFalse(PhoneNumberUtils.compare("911", "18005550911", strict));
-
- assertTrue(PhoneNumberUtils.compare("+17005554141", "+17005554141", strict));
- assertTrue(PhoneNumberUtils.compare("+17005554141", "+1 (700).555-4141", strict));
- assertTrue(PhoneNumberUtils.compare("+17005554141", "7005554141", strict));
- assertFalse(PhoneNumberUtils.compare("+1 999 7005554141", "+1 7005554141", strict));
- assertTrue(PhoneNumberUtils.compare("011 1 7005554141", "7005554141", strict));
- assertFalse(PhoneNumberUtils.compare("011 11 7005554141", "+17005554141", strict));
- assertTrue(PhoneNumberUtils.compare("+44 207 792 3490", "0 207 792 3490", strict));
- assertFalse(PhoneNumberUtils.compare("+44 207 792 3490", "00 207 792 3490", strict));
-
- // MMI header should be ignored
- assertFalse(PhoneNumberUtils.compare("+17005554141", "**31#17005554141", strict));
- assertFalse(PhoneNumberUtils.compare("+44 207 792 3490", "+44 (0) 207 792 3490", strict));
- assertFalse(PhoneNumberUtils.compare("+44 207 792 3490", "010 44 207 792 3490", strict));
- assertFalse(PhoneNumberUtils.compare("+44 207 792 3490", "0011 44 207 792 3490", strict));
- assertTrue(PhoneNumberUtils.compare("+444 207 792 3490", "0 207 792 3490", strict));
-
- // make sure SMS short code comparison for numbers less than 7 digits work correctly.
- // For example, "404-04" and "40404" should match because the dialable portion for both
- // numbers are the same.
- assertTrue(PhoneNumberUtils.compare("404-04", "40404", strict));
- }
-
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "compare",
- args = {String.class, String.class}
- )
- public void testCompareLoosely() {
- testCompareCommon(false);
-
- assertTrue(PhoneNumberUtils.compareLoosely("17005554141", "5554141"));
- assertTrue(PhoneNumberUtils.compareLoosely("+17005554141", "**31#+17005554141"));
- assertFalse(PhoneNumberUtils.compareLoosely("+7(095)9100766", "8(095)9100766"));
- }
-
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "compare",
- args = {String.class, String.class}
- )
- public void testCompareStrictly() {
- testCompareCommon(true);
-
- // This must be true, since
- // - +7 is russian country calling code
- // - 8 is russian trunk prefix, which should be omitted when being compared to
- // the number with country calling code.
- // - so, this comparation becomes same as comparation between
- // "(095)9100766" v.s."(095)9100766", which is definitely true.
- assertTrue(PhoneNumberUtils.compareStrictly("+7(095)9100766", "8(095)9100766"));
-
- // Test broken caller ID seen on call from Thailand to the US.
- assertTrue(PhoneNumberUtils.compareStrictly("+66811234567", "166811234567"));
-
- // This is not related to Thailand case. NAMP "1" + region code "661".
- assertTrue(PhoneNumberUtils.compareStrictly("16610001234", "6610001234"));
-
- assertFalse(PhoneNumberUtils.compareStrictly("080-1234-5678", "+819012345678"));
- assertTrue(PhoneNumberUtils.compareStrictly("650-000-3456", "16500003456"));
-
- // Phone numbers with Ascii characters, which are common in some countries
- assertFalse(PhoneNumberUtils.compareStrictly("abcd", "bcde"));
- assertTrue(PhoneNumberUtils.compareStrictly("1-800-flowers", "800-flowers"));
- assertFalse(PhoneNumberUtils.compareStrictly("1-800-flowers", "1-800-abcdefg"));
- }
-
@TestTargets({
@TestTargetNew(
level = TestLevel.COMPLETE,
@@ -282,12 +204,6 @@
intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:+18005555555"));
assertEquals("+18005555555", PhoneNumberUtils.getNumberFromIntent(intent, getContext()));
- intent = new Intent(Intent.ACTION_DIAL, Uri.parse("voicemail:"));
- TelephonyManager tm =
- (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE);
- assertEquals(tm.getVoiceMailNumber(),
- PhoneNumberUtils.getNumberFromIntent(intent, getContext()));
-
ContentResolver cr = getContext().getContentResolver();
Uri personRecord = null;
Uri phoneRecord = null;
diff --git a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
index 1ced4cd..0528897 100644
--- a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
@@ -23,6 +23,7 @@
import android.content.ContentResolver;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Looper;
@@ -440,4 +441,30 @@
}
}
}
+
+ private static final String ISO_COUNTRY_CODE_PATTERN = "[a-z]{2}";
+
+ public void testGetNetworkCountryIso() {
+ PackageManager packageManager = getContext().getPackageManager();
+ String countryCode = mTelephonyManager.getNetworkCountryIso();
+ if (packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
+ assertTrue("Country code '" + countryCode + "' did not match "
+ + ISO_COUNTRY_CODE_PATTERN,
+ Pattern.matches(ISO_COUNTRY_CODE_PATTERN, countryCode));
+ } else {
+ // Non-telephony may still have the property defined if it has a SIM.
+ }
+ }
+
+ public void testGetSimCountryIso() {
+ PackageManager packageManager = getContext().getPackageManager();
+ String countryCode = mTelephonyManager.getSimCountryIso();
+ if (packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
+ assertTrue("Country code '" + countryCode + "' did not match "
+ + ISO_COUNTRY_CODE_PATTERN,
+ Pattern.matches(ISO_COUNTRY_CODE_PATTERN, countryCode));
+ } else {
+ // Non-telephony may still have the property defined if it has a SIM.
+ }
+ }
}
diff --git a/tests/tests/text/src/android/text/cts/LayoutTest.java b/tests/tests/text/src/android/text/cts/LayoutTest.java
index 9d33190..4c305bb 100644
--- a/tests/tests/text/src/android/text/cts/LayoutTest.java
+++ b/tests/tests/text/src/android/text/cts/LayoutTest.java
@@ -16,6 +16,11 @@
package android.text.cts;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.ToBeFixed;
+
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
@@ -30,13 +35,6 @@
import android.text.Layout.Alignment;
import android.text.style.StrikethroughSpan;
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.ToBeFixed;
-
@TestTargetClass(Layout.class)
public class LayoutTest extends AndroidTestCase {
private final static int LINE_COUNT = 5;
@@ -342,34 +340,6 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- method = "getLineMax",
- args = {int.class}
- )
- @BrokenTest("unsure if asserted widths are correct")
- public void testGetLineMax() {
- Layout layout = new MockLayout(LAYOUT_TEXT, mTextPaint, mWidth,
- mAlign, mSpacingmult, mSpacingadd);
- assertEquals(6.0f, layout.getLineMax(0));
- assertEquals(3.0f, layout.getLineMax(1));
- assertEquals(9.0f, layout.getLineMax(2));
- }
-
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "getLineWidth",
- args = {int.class}
- )
- @BrokenTest("unsure if asserted widths are correct")
- public void testGetLineWidth() {
- Layout layout = new MockLayout(LAYOUT_TEXT, mTextPaint, mWidth,
- mAlign, mSpacingmult, mSpacingadd);
- assertEquals(6.0f, layout.getLineWidth(0));
- assertEquals(3.0f, layout.getLineWidth(1));
- assertEquals(9.0f, layout.getLineWidth(2));
- }
-
- @TestTargetNew(
- level = TestLevel.COMPLETE,
method = "getLineForVertical",
args = {int.class}
)
diff --git a/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java b/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
index 22ef413..a5dd335 100644
--- a/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
+++ b/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
@@ -198,6 +198,11 @@
})
@SuppressWarnings("deprecation")
public void testFormatMethods() {
+ if (!LocaleUtils.isSupportedLocale(mContext, Locale.US)) {
+ // Locale is set to US in setUp method.
+ return;
+ }
+
long elapsedTime = 2 * 60 * 60;
String expected = "2:00:00";
assertEquals(expected, DateUtils.formatElapsedTime(elapsedTime));
diff --git a/tests/tests/text/src/android/text/method/cts/MultiTapKeyListenerTest.java b/tests/tests/text/src/android/text/method/cts/MultiTapKeyListenerTest.java
index 3bf059b..175047e 100644
--- a/tests/tests/text/src/android/text/method/cts/MultiTapKeyListenerTest.java
+++ b/tests/tests/text/src/android/text/method/cts/MultiTapKeyListenerTest.java
@@ -26,7 +26,6 @@
import android.app.Activity;
import android.app.Instrumentation;
import android.test.ActivityInstrumentationTestCase2;
-import android.text.Editable;
import android.text.InputType;
import android.text.Selection;
import android.text.Spannable;
@@ -34,10 +33,11 @@
import android.text.method.MultiTapKeyListener;
import android.text.method.TextKeyListener.Capitalize;
import android.view.KeyEvent;
-import android.view.View;
import android.widget.TextView;
import android.widget.TextView.BufferType;
+import java.util.concurrent.TimeUnit;
+
@TestTargetClass(MultiTapKeyListener.class)
public class MultiTapKeyListenerTest extends
ActivityInstrumentationTestCase2<KeyListenerStubActivity> {
@@ -118,16 +118,126 @@
}
}
- @Override
- public void sendRepeatedKeys(int... keys) {
- super.sendRepeatedKeys(keys);
- waitForListenerTimeout();
+ public void testOnKeyDown_capitalizeNone() {
+ MultiTapKeyListener keyListener = MultiTapKeyListener.getInstance(false, Capitalize.NONE);
+
+ prepareEmptyTextView();
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_4, 2);
+ assertEquals("h", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_3, 2);
+ assertEquals("he", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_5, 3);
+ assertEquals("hel", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_5, 3);
+ assertEquals("hell", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_6, 3);
+ assertEquals("hello", mTextView.getText().toString());
}
- /**
- * Wait for TIME_OUT, or listener will accept key event as multi tap rather than a new key.
- */
- private void waitForListenerTimeout() {
+ public void testOnKeyDown_capitalizeCharacters() {
+ MultiTapKeyListener keyListener = MultiTapKeyListener.getInstance(false,
+ Capitalize.CHARACTERS);
+
+ prepareEmptyTextView();
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_4, 2);
+ assertEquals("H", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_3, 2);
+ assertEquals("HE", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_5, 3);
+ assertEquals("HEL", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_5, 3);
+ assertEquals("HELL", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_6, 3);
+ assertEquals("HELLO", mTextView.getText().toString());
+ }
+
+ public void testOnKeyDown_capitalizeSentences() {
+ MultiTapKeyListener keyListener = MultiTapKeyListener.getInstance(false,
+ Capitalize.SENTENCES);
+
+ prepareEmptyTextView();
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_4, 2);
+ assertEquals("H", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_4, 3);
+ assertEquals("Hi", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_1, 1);
+ assertEquals("Hi.", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_POUND, 1);
+ assertEquals("Hi. ", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_2, 2);
+ assertEquals("Hi. B", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_9, 3);
+ assertEquals("Hi. By", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_3, 2);
+ assertEquals("Hi. Bye", mTextView.getText().toString());
+ }
+
+ public void testOnKeyDown_capitalizeWords() {
+ MultiTapKeyListener keyListener = MultiTapKeyListener.getInstance(false,
+ Capitalize.WORDS);
+
+ prepareEmptyTextView();
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_4, 2);
+ assertEquals("H", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_4, 3);
+ assertEquals("Hi", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_POUND, 1);
+ assertEquals("Hi ", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_2, 2);
+ assertEquals("Hi B", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_9, 3);
+ assertEquals("Hi By", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_3, 2);
+ assertEquals("Hi Bye", mTextView.getText().toString());
+ }
+
+ private void prepareEmptyTextView() {
+ mActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ mTextView.setText("", BufferType.EDITABLE);
+ Selection.setSelection(mTextView.getEditableText(), 0, 0);
+ }
+ });
+ mInstrumentation.waitForIdleSync();
+ assertEquals("", mTextView.getText().toString());
+ }
+
+ private void callOnKeyDown(final MultiTapKeyListener keyListener, final int keyCode,
+ final int numTimes) {
+ mActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ for (int i = 0; i < numTimes; i++) {
+ keyListener.onKeyDown(mTextView, mTextView.getEditableText(), keyCode,
+ new KeyEvent(KeyEvent.ACTION_DOWN, keyCode));
+ }
+ }
+ });
+ mInstrumentation.waitForIdleSync();
+
+ // Wait a bit in order to distinguish this character and the next one.
try {
Thread.sleep(TIME_OUT);
} catch (InterruptedException e) {
@@ -135,312 +245,6 @@
}
}
- /**
- * Check point when Capitalize.NONE and autotext is false:
- * 1. press KEYCODE_4 twice, text is "h".
- * 2. press KEYCODE_3 twice, text is "he".
- * 3. press KEYCODE_5 three times, text is "hel".
- * 4. press KEYCODE_5 three times, text is "hell".
- * 5. press KEYCODE_8 twice, text is "hellu".
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- public void testPressKey1() {
- final MultiTapKeyListener multiTapKeyListener
- = MultiTapKeyListener.getInstance(false, Capitalize.NONE);
-
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(multiTapKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_4);
- assertEquals("h", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_3);
- assertEquals("he", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("hel", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("hell", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_8);
- assertEquals("hellu", mTextView.getText().toString());
- }
-
- /**
- * Check point when Capitalize.NONE and autotext is true:
- * 1. press KEYCODE_4 twice, text is "h".
- * 2. press KEYCODE_3 twice, text is "he".
- * 3. press KEYCODE_5 three times, text is "hel".
- * 4. press KEYCODE_5 three times, text is "hell".
- * 5. press KEYCODE_8 twice, text should not be "hellu".
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- @ToBeFixed(bug = "1738241", explanation = "can not correct spelling automatically")
- public void testPressKey2() {
- final MultiTapKeyListener multiTapKeyListener
- = MultiTapKeyListener.getInstance(true, Capitalize.NONE);
-
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(multiTapKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_4);
- assertEquals("h", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_3);
- assertEquals("he", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("hel", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("hell", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_8);
-// assertFalse("hellu".equals(mEditText.getText().toString())); issue 1738241
- }
-
- /**
- * Check point when Capitalize.SENTENCES and autotext is false:
- * 1. press KEYCODE_4 twice, text is "H".
- * 2. press KEYCODE_3 twice, text is "He".
- * 3. press KEYCODE_5 three times, text is "Hel".
- * 4. press KEYCODE_5 three times, text is "Hell".
- * 5. press KEYCODE_8 twice, text is "Hellu".
- * 6. press KEYCODE_1 once, text is "Hellu.".
- * 7. press KEYCODE_POUND once, text is "Hellu. ".
- * 8. press KEYCODE_6 once, text is "Hellu. M".
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- public void testPressKey3() {
- final MultiTapKeyListener multiTapKeyListener
- = MultiTapKeyListener.getInstance(false, Capitalize.SENTENCES);
-
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(multiTapKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_4);
- assertEquals("H", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_3);
- assertEquals("He", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("Hel", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("Hell", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_8);
- assertEquals("Hellu", mTextView.getText().toString());
-
- sendRepeatedKeys(1, KeyEvent.KEYCODE_1);
- assertEquals("Hellu.", mTextView.getText().toString());
-
- sendRepeatedKeys(1, KeyEvent.KEYCODE_POUND);
- assertEquals("Hellu. ", mTextView.getText().toString());
-
- sendRepeatedKeys(1, KeyEvent.KEYCODE_6);
- assertEquals("Hellu. M", mTextView.getText().toString());
- }
-
- /**
- * Check point when Capitalize.SENTENCES and autotext is true:
- * 1. press KEYCODE_4 twice, text is "H".
- * 2. press KEYCODE_3 twice, text is "He".
- * 3. press KEYCODE_5 three times, text is "Hel".
- * 4. press KEYCODE_5 three times, text is "Hell".
- * 5. press KEYCODE_8 twice, text is "Hellu".
- * 6. press KEYCODE_1 once, text is "Hellu.".
- * 7. press KEYCODE_POUND once, text is "Hellu. ".
- * 8. press KEYCODE_6 once, text should not be "Hellu. M".
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- @ToBeFixed(bug = "1738241", explanation = "can not correct spelling automatically")
- public void testPressKey4() {
- final MultiTapKeyListener multiTapKeyListener
- = MultiTapKeyListener.getInstance(true, Capitalize.SENTENCES);
-
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(multiTapKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_4);
- assertEquals("H", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_3);
- assertEquals("He", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("Hel", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("Hell", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_8);
- assertEquals("Hellu", mTextView.getText().toString());
-
- sendRepeatedKeys(1, KeyEvent.KEYCODE_1);
-// assertFalse("Hellu.".equals(mEditText.getText().toString())); issue 1738241
-//
-// sendRepeatedKeys(1, KeyEvent.KEYCODE_POUND);
-// assertEquals("Hellu. ", mEditText.getText().toString());
-//
-// sendRepeatedKeys(1, KeyEvent.KEYCODE_6);
-// assertEquals("Hellu. M", mEditText.getText().toString());
- }
-
- /**
- * Check point when Capitalize.WORDS and autotext is false:
- * 1. press KEYCODE_4 twice, text is "H".
- * 2. press KEYCODE_3 twice, text is "He".
- * 3. press KEYCODE_5 three times, text is "Hel".
- * 4. press KEYCODE_5 three times, text is "Hell".
- * 5. press KEYCODE_8 twice, text is "Hellu".
- * 6. press KEYCODE_POUND once, text is "Hellu ".
- * 7. press KEYCODE_6 once, text is "Hellu M".
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- public void testPressKey5() {
- final MultiTapKeyListener multiTapKeyListener
- = MultiTapKeyListener.getInstance(false, Capitalize.WORDS);
-
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(multiTapKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_4);
- assertEquals("H", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_3);
- assertEquals("He", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("Hel", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("Hell", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_8);
- assertEquals("Hellu", mTextView.getText().toString());
-
- sendRepeatedKeys(1, KeyEvent.KEYCODE_POUND);
- assertEquals("Hellu ", mTextView.getText().toString());
-
- sendRepeatedKeys(1, KeyEvent.KEYCODE_6);
- assertEquals("Hellu M", mTextView.getText().toString());
- }
-
- /**
- * Check point when Capitalize.CHARACTERS and autotext is false:
- * 1. press KEYCODE_4 twice, text is "H".
- * 2. press KEYCODE_3 twice, text is "HE".
- * 3. press KEYCODE_5 three times, text is "HEL".
- * 4. press KEYCODE_5 three times, text is "HELL".
- * 5. press KEYCODE_8 twice, text is "HELLU".
- * 6. press KEYCODE_POUND once, text is "HELLU ".
- * 7. press KEYCODE_6 once, text is "HELLU M".
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- public void testPressKey6() {
- final MultiTapKeyListener multiTapKeyListener
- = MultiTapKeyListener.getInstance(false, Capitalize.CHARACTERS);
-
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(multiTapKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_4);
- assertEquals("H", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_3);
- assertEquals("HE", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("HEL", mTextView.getText().toString());
-
- sendRepeatedKeys(3, KeyEvent.KEYCODE_5);
- assertEquals("HELL", mTextView.getText().toString());
-
- sendRepeatedKeys(2, KeyEvent.KEYCODE_8);
- assertEquals("HELLU", mTextView.getText().toString());
-
- sendRepeatedKeys(1, KeyEvent.KEYCODE_POUND);
- assertEquals("HELLU ", mTextView.getText().toString());
-
- sendRepeatedKeys(1, KeyEvent.KEYCODE_6);
- assertEquals("HELLU M", mTextView.getText().toString());
- }
-
@TestTargetNew(
level = TestLevel.COMPLETE,
method = "getInstance",
diff --git a/tests/tests/text/src/android/text/method/cts/QwertyKeyListenerTest.java b/tests/tests/text/src/android/text/method/cts/QwertyKeyListenerTest.java
index 5ae8cae..c86dba3 100644
--- a/tests/tests/text/src/android/text/method/cts/QwertyKeyListenerTest.java
+++ b/tests/tests/text/src/android/text/method/cts/QwertyKeyListenerTest.java
@@ -26,7 +26,6 @@
import android.app.Activity;
import android.app.Instrumentation;
import android.test.ActivityInstrumentationTestCase2;
-import android.text.Editable;
import android.text.InputType;
import android.text.Selection;
import android.text.Spannable;
@@ -35,7 +34,6 @@
import android.text.method.TextKeyListener;
import android.text.method.TextKeyListener.Capitalize;
import android.view.KeyEvent;
-import android.view.View;
import android.widget.TextView;
import android.widget.TextView.BufferType;
@@ -71,253 +69,121 @@
new QwertyKeyListener(null, true);
}
- /**
- * Check point when Capitalize.NONE and autotext is true:
- * 1. press KEYCODE_H, text is "h".
- * 2. press KEYCODE_E, text is "he".
- * 3. press KEYCODE_L, text is "hel".
- * 4. press KEYCODE_L, text is "hell".
- * 5. press KEYCODE_U, text should not be "hellu".
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- @ToBeFixed(bug = "1738241", explanation = "can not correct spelling automatically")
- public void testPressKey1() {
- final QwertyKeyListener qwertyKeyListener
- = QwertyKeyListener.getInstance(true, Capitalize.NONE);
+ public void testOnKeyDown_capitalizeNone() {
+ QwertyKeyListener keyListener = QwertyKeyListener.getInstance(false, Capitalize.NONE);
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(qwertyKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
+ prepareEmptyTextView();
- sendKeys(KeyEvent.KEYCODE_H);
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_H);
assertEquals("h", mTextView.getText().toString());
- sendKeys(KeyEvent.KEYCODE_E);
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_E);
assertEquals("he", mTextView.getText().toString());
- sendKeys(KeyEvent.KEYCODE_L);
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_L);
assertEquals("hel", mTextView.getText().toString());
- sendKeys(KeyEvent.KEYCODE_L);
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_L);
assertEquals("hell", mTextView.getText().toString());
- sendKeys(KeyEvent.KEYCODE_U);
-// assertFalse("hellu".equals(mTextView.getText().toString())); issue 1738241
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_O);
+ assertEquals("hello", mTextView.getText().toString());
}
- /**
- * Check point when Capitalize.NONE and autotext is false:
- * 1. press KEYCODE_H, text is "h".
- * 2. press KEYCODE_E, text is "he".
- * 3. press KEYCODE_L, text is "hel".
- * 4. press KEYCODE_L, text is "hell".
- * 5. press KEYCODE_U, text is "hellu".
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- public void testPressKey2() {
- final QwertyKeyListener qwertyKeyListener
- = QwertyKeyListener.getInstance(false, Capitalize.NONE);
+ public void testOnKeyDown_capitalizeCharacters() {
+ QwertyKeyListener keyListener = QwertyKeyListener.getInstance(false,
+ Capitalize.CHARACTERS);
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(qwertyKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
+ prepareEmptyTextView();
- sendKeys(KeyEvent.KEYCODE_H);
- assertEquals("h", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_E);
- assertEquals("he", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_L);
- assertEquals("hel", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_L);
- assertEquals("hell", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_U);
- assertEquals("hellu", mTextView.getText().toString());
- }
-
- /**
- * Check point when Capitalize.SENTENCES and autotext is false:
- * 1. press KEYCODE_H, text is "H".
- * 2. press KEYCODE_E, text is "He".
- * 3. press KEYCODE_L, text is "Hel".
- * 4. press KEYCODE_L, text is "Hell".
- * 5. press KEYCODE_U, text is "Hellu".
- * 6. press KEYCODE_PERIOD, text is "Hellu."
- * 7. press KEYCODE_SPACE, text is "Hellu. "
- * 8. press KEYCODE_H, text is "Hellu. H"
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- public void testPressKey3() {
- final QwertyKeyListener qwertyKeyListener
- = QwertyKeyListener.getInstance(false, Capitalize.SENTENCES);
-
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(qwertyKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_H);
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_H);
assertEquals("H", mTextView.getText().toString());
- sendKeys(KeyEvent.KEYCODE_E);
- assertEquals("He", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_L);
- assertEquals("Hel", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_L);
- assertEquals("Hell", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_U);
- assertEquals("Hellu", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_PERIOD);
- assertEquals("Hellu.", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_SPACE);
- assertEquals("Hellu. ", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_H);
- assertEquals("Hellu. H", mTextView.getText().toString());
- }
-
- /**
- * Check point when Capitalize.WORDS and autotext is false:
- * 1. press KEYCODE_H, text is "H".
- * 2. press KEYCODE_E, text is "He".
- * 3. press KEYCODE_L, text is "Hel".
- * 4. press KEYCODE_L, text is "Hell".
- * 5. press KEYCODE_U, text is "Hellu".
- * 7. press KEYCODE_SPACE, text is "Hellu "
- * 8. press KEYCODE_H, text is "Hellu H"
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- public void testPressKey4() {
- final QwertyKeyListener qwertyKeyListener
- = QwertyKeyListener.getInstance(false, Capitalize.WORDS);
-
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(qwertyKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_H);
- assertEquals("H", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_E);
- assertEquals("He", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_L);
- assertEquals("Hel", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_L);
- assertEquals("Hell", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_U);
- assertEquals("Hellu", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_SPACE);
- assertEquals("Hellu ", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_H);
- assertEquals("Hellu H", mTextView.getText().toString());
- }
-
- /**
- * Check point when Capitalize.CHARACTERS and autotext is false:
- * 1. press KEYCODE_H, text is "H".
- * 2. press KEYCODE_E, text is "HE".
- * 3. press KEYCODE_L, text is "HEL".
- * 4. press KEYCODE_L, text is "HELL".
- * 5. press KEYCODE_U, text is "HELLU".
- * 7. press KEYCODE_SPACE, text is "HELLU "
- * 8. press KEYCODE_H, text is "HELLU H"
- */
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- method = "onKeyDown",
- args = {View.class, Editable.class, int.class, KeyEvent.class}
- )
- public void testPressKey5() {
- final QwertyKeyListener qwertyKeyListener
- = QwertyKeyListener.getInstance(false, Capitalize.CHARACTERS);
-
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- mTextView.setText("", BufferType.EDITABLE);
- mTextView.requestFocus();
- Selection.setSelection((Editable) mTextView.getText(), 0, 0);
- mTextView.setKeyListener(qwertyKeyListener);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals("", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_H);
- assertEquals("H", mTextView.getText().toString());
-
- sendKeys(KeyEvent.KEYCODE_E);
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_E);
assertEquals("HE", mTextView.getText().toString());
- sendKeys(KeyEvent.KEYCODE_L);
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_L);
assertEquals("HEL", mTextView.getText().toString());
- sendKeys(KeyEvent.KEYCODE_L);
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_L);
assertEquals("HELL", mTextView.getText().toString());
- sendKeys(KeyEvent.KEYCODE_U);
- assertEquals("HELLU", mTextView.getText().toString());
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_O);
+ assertEquals("HELLO", mTextView.getText().toString());
+ }
- sendKeys(KeyEvent.KEYCODE_SPACE);
- assertEquals("HELLU ", mTextView.getText().toString());
+ public void testOnKeyDown_capitalizeSentences() {
+ QwertyKeyListener keyListener = QwertyKeyListener.getInstance(false,
+ Capitalize.SENTENCES);
- sendKeys(KeyEvent.KEYCODE_H);
- assertEquals("HELLU H", mTextView.getText().toString());
+ prepareEmptyTextView();
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_H);
+ assertEquals("H", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_I);
+ assertEquals("Hi", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_PERIOD);
+ assertEquals("Hi.", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_SPACE);
+ assertEquals("Hi. ", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_B);
+ assertEquals("Hi. B", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_Y);
+ assertEquals("Hi. By", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_E);
+ assertEquals("Hi. Bye", mTextView.getText().toString());
+ }
+
+ public void testOnKeyDown_capitalizeWords() {
+ QwertyKeyListener keyListener = QwertyKeyListener.getInstance(false,
+ Capitalize.WORDS);
+
+ prepareEmptyTextView();
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_H);
+ assertEquals("H", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_I);
+ assertEquals("Hi", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_SPACE);
+ assertEquals("Hi ", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_B);
+ assertEquals("Hi B", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_Y);
+ assertEquals("Hi By", mTextView.getText().toString());
+
+ callOnKeyDown(keyListener, KeyEvent.KEYCODE_E);
+ assertEquals("Hi Bye", mTextView.getText().toString());
+ }
+
+ private void prepareEmptyTextView() {
+ mActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ mTextView.setText("", BufferType.EDITABLE);
+ Selection.setSelection(mTextView.getEditableText(), 0, 0);
+ }
+ });
+ mInstrumentation.waitForIdleSync();
+ assertEquals("", mTextView.getText().toString());
+ }
+
+ private void callOnKeyDown(final QwertyKeyListener keyListener, final int keyCode) {
+ mActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ keyListener.onKeyDown(mTextView, mTextView.getEditableText(), keyCode,
+ new KeyEvent(KeyEvent.ACTION_DOWN, keyCode));
+ }
+ });
+ mInstrumentation.waitForIdleSync();
}
@TestTargetNew(
diff --git a/tests/tests/text/src/android/text/util/cts/LinkifyTest.java b/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
index 0733b9f..2c45c77 100644
--- a/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
+++ b/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
@@ -16,18 +16,15 @@
package android.text.util.cts;
-import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.ToBeFixed;
import android.test.AndroidTestCase;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.URLSpan;
import android.text.util.Linkify;
-//import android.text.util.Regex;
import android.text.util.Linkify.MatchFilter;
import android.text.util.Linkify.TransformFilter;
import android.widget.TextView;
@@ -90,7 +87,6 @@
method = "addLinks",
args = {android.text.Spannable.class, int.class}
)
- @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
public void testAddLinks1() {
SpannableString spannable = new SpannableString("name@gmail.com, "
+ "123456789, tel:(0812)1234567 "
@@ -129,7 +125,6 @@
method = "addLinks",
args = {android.widget.TextView.class, int.class}
)
- @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
public void testAddLinks2() {
String text = "www.google.com, name@gmail.com";
TextView tv = new TextView(mContext);
@@ -164,7 +159,6 @@
args = {android.widget.TextView.class, java.util.regex.Pattern.class,
java.lang.String.class}
)
- @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
public void testAddLinks3() {
String text = "Alan, Charlie";
TextView tv = new TextView(mContext);
@@ -216,8 +210,6 @@
java.lang.String.class, android.text.util.Linkify.MatchFilter.class,
android.text.util.Linkify.TransformFilter.class}
)
- @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
- @BrokenTest("Filter and pattern need to be fixed")
public void testAddLinks4() {
TextView tv = new TextView(mContext);
@@ -226,8 +218,9 @@
Linkify.addLinks(tv, LINKIFY_TEST_PATTERN, "Test:",
mMatchFilterStartWithDot, mTransformFilterUpperChar);
URLSpan[] spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class);
- assertEquals(1, spans.length);
+ assertEquals(2, spans.length);
assertEquals("test:ilterpperase.pattern", spans[0].getURL());
+ assertEquals("test:12", spans[1].getURL());
try {
Linkify.addLinks((TextView) null, LINKIFY_TEST_PATTERN, "Test:",
@@ -249,21 +242,24 @@
Linkify.addLinks(tv, LINKIFY_TEST_PATTERN, null,
mMatchFilterStartWithDot, mTransformFilterUpperChar);
spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class);
- assertEquals(1, spans.length);
+ assertEquals(2, spans.length);
assertEquals("ilterpperase.pattern", spans[0].getURL());
+ assertEquals("12", spans[1].getURL());
tv.setText(text);
Linkify.addLinks(tv, LINKIFY_TEST_PATTERN, "Test:", null, mTransformFilterUpperChar);
spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class);
- assertEquals(2, spans.length);
+ assertEquals(3, spans.length);
assertEquals("test:ilterpperase.pattern", spans[0].getURL());
- assertEquals("test:345.pattern", spans[1].getURL());
+ assertEquals("test:12", spans[1].getURL());
+ assertEquals("test:345.pattern", spans[2].getURL());
tv.setText(text);
Linkify.addLinks(tv, LINKIFY_TEST_PATTERN, "Test:", mMatchFilterStartWithDot, null);
spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class);
- assertEquals(1, spans.length);
+ assertEquals(2, spans.length);
assertEquals("test:FilterUpperCase.pattern", spans[0].getURL());
+ assertEquals("test:12", spans[1].getURL());
}
@TestTargetNew(
@@ -272,7 +268,6 @@
method = "addLinks",
args = {android.text.Spannable.class, java.util.regex.Pattern.class, java.lang.String.class}
)
- @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
public void testAddLinks5() {
String text = "google.pattern, test:AZ0101.pattern";
@@ -312,8 +307,6 @@
android.text.util.Linkify.MatchFilter.class,
android.text.util.Linkify.TransformFilter.class}
)
- @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
- @BrokenTest("Filter and pattern need to be fixed")
public void testAddLinks6() {
String text = "FilterUpperCase.pattern, 12.345.pattern";
@@ -321,8 +314,9 @@
Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, "Test:",
mMatchFilterStartWithDot, mTransformFilterUpperChar);
URLSpan[] spans = (spannable.getSpans(0, spannable.length(), URLSpan.class));
- assertEquals(1, spans.length);
+ assertEquals(2, spans.length);
assertEquals("test:ilterpperase.pattern", spans[0].getURL());
+ assertEquals("test:12", spans[1].getURL());
try {
Linkify.addLinks((Spannable)null, LINKIFY_TEST_PATTERN, "Test:",
@@ -344,20 +338,23 @@
Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, null, mMatchFilterStartWithDot,
mTransformFilterUpperChar);
spans = (spannable.getSpans(0, spannable.length(), URLSpan.class));
- assertEquals(1, spans.length);
+ assertEquals(2, spans.length);
assertEquals("ilterpperase.pattern", spans[0].getURL());
+ assertEquals("12", spans[1].getURL());
spannable = new SpannableString(text);
Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, "Test:", null, mTransformFilterUpperChar);
spans = (spannable.getSpans(0, spannable.length(), URLSpan.class));
- assertEquals(2, spans.length);
+ assertEquals(3, spans.length);
assertEquals("test:ilterpperase.pattern", spans[0].getURL());
- assertEquals("test:345.pattern", spans[1].getURL());
+ assertEquals("test:12", spans[1].getURL());
+ assertEquals("test:345.pattern", spans[2].getURL());
spannable = new SpannableString(text);
Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, "Test:", mMatchFilterStartWithDot, null);
spans = (spannable.getSpans(0, spannable.length(), URLSpan.class));
- assertEquals(1, spans.length);
+ assertEquals(2, spans.length);
assertEquals("test:FilterUpperCase.pattern", spans[0].getURL());
+ assertEquals("test:12", spans[1].getURL());
}
}
diff --git a/tests/tests/view/src/android/view/cts/SurfaceTest.java b/tests/tests/view/src/android/view/cts/SurfaceTest.java
deleted file mode 100644
index 8c11e6a..0000000
--- a/tests/tests/view/src/android/view/cts/SurfaceTest.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (C) 2009 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 android.view.cts;
-
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.ToBeFixed;
-
-import android.graphics.Canvas;
-import android.graphics.Rect;
-import android.os.Parcel;
-import android.test.ActivityInstrumentationTestCase2;
-import android.view.Surface;
-import android.view.Surface.OutOfResourcesException;
-
-@TestTargetClass(Surface.class)
-public class SurfaceTest extends ActivityInstrumentationTestCase2<SurfaceViewStubActivity> {
-
- public SurfaceTest() {
- super("com.android.cts.stub", SurfaceViewStubActivity.class);
- }
-
- @TestTargets({
- @TestTargetNew(
- level = TestLevel.PARTIAL,
- notes = "Test Surface",
- method = "lockCanvas",
- args = {android.graphics.Rect.class}
- ),
- @TestTargetNew(
- level = TestLevel.PARTIAL,
- notes = "Test Surface",
- method = "unlockCanvas",
- args = {android.graphics.Canvas.class}
- ),
- @TestTargetNew(
- level = TestLevel.PARTIAL,
- notes = "Test Surface",
- method = "unlockCanvasAndPost",
- args = {android.graphics.Canvas.class}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "clear",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_NECESSARY,
- notes = "Test Surface",
- method = "describeContents",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.PARTIAL,
- notes = "Test Surface",
- method = "isValid",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "setLayer",
- args = {int.class}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "setPosition",
- args = {int.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "setSize",
- args = {int.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "hide",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "show",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "setTransparentRegionHint",
- args = {android.graphics.Region.class}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "setAlpha",
- args = {float.class}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "setMatrix",
- args = {float.class, float.class, float.class, float.class}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "freeze",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "unfreeze",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "setFreezeTint",
- args = {int.class}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "setFlags",
- args = {int.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- notes = "Test Surface",
- method = "setOrientation",
- args = {int.class, int.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- notes = "Test Surface",
- method = "toString",
- args = {}
- ),
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "Test Surface",
- method = "readFromParcel",
- args = {android.os.Parcel.class}
- ),
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- notes = "Test Surface",
- method = "writeToParcel",
- args = {android.os.Parcel.class, int.class}
- )
- })
- @ToBeFixed(bug = "1698482", explanation = "The APIs which set surface parameters should be " +
- " set '@hide', because they needs to be inside open/closeTransaction block, " +
- "while the APIs that open/closeTransaction block is set '@hide'")
- @BrokenTest("needs investigation")
- public void testSurface() throws OutOfResourcesException {
- Surface surface = getActivity().getSurfaceView().getHolder().getSurface();
- surface.describeContents();
- assertTrue(surface.isValid());
- Canvas canvas = surface.lockCanvas(new Rect(0, 0, 10, 10));
- assertNotNull(canvas);
- surface.unlockCanvas(canvas);
- surface.unlockCanvasAndPost(canvas);
-
- Parcel p = Parcel.obtain();
- surface.writeToParcel(p, 0);
- p.setDataPosition(0);
- Surface s = Surface.CREATOR.createFromParcel(p);
- assertEquals(surface.isValid(), s.isValid());
-
- surface.readFromParcel(p);
- assertNotNull(surface.toString());
-
- Surface.setOrientation(0, Surface.ROTATION_90);
- }
-}
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java b/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java
index 8540a7c..f5f2286 100644
--- a/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/BaseInputConnectionTest.java
@@ -345,6 +345,7 @@
public void testReportFullscreenMode() {
InputMethodManager imManager = (InputMethodManager) mInstrumentation.getTargetContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
+ mConnection.reportFullscreenMode(false);
assertFalse(imManager.isFullscreenMode());
mConnection.reportFullscreenMode(true);
assertTrue(imManager.isFullscreenMode());
diff --git a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
index d92f446..5b7940f 100755
--- a/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
+++ b/tests/tests/view/src/android/view/inputmethod/cts/InputMethodManagerTest.java
@@ -164,9 +164,6 @@
connection.reportFullscreenMode(true);
assertTrue(imManager.isFullscreenMode());
- // Currently can't set this status, always false.
- assertFalse(imManager.isWatchingCursor(view));
-
IBinder token = view.getWindowToken();
// Show and hide input method.
diff --git a/tests/tests/webkit/src/android/webkit/cts/CookieManagerTest.java b/tests/tests/webkit/src/android/webkit/cts/CookieManagerTest.java
old mode 100644
new mode 100755
index fea44ef..ca1b76f
--- a/tests/tests/webkit/src/android/webkit/cts/CookieManagerTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/CookieManagerTest.java
@@ -26,6 +26,7 @@
import android.view.animation.cts.DelayedCheck;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
+import android.webkit.WebChromeClient;
import android.webkit.WebView;
import java.util.Date;
@@ -50,6 +51,9 @@
super.setUp();
mWebView = getActivity().getWebView();
+ // Set a web chrome client in order to receive progress updates.
+ mWebView.setWebChromeClient(new WebChromeClient());
+
mCookieManager = CookieManager.getInstance();
assertNotNull(mCookieManager);
}
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebHistoryItemTest.java b/tests/tests/webkit/src/android/webkit/cts/WebHistoryItemTest.java
index 4f73cdc..016d566 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebHistoryItemTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebHistoryItemTest.java
@@ -27,6 +27,7 @@
import android.test.ActivityInstrumentationTestCase2;
import android.view.animation.cts.DelayedCheck;
import android.webkit.WebBackForwardList;
+import android.webkit.WebChromeClient;
import android.webkit.WebHistoryItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;
@@ -75,6 +76,7 @@
})
public void testWebHistoryItem() {
final WebView view = getActivity().getWebView();
+ view.setWebChromeClient(new WebChromeClient());
WebBackForwardList list = view.copyBackForwardList();
assertEquals(0, list.getSize());
@@ -111,6 +113,7 @@
@BrokenTest(value = "Bug 2121787: Test times out on the host side. Not 100% reproducible.")
public void testRedirect() throws InterruptedException {
final WebView view = getActivity().getWebView();
+ view.setWebChromeClient(new WebChromeClient());
// set the web view client so that redirects are loaded in the WebView itself
view.setWebViewClient(new WebViewClient());
WebBackForwardList list = view.copyBackForwardList();
@@ -137,15 +140,6 @@
// assertEquals(redirect, item.getOriginalUrl());
}
- @TestTargetNew(
- level = TestLevel.NOT_FEASIBLE,
- notes = "clone() is protected and WebHistoryItem cannot be subclassed",
- method = "clone",
- args = {}
- )
- public void testClone() {
- }
-
private void assertLoadUrlSuccessfully(final WebView view, String url) {
view.loadUrl(url);
// wait for the page load to complete
diff --git a/tests/tests/widget/src/android/widget/cts/TextViewTest.java b/tests/tests/widget/src/android/widget/cts/TextViewTest.java
index aad008c..9bd8cc4 100644
--- a/tests/tests/widget/src/android/widget/cts/TextViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/TextViewTest.java
@@ -2699,37 +2699,52 @@
)
})
public void testSingleLine() {
- // singleLine
- mTextView = findTextView(R.id.textview_singleLine);
- setSpannableText(mTextView, "This is a really long sentence"
- + " which can not be placed in one line on the screen.");
+ final TextView textView = new TextView(mActivity);
+ setSpannableText(textView, "This is a really long sentence"
+ + " which can not be placed in one line on the screen.");
- assertEquals(SingleLineTransformationMethod.getInstance(),
- mTextView.getTransformationMethod());
- int singleLineWidth = mTextView.getLayout().getWidth();
- int singleLineHeight = mTextView.getLayout().getHeight();
+ // Narrow layout assures that the text will get wrapped.
+ FrameLayout innerLayout = new FrameLayout(mActivity);
+ innerLayout.setLayoutParams(new ViewGroup.LayoutParams(100, 100));
+ innerLayout.addView(textView);
+
+ final FrameLayout layout = new FrameLayout(mActivity);
+ layout.addView(innerLayout);
mActivity.runOnUiThread(new Runnable() {
public void run() {
- mTextView.setSingleLine(false);
+ mActivity.setContentView(layout);
+ textView.setSingleLine(true);
}
});
mInstrumentation.waitForIdleSync();
- assertEquals(null, mTextView.getTransformationMethod());
- assertTrue(mTextView.getLayout().getHeight() > singleLineHeight);
- assertTrue(mTextView.getLayout().getWidth() < singleLineWidth);
+
+ assertEquals(SingleLineTransformationMethod.getInstance(),
+ textView.getTransformationMethod());
+ int singleLineWidth = textView.getLayout().getWidth();
+ int singleLineHeight = textView.getLayout().getHeight();
+
+ mActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ textView.setSingleLine(false);
+ }
+ });
+ mInstrumentation.waitForIdleSync();
+ assertEquals(null, textView.getTransformationMethod());
+ assertTrue(textView.getLayout().getHeight() > singleLineHeight);
+ assertTrue(textView.getLayout().getWidth() < singleLineWidth);
// same behaviours as setSingLine(true)
mActivity.runOnUiThread(new Runnable() {
public void run() {
- mTextView.setSingleLine();
+ textView.setSingleLine();
}
});
mInstrumentation.waitForIdleSync();
assertEquals(SingleLineTransformationMethod.getInstance(),
- mTextView.getTransformationMethod());
- assertEquals(singleLineHeight, mTextView.getLayout().getHeight());
- assertEquals(singleLineWidth, mTextView.getLayout().getWidth());
+ textView.getTransformationMethod());
+ assertEquals(singleLineHeight, textView.getLayout().getHeight());
+ assertEquals(singleLineWidth, textView.getLayout().getWidth());
}
@TestTargetNew(
diff --git a/tools/cts-api-coverage/Android.mk b/tools/cts-api-coverage/Android.mk
new file mode 100644
index 0000000..2382d61
--- /dev/null
+++ b/tools/cts-api-coverage/Android.mk
@@ -0,0 +1,43 @@
+# 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# We use copy-file-to-new-target so that the installed
+# script file's timestamp is at least as new as the
+# .jar file it wraps.
+
+# the hat script
+# ============================================================
+include $(CLEAR_VARS)
+LOCAL_IS_HOST_MODULE := true
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE := cts-api-coverage
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/$(LOCAL_MODULE)$(COMMON_JAVA_PACKAGE_SUFFIX)
+$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/$(LOCAL_MODULE) | $(ACP)
+ @echo "Copy: $(PRIVATE_MODULE) ($@)"
+ $(copy-file-to-new-target)
+ $(hide) chmod 755 $@
+
+# the other stuff
+# ============================================================
+subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
+ src \
+ ))
+
+include $(subdirs)
diff --git a/tools/cts-api-coverage/etc/cts-api-coverage b/tools/cts-api-coverage/etc/cts-api-coverage
new file mode 100644
index 0000000..fe7278a
--- /dev/null
+++ b/tools/cts-api-coverage/etc/cts-api-coverage
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# 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.
+
+# Set up prog to be the path of this script, including following symlinks,
+# and set up progdir to be the fully-qualified pathname of its directory.
+prog="$0"
+while [ -h "${prog}" ]; do
+ newProg=`/bin/ls -ld "${prog}"`
+ newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
+ if expr "x${newProg}" : 'x/' >/dev/null; then
+ prog="${newProg}"
+ else
+ progdir=`dirname "${prog}"`
+ prog="${progdir}/${newProg}"
+ fi
+done
+oldwd=`pwd`
+progdir=`dirname "${prog}"`
+cd "${progdir}"
+progdir=`pwd`
+prog="${progdir}"/`basename "${prog}"`
+cd "${oldwd}"
+
+libdir=`dirname $progdir`/framework
+
+javaOpts=""
+while expr "x$1" : 'x-J' >/dev/null; do
+ opt=`expr "$1" : '-J\(.*\)'`
+ javaOpts="${javaOpts} -${opt}"
+ shift
+done
+
+exec java $javaOpts -jar $libdir/cts-api-coverage.jar "$@"
diff --git a/tools/cts-api-coverage/src/Android.mk b/tools/cts-api-coverage/src/Android.mk
new file mode 100644
index 0000000..d1fe4ed
--- /dev/null
+++ b/tools/cts-api-coverage/src/Android.mk
@@ -0,0 +1,29 @@
+# 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.
+
+LOCAL_PATH := $(call my-dir)
+
+
+# cts-api-coverage java library
+# ============================================================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+LOCAL_JAVA_RESOURCE_DIRS := res
+LOCAL_JAR_MANIFEST := MANIFEST.mf
+
+LOCAL_MODULE := cts-api-coverage
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/tools/cts-api-coverage/src/MANIFEST.mf b/tools/cts-api-coverage/src/MANIFEST.mf
new file mode 100644
index 0000000..b6aa831
--- /dev/null
+++ b/tools/cts-api-coverage/src/MANIFEST.mf
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Main-Class: com.android.cts.apicoverage.CtsApiCoverage
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiClass.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiClass.java
new file mode 100644
index 0000000..de2e3eb
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiClass.java
@@ -0,0 +1,103 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/** Representation of a class in the API with constructors and methods. */
+class ApiClass implements Comparable<ApiClass>, HasCoverage {
+
+ private final String mName;
+
+ private final List<ApiConstructor> mApiConstructors = new ArrayList<ApiConstructor>();
+
+ private final List<ApiMethod> mApiMethods = new ArrayList<ApiMethod>();
+
+ ApiClass(String name) {
+ this.mName = name;
+ }
+
+ public int compareTo(ApiClass another) {
+ return mName.compareTo(another.mName);
+ }
+
+ public String getName() {
+ return mName;
+ }
+
+ public void addConstructor(ApiConstructor constructor) {
+ mApiConstructors.add(constructor);
+ }
+
+ public ApiConstructor getConstructor(List<String> parameterTypes) {
+ for (ApiConstructor constructor : mApiConstructors) {
+ if (parameterTypes.equals(constructor.getParameterTypes())) {
+ return constructor;
+ }
+ }
+ return null;
+ }
+
+ public Collection<ApiConstructor> getConstructors() {
+ return Collections.unmodifiableList(mApiConstructors);
+ }
+
+ public void addMethod(ApiMethod method) {
+ mApiMethods.add(method);
+ }
+
+ public ApiMethod getMethod(String name, List<String> parameterTypes, String returnType) {
+ for (ApiMethod method : mApiMethods) {
+ if (name.equals(method.getName())
+ && parameterTypes.equals(method.getParameterTypes())
+ && returnType.equals(method.getReturnType())) {
+ return method;
+ }
+ }
+ return null;
+ }
+
+ public Collection<ApiMethod> getMethods() {
+ return Collections.unmodifiableList(mApiMethods);
+ }
+
+ public int getNumCoveredMethods() {
+ int numCovered = 0;
+ for (ApiConstructor constructor : mApiConstructors) {
+ if (constructor.isCovered()) {
+ numCovered++;
+ }
+ }
+ for (ApiMethod method : mApiMethods) {
+ if (method.isCovered()) {
+ numCovered++;
+ }
+ }
+ return numCovered;
+ }
+
+ public int getTotalMethods() {
+ return mApiConstructors.size() + mApiMethods.size();
+ }
+
+ public float getCoveragePercentage() {
+ return (float) getNumCoveredMethods() / getTotalMethods() * 100;
+ }
+}
\ No newline at end of file
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiConstructor.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiConstructor.java
new file mode 100644
index 0000000..b38bd34
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiConstructor.java
@@ -0,0 +1,56 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/** Representation of a constructor in the API with parameters (arguments). */
+class ApiConstructor implements Comparable<ApiConstructor> {
+
+ private final String mName;
+
+ private final List<String> mParameterTypes;
+
+ private boolean mIsCovered;
+
+ ApiConstructor(String name, List<String> parameterTypes) {
+ this.mName = name;
+ this.mParameterTypes = new ArrayList<String>(parameterTypes);
+ }
+
+ public int compareTo(ApiConstructor another) {
+ return mParameterTypes.size() - another.mParameterTypes.size();
+ }
+
+ public String getName() {
+ return mName;
+ }
+
+ public List<String> getParameterTypes() {
+ return Collections.unmodifiableList(mParameterTypes);
+ }
+
+ public boolean isCovered() {
+ return mIsCovered;
+ }
+
+ public void setCovered(boolean covered) {
+ mIsCovered = covered;
+ }
+}
\ No newline at end of file
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiCoverage.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiCoverage.java
new file mode 100644
index 0000000..dc40062
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiCoverage.java
@@ -0,0 +1,40 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Representation of the entire API containing packages. */
+class ApiCoverage {
+
+ private final Map<String, ApiPackage> mPackages = new HashMap<String, ApiPackage>();
+
+ public void addPackage(ApiPackage pkg) {
+ mPackages.put(pkg.getName(), pkg);
+ }
+
+ public ApiPackage getPackage(String name) {
+ return mPackages.get(name);
+ }
+
+ public Collection<ApiPackage> getPackages() {
+ return Collections.unmodifiableCollection(mPackages.values());
+ }
+}
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiMethod.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiMethod.java
new file mode 100644
index 0000000..eb67b8e
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiMethod.java
@@ -0,0 +1,63 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/** Representation of a method in the API with parameters (arguments) and a return value. */
+class ApiMethod implements Comparable<ApiMethod> {
+
+ private final String mName;
+
+ private final List<String> mParameterTypes;
+
+ private final String mReturnType;
+
+ private boolean mIsCovered;
+
+ ApiMethod(String name, List<String> parameterTypes, String returnType) {
+ this.mName = name;
+ this.mParameterTypes = new ArrayList<String>(parameterTypes);
+ this.mReturnType = returnType;
+ }
+
+ public int compareTo(ApiMethod another) {
+ return mName.compareTo(another.mName);
+ }
+
+ public String getName() {
+ return mName;
+ }
+
+ public List<String> getParameterTypes() {
+ return Collections.unmodifiableList(mParameterTypes);
+ }
+
+ public String getReturnType() {
+ return mReturnType;
+ }
+
+ public boolean isCovered() {
+ return mIsCovered;
+ }
+
+ public void setCovered(boolean covered) {
+ mIsCovered = covered;
+ }
+}
\ No newline at end of file
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiPackage.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiPackage.java
new file mode 100644
index 0000000..f0ca889
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/ApiPackage.java
@@ -0,0 +1,70 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Representation of a package in the API containing classes. */
+class ApiPackage implements HasCoverage {
+
+ private final String mName;
+
+ private final Map<String, ApiClass> mApiClassMap = new HashMap<String, ApiClass>();
+
+ ApiPackage(String name) {
+ this.mName = name;
+ }
+
+ public String getName() {
+ return mName;
+ }
+
+ public void addClass(ApiClass apiClass) {
+ mApiClassMap.put(apiClass.getName(), apiClass);
+ }
+
+ public ApiClass getClass(String name) {
+ return mApiClassMap.get(name);
+ }
+
+ public Collection<ApiClass> getClasses() {
+ return Collections.unmodifiableCollection(mApiClassMap.values());
+ }
+
+ public int getNumCoveredMethods() {
+ int covered = 0;
+ for (ApiClass apiClass : mApiClassMap.values()) {
+ covered += apiClass.getNumCoveredMethods();
+ }
+ return covered;
+ }
+
+ public int getTotalMethods() {
+ int total = 0;
+ for (ApiClass apiClass : mApiClassMap.values()) {
+ total += apiClass.getTotalMethods();
+ }
+ return total;
+ }
+
+ public float getCoveragePercentage() {
+ return (float) getNumCoveredMethods() / getTotalMethods() * 100;
+ }
+}
\ No newline at end of file
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/CtsApiCoverage.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/CtsApiCoverage.java
new file mode 100644
index 0000000..d6a218e
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/CtsApiCoverage.java
@@ -0,0 +1,194 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.transform.TransformerException;
+
+/**
+ * Tool that generates a report of what Android framework methods are being called from a given
+ * set of APKS. See the {@link #printUsage()} method for more details.
+ */
+public class CtsApiCoverage {
+
+ private static final int FORMAT_TXT = 0;
+
+ private static final int FORMAT_XML = 1;
+
+ private static final int FORMAT_HTML = 2;
+
+ private static void printUsage() {
+ System.out.println("Usage: cts-api-coverage [OPTION]... [APK]...");
+ System.out.println();
+ System.out.println("Generates a report about what Android framework methods are called ");
+ System.out.println("from the given APKs.");
+ System.out.println();
+ System.out.println("Use the Makefiles rules in CtsTestCoverage.mk to generate the report ");
+ System.out.println("rather than executing this directly. If you still want to run this ");
+ System.out.println("directly, then this must be used from the $ANDROID_BUILD_TOP ");
+ System.out.println("directory and dexdeps must be built via \"make dexdeps\".");
+ System.out.println();
+ System.out.println("Options:");
+ System.out.println(" -o FILE output file or standard out if not given");
+ System.out.println(" -f [txt|xml|html] format of output");
+ System.out.println(" -d PATH path to dexdeps or expected to be in $PATH");
+ System.out.println();
+ System.exit(1);
+ }
+
+ public static void main(String[] args) throws Exception {
+ List<File> testApks = new ArrayList<File>();
+ File outputFile = null;
+ int format = FORMAT_TXT;
+ String dexDeps = "dexDeps";
+
+ for (int i = 0; i < args.length; i++) {
+ if (args[i].startsWith("-")) {
+ if ("-o".equals(args[i])) {
+ outputFile = new File(getExpectedArg(args, ++i));
+ } else if ("-f".equals(args[i])) {
+ String formatSpec = getExpectedArg(args, ++i);
+ if ("xml".equalsIgnoreCase(formatSpec)) {
+ format = FORMAT_XML;
+ } else if ("txt".equalsIgnoreCase(formatSpec)) {
+ format = FORMAT_TXT;
+ } else if ("html".equalsIgnoreCase(formatSpec)) {
+ format = FORMAT_HTML;
+ } else {
+ printUsage();
+ }
+ } else if ("-d".equals(args[i])) {
+ dexDeps = getExpectedArg(args, ++i);
+ } else {
+ printUsage();
+ }
+ } else {
+ testApks.add(new File(args[i]));
+ }
+ }
+
+ /*
+ * 1. Create an ApiCoverage object that is a tree of Java objects representing the API
+ * in current.xml. The object will have no information about the coverage for each
+ * constructor or method yet.
+ *
+ * 2. For each provided APK, scan it using dexdeps, parse the output of dexdeps, and
+ * call methods on the ApiCoverage object to cumulatively add coverage stats.
+ *
+ * 3. Output a report based on the coverage stats in the ApiCoverage object.
+ */
+
+ ApiCoverage apiCoverage = getEmptyApiCoverage();
+ for (File testApk : testApks) {
+ addApiCoverage(apiCoverage, testApk, dexDeps);
+ }
+ outputCoverageReport(apiCoverage, testApks, outputFile, format);
+ }
+
+ /** Get the argument or print out the usage and exit. */
+ private static String getExpectedArg(String[] args, int index) {
+ if (index < args.length) {
+ return args[index];
+ } else {
+ printUsage();
+ return null; // Never will happen because printUsage will call exit(1)
+ }
+ }
+
+ /**
+ * Creates an object representing the API that will be used later to collect coverage
+ * statistics as we iterate over the test APKs.
+ *
+ * @return an {@link ApiCoverage} object representing the API in current.xml without any
+ * coverage statistics yet
+ */
+ private static ApiCoverage getEmptyApiCoverage()
+ throws SAXException, IOException {
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+ CurrentXmlHandler currentXmlHandler = new CurrentXmlHandler();
+ xmlReader.setContentHandler(currentXmlHandler);
+
+ File currentXml = new File("frameworks/base/api/current.xml");
+ FileReader fileReader = null;
+ try {
+ fileReader = new FileReader(currentXml);
+ xmlReader.parse(new InputSource(fileReader));
+ } finally {
+ if (fileReader != null) {
+ fileReader.close();
+ }
+ }
+
+ return currentXmlHandler.getApi();
+ }
+
+ /**
+ * Adds coverage information gleamed from running dexdeps on the APK to the
+ * {@link ApiCoverage} object.
+ *
+ * @param apiCoverage object to which the coverage statistics will be added to
+ * @param testApk containing the tests that will be scanned by dexdeps
+ */
+ private static void addApiCoverage(ApiCoverage apiCoverage, File testApk, String dexdeps)
+ throws SAXException, IOException {
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+ DexDepsXmlHandler dexDepsXmlHandler = new DexDepsXmlHandler(apiCoverage);
+ xmlReader.setContentHandler(dexDepsXmlHandler);
+
+ Process process = new ProcessBuilder(dexdeps, "--format=xml", testApk.getPath()).start();
+ xmlReader.parse(new InputSource(process.getInputStream()));
+ }
+
+ private static void outputCoverageReport(ApiCoverage apiCoverage, List<File> testApks,
+ File outputFile, int format) throws IOException, TransformerException,
+ InterruptedException {
+
+ OutputStream out = outputFile != null
+ ? new FileOutputStream(outputFile)
+ : System.out;
+
+ try {
+ switch (format) {
+ case FORMAT_TXT:
+ TextReport.printTextReport(apiCoverage, out);
+ break;
+
+ case FORMAT_XML:
+ XmlReport.printXmlReport(testApks, apiCoverage, out);
+ break;
+
+ case FORMAT_HTML:
+ HtmlReport.printHtmlReport(testApks, apiCoverage, out);
+ break;
+ }
+ } finally {
+ out.close();
+ }
+ }
+}
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/CurrentXmlHandler.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/CurrentXmlHandler.java
new file mode 100644
index 0000000..41ee0dc
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/CurrentXmlHandler.java
@@ -0,0 +1,100 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * {@link DefaultHandler} that builds an empty {@link ApiCoverage} object from scanning current.xml.
+ */
+class CurrentXmlHandler extends DefaultHandler {
+
+ private String mCurrentPackageName;
+
+ private String mCurrentClassName;
+
+ private String mCurrentMethodName;
+
+ private String mCurrentMethodReturnType;
+
+ private List<String> mCurrentParameterTypes = new ArrayList<String>();
+
+ private ApiCoverage mApiCoverage = new ApiCoverage();
+
+ public ApiCoverage getApi() {
+ return mApiCoverage;
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String name, Attributes attributes)
+ throws SAXException {
+ super.startElement(uri, localName, name, attributes);
+ if ("package".equalsIgnoreCase(localName)) {
+ mCurrentPackageName = CurrentXmlHandler.getValue(attributes, "name");
+
+ ApiPackage apiPackage = new ApiPackage(mCurrentPackageName);
+ mApiCoverage.addPackage(apiPackage);
+
+ } else if ("class".equalsIgnoreCase(localName)
+ || "interface".equalsIgnoreCase(localName)) {
+ mCurrentClassName = CurrentXmlHandler.getValue(attributes, "name");
+
+ ApiClass apiClass = new ApiClass(mCurrentClassName);
+ ApiPackage apiPackage = mApiCoverage.getPackage(mCurrentPackageName);
+ apiPackage.addClass(apiClass);
+
+ } else if ("constructor".equalsIgnoreCase(localName)) {
+ mCurrentParameterTypes.clear();
+ } else if ("method".equalsIgnoreCase(localName)) {
+ mCurrentMethodName = CurrentXmlHandler.getValue(attributes, "name");
+ mCurrentMethodReturnType = CurrentXmlHandler.getValue(attributes, "return");
+ mCurrentParameterTypes.clear();
+ } else if ("parameter".equalsIgnoreCase(localName)) {
+ mCurrentParameterTypes.add(CurrentXmlHandler.getValue(attributes, "type"));
+ }
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String name) throws SAXException {
+ super.endElement(uri, localName, name);
+ if ("constructor".equalsIgnoreCase(localName)) {
+ ApiConstructor apiConstructor = new ApiConstructor(mCurrentClassName,
+ mCurrentParameterTypes);
+ ApiPackage apiPackage = mApiCoverage.getPackage(mCurrentPackageName);
+ ApiClass apiClass = apiPackage.getClass(mCurrentClassName);
+ apiClass.addConstructor(apiConstructor);
+ } else if ("method".equalsIgnoreCase(localName)) {
+ ApiMethod apiMethod = new ApiMethod(mCurrentMethodName, mCurrentParameterTypes,
+ mCurrentMethodReturnType);
+ ApiPackage apiPackage = mApiCoverage.getPackage(mCurrentPackageName);
+ ApiClass apiClass = apiPackage.getClass(mCurrentClassName);
+ apiClass.addMethod(apiMethod);
+ }
+ }
+
+ static String getValue(Attributes attributes, String key) {
+ // Strip away generics <...> and make inner classes always use a "." rather than "$".
+ return attributes.getValue(key)
+ .replaceAll("<.+>", "")
+ .replace("$", ".");
+ }
+}
\ No newline at end of file
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/DexDepsXmlHandler.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/DexDepsXmlHandler.java
new file mode 100644
index 0000000..0a90bdd
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/DexDepsXmlHandler.java
@@ -0,0 +1,96 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * {@link DefaultHander} that parses the output of dexdeps and adds the coverage information to
+ * an {@link ApiCoverage} object.
+ */
+class DexDepsXmlHandler extends DefaultHandler {
+
+ private final ApiCoverage mPackageMap;
+
+ private String mCurrentPackageName;
+
+ private String mCurrentClassName;
+
+ private String mCurrentMethodName;
+
+ private String mCurrentMethodReturnType;
+
+ private List<String> mCurrentParameterTypes = new ArrayList<String>();
+
+ DexDepsXmlHandler(ApiCoverage packageMap) {
+ this.mPackageMap = packageMap;
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String name, Attributes attributes)
+ throws SAXException {
+ super.startElement(uri, localName, name, attributes);
+ if ("package".equalsIgnoreCase(localName)) {
+ mCurrentPackageName = CurrentXmlHandler.getValue(attributes, "name");
+ } else if ("class".equalsIgnoreCase(localName)
+ || "interface".equalsIgnoreCase(localName)) {
+ mCurrentClassName = CurrentXmlHandler.getValue(attributes, "name");
+ } else if ("constructor".equalsIgnoreCase(localName)) {
+ mCurrentParameterTypes.clear();
+ } else if ("method".equalsIgnoreCase(localName)) {
+ mCurrentMethodName = CurrentXmlHandler.getValue(attributes, "name");
+ mCurrentMethodReturnType = CurrentXmlHandler.getValue(attributes, "return");
+ mCurrentParameterTypes.clear();
+ } else if ("parameter".equalsIgnoreCase(localName)) {
+ mCurrentParameterTypes.add(CurrentXmlHandler.getValue(attributes, "type"));
+ }
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String name) throws SAXException {
+ super.endElement(uri, localName, name);
+ if ("constructor".equalsIgnoreCase(localName)) {
+ ApiPackage apiPackage = mPackageMap.getPackage(mCurrentPackageName);
+ if (apiPackage != null) {
+ ApiClass apiClass = apiPackage.getClass(mCurrentClassName);
+ if (apiClass != null) {
+ ApiConstructor apiConstructor = apiClass.getConstructor(mCurrentParameterTypes);
+ if (apiConstructor != null) {
+ apiConstructor.setCovered(true);
+ }
+ }
+ }
+ } else if ("method".equalsIgnoreCase(localName)) {
+ ApiPackage apiPackage = mPackageMap.getPackage(mCurrentPackageName);
+ if (apiPackage != null) {
+ ApiClass apiClass = apiPackage.getClass(mCurrentClassName);
+ if (apiClass != null) {
+ ApiMethod apiMethod = apiClass.getMethod(mCurrentMethodName,
+ mCurrentParameterTypes, mCurrentMethodReturnType);
+ if (apiMethod != null) {
+ apiMethod.setCovered(true);
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/HasCoverage.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/HasCoverage.java
new file mode 100644
index 0000000..3b369bb
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/HasCoverage.java
@@ -0,0 +1,32 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import java.util.Comparator;
+
+interface HasCoverage {
+ float getCoveragePercentage();
+ String getName();
+}
+
+class CoverageComparator implements Comparator<HasCoverage> {
+ public int compare(HasCoverage entity, HasCoverage otherEntity) {
+ int diff = Math.round(entity.getCoveragePercentage())
+ - Math.round(otherEntity.getCoveragePercentage());
+ return diff != 0 ? diff : entity.getName().compareTo(otherEntity.getName());
+ }
+}
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/HtmlReport.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/HtmlReport.java
new file mode 100644
index 0000000..de9b7a6
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/HtmlReport.java
@@ -0,0 +1,67 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
+import java.util.List;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+/**
+ * Class that outputs an HTML report of the {@link ApiCoverage} collected. It is the XML report
+ * transformed into HTML.
+ */
+class HtmlReport {
+
+ public static void printHtmlReport(final List<File> testApks, final ApiCoverage apiCoverage,
+ final OutputStream out) throws IOException, TransformerException, InterruptedException {
+ final PipedOutputStream xmlOut = new PipedOutputStream();
+ final PipedInputStream xmlIn = new PipedInputStream(xmlOut);
+
+ Thread t = new Thread(new Runnable() {
+ public void run() {
+ XmlReport.printXmlReport(testApks, apiCoverage, xmlOut);
+
+ // Close the output stream to avoid "Write dead end" errors.
+ try {
+ xmlOut.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ t.start();
+
+ InputStream xsl = CtsApiCoverage.class.getResourceAsStream("/api-coverage.xsl");
+ StreamSource xslSource = new StreamSource(xsl);
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer = factory.newTransformer(xslSource);
+
+ StreamSource xmlSource = new StreamSource(xmlIn);
+ StreamResult result = new StreamResult(out);
+ transformer.transform(xmlSource, result);
+ }
+}
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/TextReport.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/TextReport.java
new file mode 100644
index 0000000..ebcefe5
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/TextReport.java
@@ -0,0 +1,118 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Class that outputs a text report of {@link ApiCoverage}.
+ */
+class TextReport {
+
+ public static void printTextReport(ApiCoverage api, OutputStream outputStream) {
+ PrintStream out = new PrintStream(outputStream);
+
+ CoverageComparator comparator = new CoverageComparator();
+ List<ApiPackage> packages = new ArrayList<ApiPackage>(api.getPackages());
+ Collections.sort(packages, comparator);
+
+ for (ApiPackage apiPackage : packages) {
+ if (apiPackage.getName().startsWith("android")
+ && apiPackage.getTotalMethods() > 0) {
+ printPackage(apiPackage, out);
+ }
+ }
+
+ out.println();
+ out.println();
+
+ for (ApiPackage apiPackage : packages) {
+ if (apiPackage.getName().startsWith("android")) {
+ printPackage(apiPackage, out);
+
+ List<ApiClass> classes = new ArrayList<ApiClass>(apiPackage.getClasses());
+ Collections.sort(classes, comparator);
+ for (ApiClass apiClass : classes) {
+ if (apiClass.getTotalMethods() > 0) {
+ printClass(apiClass, out);
+
+ List<ApiConstructor> constructors =
+ new ArrayList<ApiConstructor>(apiClass.getConstructors());
+ Collections.sort(constructors);
+ for (ApiConstructor constructor : constructors) {
+ printConstructor(constructor, out);
+ }
+
+ List<ApiMethod> methods = new ArrayList<ApiMethod>(apiClass.getMethods());
+ Collections.sort(methods);
+ for (ApiMethod method : methods) {
+ printMethod(method, out);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static void printPackage(ApiPackage apiPackage, PrintStream out) {
+ out.println(apiPackage.getName() + " "
+ + Math.round(apiPackage.getCoveragePercentage()) + "% ("
+ + apiPackage.getNumCoveredMethods() + "/" + apiPackage.getTotalMethods() + ")");
+ }
+
+ private static void printClass(ApiClass apiClass, PrintStream out) {
+ out.println(" " + apiClass.getName() + " "
+ + Math.round(apiClass.getCoveragePercentage()) + "% ("
+ + apiClass.getNumCoveredMethods() + "/" + apiClass.getTotalMethods() + ") ");
+ }
+
+ private static void printConstructor(ApiConstructor constructor, PrintStream out) {
+ StringBuilder builder = new StringBuilder(" [")
+ .append(constructor.isCovered() ? "X" : " ")
+ .append("] ").append(constructor.getName()).append("(");
+
+ List<String> parameterTypes = constructor.getParameterTypes();
+ int numParameterTypes = parameterTypes.size();
+ for (int i = 0; i < numParameterTypes; i++) {
+ builder.append(parameterTypes.get(i));
+ if (i + 1 < numParameterTypes) {
+ builder.append(", ");
+ }
+ }
+ out.println(builder.append(")"));
+ }
+
+ private static void printMethod(ApiMethod method, PrintStream out) {
+ StringBuilder builder = new StringBuilder(" [")
+ .append(method.isCovered() ? "X" : " ")
+ .append("] ").append(method.getReturnType()).append(" ")
+ .append(method.getName()).append("(");
+ List<String> parameterTypes = method.getParameterTypes();
+ int numParameterTypes = parameterTypes.size();
+ for (int i = 0; i < numParameterTypes; i++) {
+ builder.append(parameterTypes.get(i));
+ if (i + 1 < numParameterTypes) {
+ builder.append(", ");
+ }
+ }
+ out.println(builder.append(")"));
+ }
+}
diff --git a/tools/cts-api-coverage/src/com/android/cts/apicoverage/XmlReport.java b/tools/cts-api-coverage/src/com/android/cts/apicoverage/XmlReport.java
new file mode 100644
index 0000000..68acf06
--- /dev/null
+++ b/tools/cts-api-coverage/src/com/android/cts/apicoverage/XmlReport.java
@@ -0,0 +1,111 @@
+/*
+ * 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 com.android.cts.apicoverage;
+
+import java.io.File;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Class that outputs an XML report of the {@link ApiCoverage} collected. It can be viewed in
+ * a browser when used with the api-coverage.css and api-coverage.xsl files.
+ */
+class XmlReport {
+
+ public static void printXmlReport(List<File> testApks, ApiCoverage apiCoverage,
+ OutputStream outputStream) {
+ PrintStream out = new PrintStream(outputStream);
+ out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+ out.println("<?xml-stylesheet type=\"text/xsl\" href=\"api-coverage.xsl\"?>");
+
+ SimpleDateFormat format = new SimpleDateFormat("EEE, MMM d, yyyy h:mm a z");
+ String date = format.format(new Date(System.currentTimeMillis()));
+ out.println("<api-coverage generatedTime=\"" + date + "\">");
+
+ out.println("<debug>");
+ out.println("<sources>");
+ for (File testApk : testApks) {
+ out.println("<apk path=\"" + testApk.getPath() + "\" />");
+ }
+ out.println("</sources>");
+ out.println("</debug>");
+
+ out.println("<api>");
+
+ CoverageComparator comparator = new CoverageComparator();
+ List<ApiPackage> packages = new ArrayList<ApiPackage>(apiCoverage.getPackages());
+ Collections.sort(packages, comparator);
+ for (ApiPackage pkg : packages) {
+ if (pkg.getName().startsWith("android")
+ && pkg.getTotalMethods() > 0) {
+ out.println("<package name=\"" + pkg.getName()
+ + "\" numCovered=\"" + pkg.getNumCoveredMethods()
+ + "\" numTotal=\"" + pkg.getTotalMethods()
+ + "\" coveragePercentage=\""
+ + Math.round(pkg.getCoveragePercentage())
+ + "\">");
+
+ List<ApiClass> classes = new ArrayList<ApiClass>(pkg.getClasses());
+ Collections.sort(classes, comparator);
+
+ for (ApiClass apiClass : classes) {
+ if (apiClass.getTotalMethods() > 0) {
+ out.println("<class name=\"" + apiClass.getName()
+ + "\" numCovered=\"" + apiClass.getNumCoveredMethods()
+ + "\" numTotal=\"" + apiClass.getTotalMethods()
+ + "\" coveragePercentage=\""
+ + Math.round(apiClass.getCoveragePercentage())
+ + "\">");
+
+ for (ApiConstructor constructor : apiClass.getConstructors()) {
+ out.println("<constructor name=\"" + constructor.getName()
+ + "\" covered=\"" + constructor.isCovered() + "\">");
+
+ for (String parameterType : constructor.getParameterTypes()) {
+ out.println("<parameter type=\"" + parameterType + "\" />");
+ }
+
+ out.println("</constructor>");
+ }
+
+ for (ApiMethod method : apiClass.getMethods()) {
+ out.println("<method name=\"" + method.getName()
+ + "\" returnType=\"" + method.getReturnType()
+ + "\" covered=\"" + method.isCovered() + "\">");
+
+ for (String parameterType : method.getParameterTypes()) {
+ out.println("<parameter type=\"" + parameterType + "\" />");
+ }
+
+ out.println("</method>");
+ }
+ out.println("</class>");
+ }
+ }
+ out.println("</package>");
+ }
+ }
+
+ out.println("</api>");
+ out.println("</api-coverage>");
+ }
+}
diff --git a/tools/cts-api-coverage/src/res/api-coverage.xsl b/tools/cts-api-coverage/src/res/api-coverage.xsl
new file mode 100644
index 0000000..91fe802
--- /dev/null
+++ b/tools/cts-api-coverage/src/res/api-coverage.xsl
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * 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.
+ -->
+
+<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
+<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" />
+ <xsl:template match="/">
+ <html>
+ <head>
+ <script type="text/javascript">
+ function toggleVisibility(id) {
+ element = document.getElementById(id);
+ if (element.style.display == "none") {
+ element.style.display = "";
+ } else {
+ element.style.display = "none";
+ }
+ }
+ </script>
+ <style type="text/css">
+ body {
+ background-color: #CCCCCC;
+ font-family: sans-serif;
+ margin: 10px;
+ }
+
+ .info {
+ margin-bottom: 10px;
+ }
+
+ .apks, .package, .class {
+ cursor: pointer;
+ text-decoration: underline;
+ }
+
+ .packageDetails {
+ padding-left: 20px;
+ }
+
+ .classDetails {
+ padding-left: 40px;
+ }
+
+ .method {
+ font-family: courier;
+ white-space: nowrap;
+ }
+
+ .red {
+ background-color: #FF0000;
+ }
+
+ .yellow {
+ background-color: #FFFF00;
+ }
+
+ .green {
+ background-color: #00FF00;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>CTS API Coverage</h1>
+ <div class="info">
+ Generated: <xsl:value-of select="api-coverage/@generatedTime" />
+ </div>
+ <div class="apks" onclick="toggleVisibility('sourceApks')">
+ Source APKs (<xsl:value-of select="count(api-coverage/debug/sources/apk)" />)
+ </div>
+ <div id="sourceApks" style="display: none">
+ <ul>
+ <xsl:for-each select="api-coverage/debug/sources/apk">
+ <li><xsl:value-of select="@path" /></li>
+ </xsl:for-each>
+ </ul>
+ </div>
+ <ul>
+ <xsl:for-each select="api-coverage/api/package">
+ <xsl:call-template name="packageOrClassListItem">
+ <xsl:with-param name="bulletClass" select="'package'" />
+ </xsl:call-template>
+ <div class="packageDetails" id="{@name}" style="display: none">
+ <ul>
+ <xsl:for-each select="class">
+ <xsl:call-template name="packageOrClassListItem">
+ <xsl:with-param name="bulletClass" select="'class'" />
+ </xsl:call-template>
+ <div class="classDetails" id="{@name}" style="display: none">
+ <xsl:for-each select="constructor">
+ <xsl:call-template name="methodListItem" />
+ </xsl:for-each>
+ <xsl:for-each select="method">
+ <xsl:call-template name="methodListItem" />
+ </xsl:for-each>
+ </div>
+ </xsl:for-each>
+ </ul>
+ </div>
+ </xsl:for-each>
+ </ul>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="packageOrClassListItem">
+ <xsl:param name="bulletClass" />
+
+ <xsl:variable name="colorClass">
+ <xsl:choose>
+ <xsl:when test="@coveragePercentage <= 50">red</xsl:when>
+ <xsl:when test="@coveragePercentage <= 80">yellow</xsl:when>
+ <xsl:otherwise>green</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <li class="{$bulletClass}" onclick="toggleVisibility('{@name}')">
+ <span class="{$colorClass}">
+ <b><xsl:value-of select="@name" /></b>
+ <xsl:value-of select="@coveragePercentage" />%
+ (<xsl:value-of select="@numCovered" />/<xsl:value-of select="@numTotal" />)
+ </span>
+ </li>
+ </xsl:template>
+
+ <xsl:template name="methodListItem">
+ <span class="method">
+ <xsl:choose>
+ <xsl:when test="@covered = 'true'">[X]</xsl:when>
+ <xsl:otherwise>[ ]</xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@returnType != ''"> <xsl:value-of select="@returnType" /></xsl:if>
+ <b> <xsl:value-of select="@name" /></b><xsl:call-template name="formatParameters" />
+ </span>
+ <br />
+ </xsl:template>
+
+ <xsl:template name="formatParameters">(<xsl:for-each select="parameter">
+ <xsl:value-of select="@type" />
+ <xsl:if test="not(position() = last())">, </xsl:if>
+ </xsl:for-each>)
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoInstrument.java b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoInstrument.java
index 5a2fd6a..54d00b2 100644
--- a/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoInstrument.java
+++ b/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/DeviceInfoInstrument.java
@@ -22,6 +22,7 @@
import android.content.Intent;
import android.content.pm.FeatureInfo;
import android.content.pm.PackageManager;
+import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.telephony.TelephonyManager;
@@ -51,6 +52,8 @@
public static final String KEYPAD = "keypad";
public static final String NAVIGATION = "navigation";
public static final String TOUCH_SCREEN = "touch_screen";
+ private static final String SCREEN_SIZE = "screen_size";
+ private static final String SCREEN_DENSITY_BUCKET = "screen_density_bucket";
private static final String SCREEN_Y_DENSITY = "screen_Y_density";
private static final String SCREEN_X_DENSITY = "screen_X_density";
private static final String SCREEN_DENSITY = "screen_density";
@@ -66,6 +69,7 @@
private static final String BUILD_TYPE = "build_type";
private static final String BUILD_MODEL = "build_model";
private static final String BUILD_BRAND = "build_brand";
+ private static final String BUILD_MANUFACTURER = "build_manufacturer";
private static final String BUILD_BOARD = "build_board";
private static final String BUILD_DEVICE = "build_device";
private static final String PRODUCT_NAME = "product_name";
@@ -88,6 +92,7 @@
addResult(PRODUCT_NAME, Build.PRODUCT);
addResult(BUILD_DEVICE, Build.DEVICE);
addResult(BUILD_BOARD, Build.BOARD);
+ addResult(BUILD_MANUFACTURER, Build.MANUFACTURER);
addResult(BUILD_BRAND, Build.BRAND);
addResult(BUILD_MODEL, Build.MODEL);
addResult(BUILD_TYPE, Build.TYPE);
@@ -111,6 +116,12 @@
addResult(SCREEN_X_DENSITY, metrics.xdpi);
addResult(SCREEN_Y_DENSITY, metrics.ydpi);
+ String screenDensityBucket = getScreenDensityBucket(metrics);
+ addResult(SCREEN_DENSITY_BUCKET, screenDensityBucket);
+
+ String screenSize = getScreenSize();
+ addResult(SCREEN_SIZE, screenSize);
+
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClass(this.getContext(), DeviceInfoActivity.class);
@@ -183,6 +194,49 @@
mResults.putFloat(key, value);
}
+ private String getScreenSize() {
+ Configuration config = getContext().getResources().getConfiguration();
+ int screenLayout = config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
+ String screenSize = String.format("0x%x", screenLayout);
+ switch (screenLayout) {
+ case Configuration.SCREENLAYOUT_SIZE_SMALL:
+ screenSize = "small";
+ break;
+
+ case Configuration.SCREENLAYOUT_SIZE_NORMAL:
+ screenSize = "normal";
+ break;
+
+ case Configuration.SCREENLAYOUT_SIZE_LARGE:
+ screenSize = "large";
+ break;
+
+ case Configuration.SCREENLAYOUT_SIZE_UNDEFINED:
+ screenSize = "undefined";
+ break;
+ }
+ return screenSize;
+ }
+
+ private String getScreenDensityBucket(DisplayMetrics metrics) {
+ switch (metrics.densityDpi) {
+ case DisplayMetrics.DENSITY_LOW:
+ return "ldpi";
+
+ case DisplayMetrics.DENSITY_MEDIUM:
+ return "mdpi";
+
+ case DisplayMetrics.DENSITY_HIGH:
+ return "hdpi";
+
+ case 320:
+ return "xdpi";
+
+ default:
+ return "" + metrics.densityDpi;
+ }
+ }
+
/**
* Return a summary of the device's feature as a semi-colon-delimited list of colon separated
* name and availability pairs like "feature1:sdk:true;feature2:sdk:false;feature3:other:true;".
diff --git a/tools/dx-tests/src/util/CollectAllTests.java b/tools/dx-tests/src/util/CollectAllTests.java
index fa09662..028ec27 100644
--- a/tools/dx-tests/src/util/CollectAllTests.java
+++ b/tools/dx-tests/src/util/CollectAllTests.java
@@ -417,6 +417,9 @@
}
}
}
+ if (reader != null) {
+ reader.close();
+ }
} catch (Exception e) {
throw new RuntimeException("failed to parse", e);
}
@@ -474,6 +477,12 @@
md.methodBody = builder.toString();
md.constraint = constraint;
md.title = title;
+ if (scanner != null) {
+ scanner.close();
+ }
+ if (scanner2 != null) {
+ scanner2.close();
+ }
return md;
}
diff --git a/tools/host/src/com/android/cts/CTSCommand.java b/tools/host/src/com/android/cts/CTSCommand.java
index 88604ff..7755f5c 100644
--- a/tools/host/src/com/android/cts/CTSCommand.java
+++ b/tools/host/src/com/android/cts/CTSCommand.java
@@ -45,5 +45,4 @@
static final String OPTION_SESSION = "--session";
static final String OPTION_CFG = "--config";
static final String OPTION_DERIVED_PLAN = "--derivedplan";
- static final String OPTION_PROFILE = "--profile";
}
diff --git a/tools/host/src/com/android/cts/CommandParser.java b/tools/host/src/com/android/cts/CommandParser.java
index 4c65317..74c3280 100644
--- a/tools/host/src/com/android/cts/CommandParser.java
+++ b/tools/host/src/com/android/cts/CommandParser.java
@@ -54,8 +54,7 @@
private static Set<String> sOptionsSet = new HashSet<String>(Arrays.asList(
CTSCommand.OPTION_CFG, CTSCommand.OPTION_PACKAGE, CTSCommand.OPTION_PLAN,
CTSCommand.OPTION_DEVICE, CTSCommand.OPTION_RESULT, CTSCommand.OPTION_E,
- CTSCommand.OPTION_SESSION, CTSCommand.OPTION_TEST, CTSCommand.OPTION_DERIVED_PLAN,
- CTSCommand.OPTION_PROFILE));
+ CTSCommand.OPTION_SESSION, CTSCommand.OPTION_TEST, CTSCommand.OPTION_DERIVED_PLAN));
private static HashMap<String, String> sOptionMap = new HashMap<String, String>();
static {
final String[] keys = new String[] {
@@ -72,8 +71,7 @@
CTSCommand.OPTION_SESSION,
CTSCommand.OPTION_T,
CTSCommand.OPTION_TEST,
- CTSCommand.OPTION_DERIVED_PLAN,
- CTSCommand.OPTION_PROFILE};
+ CTSCommand.OPTION_DERIVED_PLAN};
final String[] values = new String[] {
CTSCommand.OPTION_CFG,
@@ -89,8 +87,7 @@
CTSCommand.OPTION_SESSION,
CTSCommand.OPTION_TEST,
CTSCommand.OPTION_TEST,
- CTSCommand.OPTION_DERIVED_PLAN,
- CTSCommand.OPTION_PROFILE};
+ CTSCommand.OPTION_DERIVED_PLAN};
for (int i = 0; i < keys.length; i++) {
sOptionMap.put(keys[i], values[i]);
diff --git a/tools/host/src/com/android/cts/ConsoleUi.java b/tools/host/src/com/android/cts/ConsoleUi.java
index 702631d..c9b0e1d 100644
--- a/tools/host/src/com/android/cts/ConsoleUi.java
+++ b/tools/host/src/com/android/cts/ConsoleUi.java
@@ -21,8 +21,6 @@
import org.xml.sax.SAXException;
-import android.annotation.cts.Profile;
-
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
@@ -82,6 +80,7 @@
mResultCodeMap.put(CtsTestResult.STR_ERROR, CtsTestResult.CODE_ERROR);
mResultCodeMap.put(CtsTestResult.STR_NOT_EXECUTED, CtsTestResult.CODE_NOT_EXECUTED);
mResultCodeMap.put(CtsTestResult.STR_TIMEOUT, CtsTestResult.CODE_TIMEOUT);
+ mResultCodeMap.put(CtsTestResult.STR_OMITTED, CtsTestResult.CODE_OMITTED);
}
public ConsoleUi(TestHost host) {
@@ -255,27 +254,25 @@
final String testStr = CTSCommand.OPTION_T + "/" + CTSCommand.OPTION_TEST;
final String deviceStr = CTSCommand.OPTION_D + "/" + CTSCommand.OPTION_DEVICE;
final String pkgStr = CTSCommand.OPTION_P + "/" + CTSCommand.OPTION_PACKAGE;
- final String profileOptionStr = "[" + CTSCommand.OPTION_PROFILE + " profile_name]";
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
- + cmdStr + " test_plan_name " + profileOptionStr
- + ": run a test plan");
+ + cmdStr + " test_plan_name: run a test plan");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
- + cmdStr + " test_plan_name " + deviceStr + " device_ID " + profileOptionStr
+ + cmdStr + " test_plan_name " + deviceStr + " device_ID"
+ ": run a test plan using the specified device");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
- + cmdStr + " test_plan_name " + testStr + " test_name " + profileOptionStr
+ + cmdStr + " test_plan_name " + testStr + " test_name"
+ ": run a specific test");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
- + cmdStr + " test_plan_name " + pkgStr + " java_package_name " + profileOptionStr
+ + cmdStr + " test_plan_name " + pkgStr + " java_package_name"
+ ": run a specific java package");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
+ cmdStr + " test_plan_name " + testStr + " test_name "
- + deviceStr + " device_ID " + profileOptionStr
+ + deviceStr + " device_ID"
+ ": run a specific test using the specified device");
CUIOutputStream.println(CMD_OPT_LEADING_SPACE
+ cmdStr + " test_plan_name " + pkgStr + " java_package_name "
- + deviceStr + " device_ID " + profileOptionStr
+ + deviceStr + " device_ID"
+ ": run a specific java package using the specified device");
}
@@ -363,7 +360,7 @@
private void processStartPackageCommand(CommandParser cp) {
try {
String pathName = cp.getValue(CTSCommand.OPTION_PACKAGE);
- mHost.startZippedPackage(pathName, getProfile(cp));
+ mHost.startZippedPackage(pathName);
} catch (DeviceDisconnectedException e) {
Log.e("Device " + e.getMessage() + " disconnected", e);
} catch (Exception e) {
@@ -393,9 +390,6 @@
} else if (isValidCommandOption(cp, CTSCommand.START,
CTSCommand.OPTION_P)) {
return true;
- } else if (isValidCommandOption(cp, CTSCommand.START,
- CTSCommand.OPTION_PROFILE)) {
- return true;
} else {
return false;
}
@@ -441,8 +435,6 @@
return;
}
- Profile profile = getProfile(cp);
-
String testPlanPath = null;
String deviceId = null;
String testName = null;
@@ -484,7 +476,7 @@
if ((testName == null) || (testName.length() == 0)) {
String mode = chooseMode(sessionList);
if (CREATE_SESSION.equals(mode)) {
- ts = TestHost.createSession(testPlanName, profile);
+ ts = TestHost.createSession(testPlanName);
}
}
if (ts == null) {
@@ -522,7 +514,7 @@
}
if (ts == null) {
- ts = TestHost.createSession(testPlanName, profile);
+ ts = TestHost.createSession(testPlanName);
}
mHost.startSession(ts, deviceId, testName, javaPkgName, actionType);
@@ -549,15 +541,6 @@
}
}
- private Profile getProfile(CommandParser cp) {
- String profileOption = cp.getValue(CTSCommand.OPTION_PROFILE);
- if (profileOption != null) {
- return Profile.valueOf(profileOption.toUpperCase());
- } else {
- return Profile.ALL;
- }
- }
-
/**
* Choose test session among the available test session list.
*
@@ -1200,9 +1183,9 @@
CUIOutputStream.println("There aren't any test results!");
} else {
CUIOutputStream.println("List of all results: ");
- CUIOutputStream.println("Session\t\tTest result\t\t\t\tStart time\t\tEnd time\t"
- + "\tProfile\tTest plan name\t");
- CUIOutputStream.println("\t\tPass\tFail\tTimeout\tNotExecuted");
+ CUIOutputStream.println("Session\t\tTest result\t\t\t\t\tStart time\t\tEnd time\t"
+ + "\tTest plan name\t");
+ CUIOutputStream.println("\t\tPass\tFail\tTimeout\tOmitted\tNotExecuted");
for (TestSession session : sessions) {
TestSessionLog log = session.getSessionLog();
@@ -1210,6 +1193,8 @@
CtsTestResult.CODE_PASS).size();
int failNum = log.getTestList(
CtsTestResult.CODE_FAIL).size();
+ int omittedNum = log.getTestList(
+ CtsTestResult.CODE_OMITTED).size();
int notExecutedNum = log.getTestList(
CtsTestResult.CODE_NOT_EXECUTED).size();
int timeOutNum = log.getTestList(
@@ -1217,6 +1202,7 @@
String resStr = Long.toString(passNum) + "\t" + failNum;
resStr += "\t" + timeOutNum;
+ resStr += "\t" + omittedNum;
resStr += "\t" + notExecutedNum;
String startTimeStr =
@@ -1226,7 +1212,6 @@
CUIOutputStream.println(Long.toString(session.getId()) + "\t\t"
+ resStr + "\t\t" + startTimeStr
+ "\t" + endTimeStr
- + "\t" + log.getProfile().name()
+ "\t" + log.getTestPlanName());
}
diff --git a/tools/host/src/com/android/cts/CtsTestResult.java b/tools/host/src/com/android/cts/CtsTestResult.java
index a02c445..851b07d 100644
--- a/tools/host/src/com/android/cts/CtsTestResult.java
+++ b/tools/host/src/com/android/cts/CtsTestResult.java
@@ -37,12 +37,14 @@
public static final int CODE_FAIL = 2;
public static final int CODE_ERROR = 3;
public static final int CODE_TIMEOUT = 4;
+ public static final int CODE_OMITTED = 5;
public static final int CODE_FIRST = CODE_INIT;
- public static final int CODE_LAST = CODE_TIMEOUT;
+ public static final int CODE_LAST = CODE_OMITTED;
public static final String STR_ERROR = "error";
public static final String STR_TIMEOUT = "timeout";
public static final String STR_NOT_EXECUTED = "notExecuted";
+ public static final String STR_OMITTED = "omitted";
public static final String STR_FAIL = "fail";
public static final String STR_PASS = "pass";
@@ -55,6 +57,7 @@
sCodeToResultMap.put(CODE_FAIL, STR_FAIL);
sCodeToResultMap.put(CODE_ERROR, STR_ERROR);
sCodeToResultMap.put(CODE_TIMEOUT, STR_TIMEOUT);
+ sCodeToResultMap.put(CODE_OMITTED, STR_OMITTED);
sResultToCodeMap = new HashMap<String, Integer>();
for (int code : sCodeToResultMap.keySet()) {
sResultToCodeMap.put(sCodeToResultMap.get(code), code);
@@ -154,7 +157,7 @@
int resCode = CODE_PASS;
String failedMessage = null;
String stackTrace = null;
- if ((testResult != null) && (testResult.failureCount() > 0)) {
+ if ((testResult != null) && (testResult.failureCount() > 0 || testResult.errorCount() > 0)) {
resCode = CODE_FAIL;
Enumeration<TestFailure> failures = testResult.failures();
while (failures.hasMoreElements()) {
@@ -162,6 +165,12 @@
failedMessage += failure.exceptionMessage();
stackTrace += failure.trace();
}
+ Enumeration<TestFailure> errors = testResult.errors();
+ while (errors.hasMoreElements()) {
+ TestFailure failure = errors.nextElement();
+ failedMessage += failure.exceptionMessage();
+ stackTrace += failure.trace();
+ }
}
mResultCode = resCode;
mFailedMessage = failedMessage;
diff --git a/tools/host/src/com/android/cts/DeviceManager.java b/tools/host/src/com/android/cts/DeviceManager.java
index 528036e..c164ac1 100644
--- a/tools/host/src/com/android/cts/DeviceManager.java
+++ b/tools/host/src/com/android/cts/DeviceManager.java
@@ -218,7 +218,7 @@
try {
Thread.sleep(100);
} catch (InterruptedException e) {
- Log.e("", e);
+ Log.d("polling for device sync service interrupted");
}
}
CUIOutputStream.println("Device(" + mDevice + ") connected");
diff --git a/tools/host/src/com/android/cts/HostSideOnlyPackage.java b/tools/host/src/com/android/cts/HostSideOnlyPackage.java
index 144be06..0dab280 100644
--- a/tools/host/src/com/android/cts/HostSideOnlyPackage.java
+++ b/tools/host/src/com/android/cts/HostSideOnlyPackage.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.io.IOException;
/**
@@ -49,12 +47,12 @@
/** {@inheritDoc} */
@Override
- protected void runImpl(final String javaPkgName, Profile profile)
+ protected void runImpl(final String javaPkgName)
throws IOException, DeviceDisconnectedException, ADBServerNeedRestartException {
try {
if (!mTestStop) {
Log.d("run in individual mode...");
- runInIndividualMode(javaPkgName, profile);
+ runInIndividualMode(javaPkgName);
}
} catch (DeviceDisconnectedException e) {
cleanUp();
@@ -64,12 +62,12 @@
/** {@inheritDoc} */
@Override
- protected void runTestImpl(final Test test, Profile profile) throws DeviceDisconnectedException,
+ protected void runTestImpl(final Test test) throws DeviceDisconnectedException,
ADBServerNeedRestartException {
try {
if (!mTestStop) {
mCurrentTestSuite = test.getTestSuite();
- mCurrentTestSuite.run(mDevice, test, profile);
+ mCurrentTestSuite.run(mDevice, test);
}
} catch (DeviceDisconnectedException e) {
cleanUp();
diff --git a/tools/host/src/com/android/cts/HostSideOnlyTest.java b/tools/host/src/com/android/cts/HostSideOnlyTest.java
index 5318834..187fc53 100644
--- a/tools/host/src/com/android/cts/HostSideOnlyTest.java
+++ b/tools/host/src/com/android/cts/HostSideOnlyTest.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.io.IOException;
import junit.framework.TestResult;
@@ -79,7 +77,7 @@
/** {@inheritDoc} */
@Override
- protected void runImpl(Profile profile) {
+ protected void runImpl() {
mHostSideTestRunner = new HostSideTestRunner(this);
mHostSideTestRunner.start();
}
diff --git a/tools/host/src/com/android/cts/Log.java b/tools/host/src/com/android/cts/Log.java
index 9ee99c8..4c6e2c8 100644
--- a/tools/host/src/com/android/cts/Log.java
+++ b/tools/host/src/com/android/cts/Log.java
@@ -73,7 +73,7 @@
if (!HostConfig.DEBUG) {
CUIOutputStream.println(ERROR_PREFIX + msg);
if (e != null) {
- CUIOutputStream.println(e.getMessage());
+ CUIOutputStream.println(e.toString());
}
return;
}
diff --git a/tools/host/src/com/android/cts/ReferenceAppTestPackage.java b/tools/host/src/com/android/cts/ReferenceAppTestPackage.java
index b57f2ac..1b32576 100644
--- a/tools/host/src/com/android/cts/ReferenceAppTestPackage.java
+++ b/tools/host/src/com/android/cts/ReferenceAppTestPackage.java
@@ -21,8 +21,6 @@
import com.android.ddmlib.log.LogReceiver.ILogListener;
import com.android.ddmlib.log.LogReceiver.LogEntry;
-import android.annotation.cts.Profile;
-
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
diff --git a/tools/host/src/com/android/cts/SignatureCheckPackage.java b/tools/host/src/com/android/cts/SignatureCheckPackage.java
index 8692c9d..ddc06a0 100644
--- a/tools/host/src/com/android/cts/SignatureCheckPackage.java
+++ b/tools/host/src/com/android/cts/SignatureCheckPackage.java
@@ -18,8 +18,6 @@
import com.android.ddmlib.MultiLineReceiver;
-import android.annotation.cts.Profile;
-
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/tools/host/src/com/android/cts/Test.java b/tools/host/src/com/android/cts/Test.java
index 00411a0..2cd119b 100644
--- a/tools/host/src/com/android/cts/Test.java
+++ b/tools/host/src/com/android/cts/Test.java
@@ -18,8 +18,6 @@
import com.android.cts.TestSession.ResultObserver;
-import android.annotation.cts.Profile;
-
import java.util.TimerTask;
/**
@@ -318,9 +316,8 @@
* Run the test over device given.
*
* @param device the device to run the test.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, Profile profile) throws DeviceDisconnectedException,
+ public void run(final TestDevice device) throws DeviceDisconnectedException,
ADBServerNeedRestartException {
if ((getName() == null) || (getName().length() == 0)) {
@@ -345,7 +342,7 @@
String testFullName = getFullName();
print(testFullName + "...");
- runImpl(profile);
+ runImpl();
synchronized (mTimeOutTimer) {
if (!mTestStop) {
@@ -372,8 +369,8 @@
/**
* Implementation of running test.
*/
- protected void runImpl(Profile profile) throws DeviceDisconnectedException {
- mDevice.runTest(this, profile);
+ protected void runImpl() throws DeviceDisconnectedException {
+ mDevice.runTest(this);
}
/**
diff --git a/tools/host/src/com/android/cts/TestCase.java b/tools/host/src/com/android/cts/TestCase.java
index bc4f14b..799dc15 100644
--- a/tools/host/src/com/android/cts/TestCase.java
+++ b/tools/host/src/com/android/cts/TestCase.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -192,16 +190,15 @@
* Run the test case over device given.
*
* @param device The device to run the test case over.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, Profile profile) throws DeviceDisconnectedException,
+ public void run(final TestDevice device) throws DeviceDisconnectedException,
ADBServerNeedRestartException {
mTestStop = false;
Iterator<Test> tests = getTests().iterator();
while (tests.hasNext() && (!mTestStop)) {
mCurrentTest = tests.next();
if (mCurrentTest.getResult().isNotExecuted()) {
- mCurrentTest.run(device, profile);
+ mCurrentTest.run(device);
}
}
}
@@ -211,13 +208,12 @@
*
* @param device The device to run the test over.
* @param test The specific test to be run.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, final Test test, Profile profile)
+ public void run(final TestDevice device, final Test test)
throws DeviceDisconnectedException, ADBServerNeedRestartException {
mTestStop = false;
mCurrentTest = test;
- mCurrentTest.run(device, profile);
+ mCurrentTest.run(device);
}
/** {@inheritDoc} */
diff --git a/tools/host/src/com/android/cts/TestDevice.java b/tools/host/src/com/android/cts/TestDevice.java
index 661dcdb..987fd96 100644
--- a/tools/host/src/com/android/cts/TestDevice.java
+++ b/tools/host/src/com/android/cts/TestDevice.java
@@ -29,8 +29,6 @@
import com.android.ddmlib.log.LogReceiver;
import com.android.ddmlib.log.LogReceiver.ILogListener;
-import android.annotation.cts.Profile;
-
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@@ -399,15 +397,18 @@
public static final String BUILD_FINGERPRINT = "build_fingerprint";
public static final String BUILD_TAGS = "build_tags";
public static final String BUILD_TYPE = "build_type";
+ public static final String BUILD_MANUFACTURER = "build_manufacturer";
public static final String BUILD_MODEL = "build_model";
public static final String BUILD_BRAND = "build_brand";
public static final String BUILD_BOARD = "build_board";
public static final String BUILD_DEVICE = "build_device";
public static final String BUILD_ABI = "build_abi";
public static final String BUILD_ABI2 = "build_abi2";
+ public static final String SCREEN_SIZE = "screen_size";
public static final String SCREEN_HEIGHT = "screen_height";
public static final String SCREEN_WIDTH = "screen_width";
public static final String SCREEN_DENSITY = "screen_density";
+ public static final String SCREEN_DENSITY_BUCKET = "screen_density_bucket";
public static final String SERIAL_NUMBER = "serialNumber";
public static final String VERSION_SDK = "version_sdk";
public static final String LOCALES = "locales";
@@ -603,6 +604,15 @@
}
/**
+ * Get the build manufacturer.
+ *
+ * @return The build manufacturer.
+ */
+ public String getBuildManufacturer() {
+ return mInfoMap.get(BUILD_MANUFACTURER);
+ }
+
+ /**
* Get the build brand.
*
* @return The build brand.
@@ -683,6 +693,10 @@
return mInfoMap.get(SERIAL_NUMBER);
}
+ public String getScreenSize() {
+ return mInfoMap.get(SCREEN_SIZE);
+ }
+
/**
* Return screen resolution(width x height)
*
@@ -693,6 +707,24 @@
}
/**
+ * Return logical screen density
+ *
+ * @return The logical screen density.
+ */
+ public String getScreenDensity() {
+ return mInfoMap.get(SCREEN_DENSITY);
+ }
+
+ /**
+ * Return the probable screen density bucket
+ *
+ * @return The probable screen density bucket.
+ */
+ public String getScreenDensityBucket() {
+ return mInfoMap.get(SCREEN_DENSITY_BUCKET);
+ }
+
+ /**
* Get Android platform version.
*
* @return The Android platform version.
@@ -836,7 +868,7 @@
*
* @param test The test to be run.
*/
- public void runTest(Test test, Profile profile) throws DeviceDisconnectedException {
+ public void runTest(Test test) throws DeviceDisconnectedException {
final String appNameSpace = test.getAppNameSpace();
String runner = test.getInstrumentationRunner();
@@ -849,7 +881,7 @@
final String testName = test.getFullName().replaceAll("\\$", "\\\\\\$");
final String commandStr = "am instrument -w -r -e class " + testName
- + " -e profile " + profile + " " + appNameSpace + "/" + runner;
+ + " " + appNameSpace + "/" + runner;
Log.d(commandStr);
executeShellCommand(commandStr, new IndividualModeResultParser(test));
}
@@ -861,7 +893,7 @@
* @param javaPkgName The java package name. If null, run the whole test package;
* else, run the specified java package contained in the test package
*/
- public void runInBatchMode(TestPackage testPackage, final String javaPkgName, Profile profile)
+ public void runInBatchMode(TestPackage testPackage, final String javaPkgName)
throws DeviceDisconnectedException {
String appNameSpace = testPackage.getAppNameSpace();
String runner = testPackage.getInstrumentationRunner();
@@ -874,8 +906,7 @@
name = javaPkgName;
}
- String cmdHeader = "am instrument -w -r -e package " + name
- + " -e profile " + profile + " ";
+ String cmdHeader = "am instrument -w -r -e package " + name + " ";
final String commandStr = cmdHeader + appNameSpace + "/" + runner;
Log.d(commandStr);
@@ -1212,6 +1243,7 @@
public final static int STATUS_PASS = 0;
public final static int STATUS_FAIL = -1;
public final static int STATUS_ERROR = -2;
+ public final static int STATUS_OMITTED = -3;
private ArrayList<String> mResultLines;
@@ -1230,7 +1262,7 @@
mResultLines = new ArrayList<String>();
mStackTrace = null;
mFailedMsg = null;
- mResultCode = CtsTestResult.CODE_NOT_EXECUTED;
+ mResultCode = CtsTestResult.CODE_PASS;
}
/** {@inheritDoc} */
@@ -1426,6 +1458,10 @@
case STATUS_ERROR:
mResultCode = CtsTestResult.CODE_FAIL;
break;
+
+ case STATUS_OMITTED:
+ mResultCode = CtsTestResult.CODE_OMITTED;
+ break;
}
}
@@ -1491,6 +1527,10 @@
case STATUS_PASS:
mResultCode = CtsTestResult.CODE_PASS;
break;
+
+ case STATUS_OMITTED:
+ mResultCode = CtsTestResult.CODE_OMITTED;
+ break;
}
resultLines.removeAll(resultLines);
}
@@ -1542,6 +1582,10 @@
mTest.setResult(new CtsTestResult(
CtsTestResult.CODE_FAIL, mFailedMsg, mStackTrace));
break;
+
+ case STATUS_OMITTED:
+ mTest.setResult(new CtsTestResult(CtsTestResult.CODE_OMITTED));
+ break;
}
}
// report status even if no matching test was found
@@ -1673,7 +1717,8 @@
try {
mDevice.executeShellCommand(cmd, receiver);
} catch (IOException e) {
- Log.e("", e);
+ Log.e(String.format("Failed to execute shell command %s on device %s", cmd,
+ mDevice.getSerialNumber()), e);
}
}
}.start();
diff --git a/tools/host/src/com/android/cts/TestHost.java b/tools/host/src/com/android/cts/TestHost.java
index c721e4b..e18bc79 100644
--- a/tools/host/src/com/android/cts/TestHost.java
+++ b/tools/host/src/com/android/cts/TestHost.java
@@ -22,8 +22,6 @@
import org.xml.sax.SAXException;
-import android.annotation.cts.Profile;
-
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
@@ -137,9 +135,8 @@
* Start zipped package.
*
* @param pathName The path name of the zipped package.
- * @param profile The profile of the device being tested.
*/
- public void startZippedPackage(final String pathName, Profile profile)
+ public void startZippedPackage(final String pathName)
throws FileNotFoundException,
IOException,
ParserConfigurationException,
@@ -171,7 +168,7 @@
// step 3: start the plan
TestSession ts = startSession(TEMP_PLAN_NAME, getFirstAvailableDevice().getSerialNumber(),
- null, profile);
+ null);
// step 4: copy the resulting zip file
String resultName = pathName.substring(0, pathName.lastIndexOf("."))
@@ -512,12 +509,12 @@
* @param testPlanName the name of the specified test plan
* @return a {@link TestSession}
*/
- static public TestSession createSession(final String testPlanName, Profile profile)
+ static public TestSession createSession(final String testPlanName)
throws IOException, TestNotFoundException, SAXException,
ParserConfigurationException, TestPlanNotFoundException, NoSuchAlgorithmException {
String testPlanPath = sConfig.getPlanRepository().getPlanPath(testPlanName);
- TestSession ts = TestSessionBuilder.getInstance().build(testPlanPath, profile);
+ TestSession ts = TestSessionBuilder.getInstance().build(testPlanPath);
sSessions.add(ts);
return ts;
@@ -642,14 +639,14 @@
* @param javaPkgName The specific java package name to be run.
*/
public TestSession startSession(final String testPlanName,
- String deviceId, final String javaPkgName, Profile profile)
+ String deviceId, final String javaPkgName)
throws IOException, DeviceNotAvailableException,
TestNotFoundException, SAXException, ParserConfigurationException,
TestPlanNotFoundException, IllegalTestNameException,
DeviceDisconnectedException, NoSuchAlgorithmException,
InvalidNameSpaceException, InvalidApkPathException {
- TestSession ts = createSession(testPlanName, profile);
+ TestSession ts = createSession(testPlanName);
if ((javaPkgName != null) && (javaPkgName.length() != 0)) {
runTest(ts, deviceId, null, javaPkgName, ActionType.RUN_SINGLE_JAVA_PACKAGE);
} else {
diff --git a/tools/host/src/com/android/cts/TestPackage.java b/tools/host/src/com/android/cts/TestPackage.java
index db1e449..8647ade 100644
--- a/tools/host/src/com/android/cts/TestPackage.java
+++ b/tools/host/src/com/android/cts/TestPackage.java
@@ -18,8 +18,6 @@
import com.android.cts.TestSession.TestSessionThread;
-import android.annotation.cts.Profile;
-
import java.io.FileInputStream;
import java.io.IOException;
import java.security.MessageDigest;
@@ -641,7 +639,7 @@
CUIOutputStream.println("Test stopped.");
mTestThread.join();
} catch (InterruptedException e) {
- Log.e("", e);
+ Log.d("test thread interrupted");
}
}
@@ -753,14 +751,14 @@
try {
wait();
} catch (InterruptedException e) {
- Log.e("", e);
+ Log.d("interrupted while waiting for package action complete");
}
}
}
try {
Thread.sleep(HostConfig.Ints.postInstallWaitMs.value());
} catch (InterruptedException e) {
- Log.e("", e);
+ Log.d("sleeping after package action complete interrupted");
}
Log.d("Leave waitPackageActionComplete()");
}
@@ -852,9 +850,8 @@
*
* @param javaPkgName The java package name. If null, run the whole package;
* else, run the specified java package contained in this package
- * @param profile The profile of the device being tested.
*/
- private void runInBatchMode(final String javaPkgName, Profile profile)
+ private void runInBatchMode(final String javaPkgName)
throws DeviceDisconnectedException {
mTimeOutTimer = new HostTimer(new TimeOutTask(this),
HostConfig.Ints.batchStartTimeoutMs.value());
@@ -862,10 +859,10 @@
mProgressObserver = new ProgressObserver();
if ((javaPkgName != null) && (javaPkgName.length() > 0)) {
- runInBatchModeImpl(javaPkgName, profile);
+ runInBatchModeImpl(javaPkgName);
} else {
for (String pkgName : getPackageNames()) {
- runInBatchModeImpl(pkgName, profile);
+ runInBatchModeImpl(pkgName);
}
}
}
@@ -874,11 +871,10 @@
* Implementation of running in batch mode.
*
* @param javaPkgName The java package name.
- * @param profile The profile of the device being tested.
*/
- private void runInBatchModeImpl(String javaPkgName, Profile profile)
+ private void runInBatchModeImpl(String javaPkgName)
throws DeviceDisconnectedException {
- mDevice.runInBatchMode(this, javaPkgName, profile);
+ mDevice.runInBatchMode(this, javaPkgName);
synchronized (mTimeOutTimer) {
if (!mTestStop) {
@@ -906,12 +902,12 @@
* @param javaPkgName The java package name.
* @param profile The profile of the device being tested.
*/
- protected void runInIndividualMode(final String javaPkgName, Profile profile) throws IOException,
+ protected void runInIndividualMode(final String javaPkgName) throws IOException,
DeviceDisconnectedException, ADBServerNeedRestartException {
Iterator<TestSuite> suites = getTestSuites().iterator();
while (suites.hasNext() && (!mTestStop)) {
mCurrentTestSuite = suites.next();
- mCurrentTestSuite.run(mDevice, javaPkgName, profile);
+ mCurrentTestSuite.run(mDevice, javaPkgName);
}
}
@@ -1000,7 +996,7 @@
}
setup(device, javaPkgName);
- runImpl(javaPkgName, sessionLog.getProfile());
+ runImpl(javaPkgName);
}
/**
@@ -1009,7 +1005,7 @@
* @param javaPkgName The JAVA package name.
* @param profile The profile of the device being tested.
*/
- protected void runImpl(final String javaPkgName, Profile profile) throws IOException,
+ protected void runImpl(final String javaPkgName) throws IOException,
DeviceDisconnectedException, ADBServerNeedRestartException, InvalidApkPathException,
InvalidNameSpaceException {
try {
@@ -1026,15 +1022,15 @@
if (supportsBatchMode()) {
mIsInBatchMode = true;
Log.d("run in batch mode...");
- runInBatchMode(javaPkgName, profile);
+ runInBatchMode(javaPkgName);
if (!isAllTestsRun()) {
mIsInBatchMode = false;
Log.d("run in individual mode");
- runInIndividualMode(javaPkgName, profile);
+ runInIndividualMode(javaPkgName);
}
} else {
Log.d("run in individual mode...");
- runInIndividualMode(javaPkgName, profile);
+ runInIndividualMode(javaPkgName);
}
}
@@ -1100,7 +1096,7 @@
* @param test The specific test to be run.
* @param profile The profile of the device being tested.
*/
- public void runTest(final TestDevice device, final Test test, Profile profile)
+ public void runTest(final TestDevice device, final Test test)
throws DeviceDisconnectedException, ADBServerNeedRestartException,
InvalidApkPathException, InvalidNameSpaceException {
@@ -1115,7 +1111,7 @@
println("Test package: " + getAppPackageName());
setTestDevice(device);
- runTestImpl(test, profile);
+ runTestImpl(test);
}
/**
@@ -1124,7 +1120,7 @@
* @param test The test to be run.
* @param profile The profile of the device being tested.
*/
- protected void runTestImpl(final Test test, Profile profile) throws DeviceDisconnectedException,
+ protected void runTestImpl(final Test test) throws DeviceDisconnectedException,
ADBServerNeedRestartException, InvalidApkPathException,
InvalidNameSpaceException {
try {
@@ -1135,7 +1131,7 @@
if (!mTestStop) {
Log.d("install " + getAppPackageName() + " succeed!");
mCurrentTestSuite = test.getTestSuite();
- mCurrentTestSuite.run(mDevice, test, profile);
+ mCurrentTestSuite.run(mDevice, test);
}
if (!mTestStop) {
diff --git a/tools/host/src/com/android/cts/TestSession.java b/tools/host/src/com/android/cts/TestSession.java
index cbd2aba..fedd756 100644
--- a/tools/host/src/com/android/cts/TestSession.java
+++ b/tools/host/src/com/android/cts/TestSession.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.io.IOException;
import java.util.Collection;
@@ -398,7 +396,7 @@
if (mTest != null) {
TestPackage pkg = mTest.getTestPackage();
pkg.setSessionThread(this);
- pkg.runTest(mDevice, mTest, mSessionLog.getProfile());
+ pkg.runTest(mDevice, mTest);
} else if (mTestPackage != null) {
mTestPackage.setSessionThread(this);
mTestPackage.run(mDevice, mJavaPackageName, mSessionLog);
@@ -487,14 +485,15 @@
private void displayTestResultSummary() {
int passNum = mSessionLog.getTestList(CtsTestResult.CODE_PASS).size();
int failNum = mSessionLog.getTestList(CtsTestResult.CODE_FAIL).size();
- int notExecutedNum =
- mSessionLog.getTestList(CtsTestResult.CODE_NOT_EXECUTED).size();
+ int omittedNum = mSessionLog.getTestList(CtsTestResult.CODE_OMITTED).size();
+ int notExecutedNum = mSessionLog.getTestList(CtsTestResult.CODE_NOT_EXECUTED).size();
int timeOutNum = mSessionLog.getTestList(CtsTestResult.CODE_TIMEOUT).size();
- int total = passNum + failNum + notExecutedNum + timeOutNum;
+ int total = passNum + failNum + omittedNum + notExecutedNum + timeOutNum;
println("Test summary: pass=" + passNum
+ " fail=" + failNum
+ " timeOut=" + timeOutNum
+ + " omitted=" + omittedNum
+ " notExecuted=" + notExecutedNum
+ " Total=" + total);
}
diff --git a/tools/host/src/com/android/cts/TestSessionBuilder.java b/tools/host/src/com/android/cts/TestSessionBuilder.java
index 6ea996d..de937a6 100644
--- a/tools/host/src/com/android/cts/TestSessionBuilder.java
+++ b/tools/host/src/com/android/cts/TestSessionBuilder.java
@@ -20,8 +20,6 @@
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
-import android.annotation.cts.Profile;
-
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -103,7 +101,7 @@
* @param config TestPlan XML configuration file.
* @return TestSession.
*/
- public TestSession build(final String config, Profile profile) throws SAXException, IOException,
+ public TestSession build(final String config) throws SAXException, IOException,
TestPlanNotFoundException, TestNotFoundException, NoSuchAlgorithmException {
File file = new File(config);
if (!file.exists()) {
@@ -135,7 +133,7 @@
planName = planFileName;
}
- TestSessionLog sessionLog = new TestSessionLog(packages, planName, profile);
+ TestSessionLog sessionLog = new TestSessionLog(packages, planName);
TestSession ts = new TestSession(sessionLog, numOfRequiredDevices);
return ts;
}
diff --git a/tools/host/src/com/android/cts/TestSessionLog.java b/tools/host/src/com/android/cts/TestSessionLog.java
index d3f836a..cc59a3e 100644
--- a/tools/host/src/com/android/cts/TestSessionLog.java
+++ b/tools/host/src/com/android/cts/TestSessionLog.java
@@ -22,8 +22,6 @@
import org.w3c.dom.Node;
import org.w3c.dom.ProcessingInstruction;
-import android.annotation.cts.Profile;
-
import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
@@ -48,12 +46,11 @@
private static final String ATTRIBUTE_KNOWN_FAILURE = "KnownFailure";
public static final String CTS_RESULT_FILE_NAME = "testResult.xml";
- private static final String CTS_RESULT_FILE_VERSION = "1.6";
+ private static final String CTS_RESULT_FILE_VERSION = "1.10";
static final String ATTRIBUTE_STARTTIME = "starttime";
static final String ATTRIBUTE_ENDTIME = "endtime";
static final String ATTRIBUTE_TESTPLAN = "testPlan";
- static final String ATTRIBUTE_PROFILE = "profile";
static final String ATTRIBUTE_RESOLUTION = "resolution";
static final String ATTRIBUTE_SUBSCRIBER_ID = "subscriberId";
static final String ATTRIBUTE_DEVICE_ID = "deviceID";
@@ -80,6 +77,7 @@
static final String ATTRIBUTE_PASS = "pass";
static final String ATTRIBUTE_FAILED = "failed";
static final String ATTRIBUTE_TIMEOUT = "timeout";
+ static final String ATTRIBUTE_OMITTED = "omitted";
static final String ATTRIBUTE_NOT_EXECUTED = "notExecuted";
static final String TAG_DEVICEINFO = "DeviceInfo";
@@ -110,17 +108,14 @@
private String mResultPath;
private String mResultDir;
private String mTestPlanName;
- private Profile mProfile;
private ArrayList<DeviceParameterCollector> mDeviceParameterBase;
- public TestSessionLog(final Collection<TestPackage> packages, final String testPlanName,
- final Profile profile) {
+ public TestSessionLog(final Collection<TestPackage> packages, final String testPlanName) {
mTestPackages = packages;
mDeviceParameterBase = new ArrayList<TestDevice.DeviceParameterCollector>();
mTestPlanName = testPlanName;
- mProfile = profile;
mSessionStartTime = new Date();
mSessionEndTime = new Date();
@@ -136,15 +131,6 @@
}
/**
- * Get the profile.
- *
- * @return The profile
- */
- public Profile getProfile() {
- return mProfile;
- }
-
- /**
* Get all result of this session.
*
* @return All the tests with a result code of this session.
@@ -299,7 +285,6 @@
setAttribute(doc, root, ATTRIBUTE_STARTTIME, HostUtils.dateToString(mSessionStartTime));
setAttribute(doc, root, ATTRIBUTE_ENDTIME, HostUtils.dateToString(mSessionEndTime));
setAttribute(doc, root, ATTRIBUTE_TESTPLAN, mTestPlanName);
- setAttribute(doc, root, ATTRIBUTE_PROFILE, mProfile.name());
// set device information
for (int i = 0; i < mDeviceParameterBase.size(); i ++) {
@@ -309,6 +294,14 @@
Node screenNode = doc.createElement(TAG_SCREEN);
setAttribute(doc, screenNode, ATTRIBUTE_RESOLUTION, bldInfo.getScreenResolution());
+
+ setAttribute(doc, screenNode, DeviceParameterCollector.SCREEN_SIZE,
+ bldInfo.getScreenSize());
+ setAttribute(doc, screenNode, DeviceParameterCollector.SCREEN_DENSITY,
+ bldInfo.getScreenDensity());
+ setAttribute(doc, screenNode, DeviceParameterCollector.SCREEN_DENSITY_BUCKET,
+ bldInfo.getScreenDensityBucket());
+
deviceSettingNode.appendChild(screenNode);
Node simCardNode = doc.createElement(TAG_PHONE_SUB_INFO);
setAttribute(doc, simCardNode, ATTRIBUTE_SUBSCRIBER_ID, bldInfo.getPhoneNumber());
@@ -342,6 +335,9 @@
setAttribute(doc, devInfoNode,
DeviceParameterCollector.BUILD_MODEL, bldInfo.getBuildModel());
setAttribute(doc, devInfoNode,
+ DeviceParameterCollector.BUILD_MANUFACTURER,
+ bldInfo.getBuildManufacturer());
+ setAttribute(doc, devInfoNode,
DeviceParameterCollector.BUILD_BRAND, bldInfo.getBuildBrand());
setAttribute(doc, devInfoNode,
DeviceParameterCollector.BUILD_BOARD, bldInfo.getBuildBoard());
@@ -386,12 +382,14 @@
int passNum = getTestList(CtsTestResult.CODE_PASS).size();
int failNum = getTestList(CtsTestResult.CODE_FAIL).size();
+ int omittedNum = getTestList(CtsTestResult.CODE_OMITTED).size();
int notExecutedNum = getTestList(CtsTestResult.CODE_NOT_EXECUTED).size();
int timeOutNum = getTestList(CtsTestResult.CODE_TIMEOUT).size();
Node summaryNode = doc.createElement(TAG_SUMMARY);
root.appendChild(summaryNode);
setAttribute(doc, summaryNode, ATTRIBUTE_PASS, passNum);
setAttribute(doc, summaryNode, ATTRIBUTE_FAILED, failNum);
+ setAttribute(doc, summaryNode, ATTRIBUTE_OMITTED, omittedNum);
setAttribute(doc, summaryNode, ATTRIBUTE_NOT_EXECUTED, notExecutedNum);
setAttribute(doc, summaryNode, ATTRIBUTE_TIMEOUT, timeOutNum);
diff --git a/tools/host/src/com/android/cts/TestSessionLogBuilder.java b/tools/host/src/com/android/cts/TestSessionLogBuilder.java
index 68bab03..4f0be8d 100644
--- a/tools/host/src/com/android/cts/TestSessionLogBuilder.java
+++ b/tools/host/src/com/android/cts/TestSessionLogBuilder.java
@@ -15,23 +15,22 @@
*/
package com.android.cts;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
import java.io.File;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import android.annotation.cts.Profile;
-
/**
* Builder of test session from the test result XML file.
*/
@@ -92,10 +91,7 @@
String start = getStringAttributeValue(resultNode, TestSessionLog.ATTRIBUTE_STARTTIME);
String end = getStringAttributeValue(resultNode, TestSessionLog.ATTRIBUTE_ENDTIME);
String planFilePath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
- String profileOption = getStringAttributeValue(resultNode,
- TestSessionLog.ATTRIBUTE_PROFILE);
- Profile profile = Profile.valueOf(profileOption);
- TestSession sessionFromPlan = TestSessionBuilder.getInstance().build(planFilePath, profile);
+ TestSession sessionFromPlan = TestSessionBuilder.getInstance().build(planFilePath);
NodeList pkgList = resultNode.getChildNodes();
for (int i = 0; i < pkgList.getLength(); i++) {
@@ -129,7 +125,7 @@
}
}
- TestSessionLog log = new TestSessionLog(pkgsFromPlan, planName, profile);
+ TestSessionLog log = new TestSessionLog(pkgsFromPlan, planName);
try {
log.setStartTime(HostUtils.dateFromString(start).getTime());
log.setEndTime(HostUtils.dateFromString(end).getTime());
diff --git a/tools/host/src/com/android/cts/TestSuite.java b/tools/host/src/com/android/cts/TestSuite.java
index f1efc60..136fc3f 100644
--- a/tools/host/src/com/android/cts/TestSuite.java
+++ b/tools/host/src/com/android/cts/TestSuite.java
@@ -16,8 +16,6 @@
package com.android.cts;
-import android.annotation.cts.Profile;
-
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
@@ -269,9 +267,8 @@
*
* @param device The device to run the test over.
* @param javaPkgName The java package name.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, final String javaPkgName, Profile profile)
+ public void run(final TestDevice device, final String javaPkgName)
throws IOException, DeviceDisconnectedException, ADBServerNeedRestartException {
Iterator<TestSuite> subSuites = getSubSuites().iterator();
Iterator<TestCase> testCases = getTestCases().iterator();
@@ -282,7 +279,7 @@
while (subSuites.hasNext() && (!mTestStop)) {
mCurrentSubSuite = subSuites.next();
- mCurrentSubSuite.run(device, javaPkgName, profile);
+ mCurrentSubSuite.run(device, javaPkgName);
}
while (testCases.hasNext() && (!mTestStop)) {
@@ -290,7 +287,7 @@
String fullName = mFullName + "." + mCurrentTestCase.getName();
if ((javaPkgName == null) || (javaPkgName.length() == 0)
|| fullName.startsWith(javaPkgName)) {
- mCurrentTestCase.run(device, profile);
+ mCurrentTestCase.run(device);
}
}
}
@@ -300,16 +297,15 @@
*
* @param device The device to run the test over.
* @param test The specific test to be run.
- * @param profile The profile of the device being tested.
*/
- public void run(final TestDevice device, final Test test, Profile profile)
+ public void run(final TestDevice device, final Test test)
throws DeviceDisconnectedException, ADBServerNeedRestartException {
mTestStop = false;
mCurrentTestCase = null;
mCurrentSubSuite = null;
mCurrentTestCase = test.getTestCase();
- mCurrentTestCase.run(device, test, profile);
+ mCurrentTestCase.run(device, test);
}
/** {@inheritDoc} */
diff --git a/tools/host/src/com/android/cts/Version.java b/tools/host/src/com/android/cts/Version.java
index 4664a3e..c1b5d39 100644
--- a/tools/host/src/com/android/cts/Version.java
+++ b/tools/host/src/com/android/cts/Version.java
@@ -18,7 +18,7 @@
public class Version {
// The CTS version string
- private static final String version = "2.2_r3";
+ private static final String version = "2.2_r4";
private Version() {
// no instances allowed
diff --git a/tools/host/src/res/cts_result.css b/tools/host/src/res/cts_result.css
index b5b4009..d7ce510 100644
--- a/tools/host/src/res/cts_result.css
+++ b/tools/host/src/res/cts_result.css
@@ -175,13 +175,7 @@
margin-right:auto;
}
-td.timeout {
- background-color: #A5C639;
- vertical-align: top;
- text-align: center;
-}
-
-td.notExecuted {
+td.timeout, td.omitted, td.notExecuted {
background-color: #A5C639;
vertical-align: top;
text-align: center;
diff --git a/tools/host/src/res/cts_result_v1_2.xsd b/tools/host/src/res/cts_result.xsd
similarity index 80%
rename from tools/host/src/res/cts_result_v1_2.xsd
rename to tools/host/src/res/cts_result.xsd
index 42f87b0..51bad35 100644
--- a/tools/host/src/res/cts_result_v1_2.xsd
+++ b/tools/host/src/res/cts_result.xsd
@@ -16,8 +16,8 @@
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://compatibility.android.com/cts_result/1.2"
- xmlns="http://compatibility.android.com/cts_result/1.2"
+ targetNamespace="http://compatibility.android.com/cts_result/1.10"
+ xmlns="http://compatibility.android.com/cts_result/1.10"
elementFormDefault="qualified">
<xs:element name="TestResult">
@@ -39,7 +39,10 @@
<xs:sequence>
<xs:element name="Screen">
<xs:complexType>
+ <xs:attribute name="screen_size" type="xs:string"/>
<xs:attribute name="resolution" type="xs:string"/>
+ <xs:attribute name="screen_density" type="xs:decimal"/>
+ <xs:attribute name="screen_density_bucket" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="PhoneSubInfo">
@@ -56,6 +59,7 @@
<xs:attribute name="buildName" type="xs:string"/>
<xs:attribute name="buildVersion" type="xs:string"/>
<xs:attribute name="build_board" type="xs:string"/>
+ <xs:attribute name="build_manufacturer" type="xs:string"/>
<xs:attribute name="build_brand" type="xs:string"/>
<xs:attribute name="build_device" type="xs:string"/>
<xs:attribute name="build_fingerprint" type="xs:string"/>
@@ -69,8 +73,13 @@
<xs:attribute name="navigation" type="xs:string"/>
<xs:attribute name="network" type="xs:string"/>
<xs:attribute name="touch" type="xs:string"/>
+ <xs:attribute name="openGlEsVersion" type="xs:string"/>
+ <xs:attribute name="build_abi" type="xs:string"/>
+ <xs:attribute name="build_abi2" type="xs:string"/>
</xs:complexType>
</xs:element>
+ <xs:element name="FeatureInfo" type="featureInfoType"/>
+ <xs:element name="ProcessInfo" type="processInfoType"/>
</xs:sequence>
</xs:complexType>
@@ -106,11 +115,35 @@
<xs:attribute name="name" type="xs:string"/>
</xs:complexType>
+<xs:complexType name="featureInfoType">
+ <xs:sequence>
+ <xs:element name="Feature" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="type" type="xs:string" />
+ <xs:attribute name="available" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="processInfoType">
+ <xs:sequence>
+ <xs:element name="Process" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="uid" type="xs:integer" />
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+</xs:complexType>
+
<xs:complexType name="summaryType">
<xs:attribute name="failed" type="xs:integer"/>
<xs:attribute name="notExecuted" type="xs:integer"/>
<xs:attribute name="pass" type="xs:integer"/>
<xs:attribute name="timeout" type="xs:integer"/>
+ <xs:attribute name="omitted" type="xs:integer"/>
</xs:complexType>
<xs:complexType name="testPackageType">
@@ -161,6 +194,7 @@
<xs:enumeration value="fail"/>
<xs:enumeration value="timeout"/>
<xs:enumeration value="notExecuted"/>
+ <xs:enumeration value="omitted"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
diff --git a/tools/host/src/res/cts_result.xsl b/tools/host/src/res/cts_result.xsl
index bd99c8d..4317655 100644
--- a/tools/host/src/res/cts_result.xsl
+++ b/tools/host/src/res/cts_result.xsl
@@ -33,327 +33,375 @@
<TD width="40%" align="left"><img src="logo.gif"></img></TD>
<TD width="60%" align="left">
<h1>Test Report for <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_model"/> -
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
- </h1>
- </TD>
- </TR>
- </TABLE>
- </DIV>
- <img src="newrule-green.png" align="left"></img>
-
- <br></br>
- <br></br>
-
- <!-- Header with phone and plan information -->
- <DIV id="summary">
- <TABLE width="90%" frame="none">
- <TR>
- <TH>Device Information</TH>
- <TH>Test Summary</TH>
- </TR>
-
- <TR>
- <TD>
- <!-- Device information -->
- <div id="summaryinfo">
- <TABLE width="75%">
- <TR>
- <TD class="rowtitle">Build Model</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_model"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Build Name</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildName"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Device ID</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Firmware Version</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildVersion"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Firmware Build Number</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildID"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Build Fingerprint</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_fingerprint"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Build ABI</TD>
- <TD>
- <xsl:value-of
- select="TestResult/DeviceInfo/BuildInfo/@build_abi"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Build ABI2</TD>
- <TD>
- <xsl:value-of
- select="TestResult/DeviceInfo/BuildInfo/@build_abi2"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Android Platform Version</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@androidPlatformVersion"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Supported Locales</TD>
- <TD>
- <xsl:call-template name="formatDelimitedString">
- <xsl:with-param name="string" select="TestResult/DeviceInfo/BuildInfo/@locales"/>
- </xsl:call-template>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Screen size</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/Screen/@resolution"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Phone number</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/PhoneSubInfo/@subscriberId"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">x dpi</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Xdpi"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">y dpi</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Ydpi"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Touch</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@touch"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Navigation</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@navigation"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Keypad</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@keypad"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Network</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@network"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">IMEI</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imei"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">IMSI</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imsi"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Open GL ES Version</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@openGlEsVersion"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Features</TD>
- <TD>
- <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='sdk']">
- <xsl:text>[</xsl:text>
- <xsl:choose>
- <xsl:when test="@available = 'true'">
- <xsl:text>X</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>_</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>] </xsl:text>
-
- <xsl:value-of select="@name" />
- <br />
- </xsl:for-each>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Other Features</TD>
- <TD>
- <UL>
- <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='other']">
- <LI><xsl:value-of select="@name" /></LI>
- </xsl:for-each>
- </UL>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Root Processes</TD>
- <TD>
- <UL>
- <xsl:for-each select="TestResult/DeviceInfo/ProcessInfo/Process[@uid='0']">
- <LI><xsl:value-of select="@name" /></LI>
- </xsl:for-each>
- </UL>
- </TD>
- </TR>
- </TABLE>
- </div>
- </TD>
-
- <!-- plan information -->
- <TD>
- <div id="summaryinfo">
- <TABLE width="75%">
- <TR>
- <TD class="rowtitle">CTS version</TD>
- <TD>
- <xsl:value-of select="TestResult/HostInfo/Cts/@version"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Test timeout</TD>
- <TD>
- <xsl:value-of select="TestResult/HostInfo/Cts/IntValue[@name='testStatusTimeoutMs']/@value" /> ms
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Host Info</TD>
- <TD>
- <xsl:value-of select="TestResult/HostInfo/@name"/>
- (<xsl:value-of select="TestResult/HostInfo/Os/@name"/> -
- <xsl:value-of select="TestResult/HostInfo/Os/@version"/>)
- </TD>
- </TR>
- <TR><TD><BR></BR></TD><TD></TD></TR>
- <TR>
- <TD class="rowtitle">Plan name</TD>
- <TD>
- <xsl:value-of select="TestResult/@testPlan"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Profile</TD>
- <TD>
- <xsl:value-of select="TestResult/@profile"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Start time</TD>
- <TD>
- <xsl:value-of select="TestResult/@starttime"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">End time</TD>
- <TD>
- <xsl:value-of select="TestResult/@endtime"/>
- </TD>
- </TR>
-
- <!-- Test Summary -->
- <TR><TD><BR></BR></TD><TD></TD></TR>
- <TR>
- <TD class="rowtitle">Tests Passed</TD>
- <TD>
- <xsl:value-of select="TestResult/Summary/@pass"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Tests Failed</TD>
- <TD>
- <xsl:value-of select="TestResult/Summary/@failed"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Tests Timed out</TD>
- <TD>
- <xsl:value-of select="TestResult/Summary/@timeout"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Tests Not Executed</TD>
- <TD>
- <xsl:value-of select="TestResult/Summary/@notExecuted"/>
- </TD>
- </TR>
- </TABLE>
- </div>
- </TD>
- </TR>
- </TABLE>
- </DIV>
-
- <!-- High level summary of test execution -->
- <h2 align="center">Test Summary by Package</h2>
- <DIV id="testsummary">
- <TABLE>
- <TR>
- <TH>Test Package</TH>
- <TH>Passed</TH>
- <TH>Failed</TH>
- <TH>Timed Out</TH>
- <TH>Total Tests</TH>
- </TR>
- <xsl:for-each select="TestResult/TestPackage">
- <TR>
- <TD>
- <xsl:variable name="href"><xsl:value-of select="@name"/></xsl:variable>
- <a href="#{$href}"><xsl:value-of select="@name"/></a>
- </TD>
- <TD>
- <xsl:value-of select="count(TestSuite//Test[@result = 'pass'])"/>
- </TD>
- <TD>
- <xsl:value-of select="count(TestSuite//Test[@result = 'fail'])"/>
- </TD>
- <TD>
- <xsl:value-of select="count(TestSuite//Test[@result = 'timeout'])"/>
- </TD>
- <TD>
- <xsl:value-of select="count(TestSuite//Test)"/>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
+ </h1>
</TD>
</TR>
- </xsl:for-each> <!-- end package -->
- </TABLE>
- </DIV>
+ </TABLE>
+ </DIV>
+ <img src="newrule-green.png" align="left"></img>
- <!-- Details of all the executed tests -->
- <h2 align="center">Detailed Test Report</h2>
+ <br></br>
+ <br></br>
- <!-- test package -->
- <DIV id="testdetail">
- <xsl:for-each select="TestResult/TestPackage">
+ <!-- Header with phone and plan information -->
+ <DIV id="summary">
+ <TABLE width="90%" frame="none">
+ <TR>
+ <TH>Device Information</TH>
+ <TH>Test Summary</TH>
+ </TR>
+
+ <TR>
+ <TD>
+ <!-- Device information -->
+ <div id="summaryinfo">
+ <TABLE width="75%">
+ <TR>
+ <TD class="rowtitle">Build Model</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_model"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build Name</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildName"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build Brand</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_brand"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build Manufacturer</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_manufacturer"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Device ID</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Firmware Version</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildVersion"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Firmware Build Number</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildID"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build Fingerprint</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_fingerprint"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build ABI</TD>
+ <TD>
+ <xsl:value-of
+ select="TestResult/DeviceInfo/BuildInfo/@build_abi"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build ABI2</TD>
+ <TD>
+ <xsl:value-of
+ select="TestResult/DeviceInfo/BuildInfo/@build_abi2"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Android Platform Version</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@androidPlatformVersion"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Supported Locales</TD>
+ <TD>
+ <xsl:call-template name="formatDelimitedString">
+ <xsl:with-param name="string" select="TestResult/DeviceInfo/BuildInfo/@locales"/>
+ </xsl:call-template>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Screen Size</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/Screen/@screen_size"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Resolution</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/Screen/@resolution"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Density</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/Screen/@screen_density"/>
+ (<xsl:value-of select="TestResult/DeviceInfo/Screen/@screen_density_bucket"/>)
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Phone number</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/PhoneSubInfo/@subscriberId"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">X dpi</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Xdpi"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Y dpi</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Ydpi"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Touch</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@touch"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Navigation</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@navigation"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Keypad</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@keypad"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Network</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@network"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">IMEI</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imei"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">IMSI</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imsi"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Open GL ES Version</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@openGlEsVersion"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Features</TD>
+ <TD>
+ <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='sdk']">
+ <xsl:text>[</xsl:text>
+ <xsl:choose>
+ <xsl:when test="@available = 'true'">
+ <xsl:text>X</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>_</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>] </xsl:text>
+
+ <xsl:value-of select="@name" />
+ <br />
+ </xsl:for-each>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Other Features</TD>
+ <TD>
+ <UL>
+ <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='other']">
+ <LI><xsl:value-of select="@name" /></LI>
+ </xsl:for-each>
+ </UL>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Root Processes</TD>
+ <TD>
+ <UL>
+ <xsl:for-each select="TestResult/DeviceInfo/ProcessInfo/Process[@uid='0']">
+ <LI><xsl:value-of select="@name" /></LI>
+ </xsl:for-each>
+ </UL>
+ </TD>
+ </TR>
+ </TABLE>
+ </div>
+ </TD>
+
+ <!-- plan information -->
+ <TD>
+ <div id="summaryinfo">
+ <TABLE width="75%">
+ <TR>
+ <TD class="rowtitle">CTS version</TD>
+ <TD>
+ <xsl:value-of select="TestResult/HostInfo/Cts/@version"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Test timeout</TD>
+ <TD>
+ <xsl:value-of select="TestResult/HostInfo/Cts/IntValue[@name='testStatusTimeoutMs']/@value" /> ms
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Host Info</TD>
+ <TD>
+ <xsl:value-of select="TestResult/HostInfo/@name"/>
+ (<xsl:value-of select="TestResult/HostInfo/Os/@name"/> -
+ <xsl:value-of select="TestResult/HostInfo/Os/@version"/>)
+ </TD>
+ </TR>
+ <TR><TD><BR></BR></TD><TD></TD></TR>
+ <TR>
+ <TD class="rowtitle">Plan name</TD>
+ <TD>
+ <xsl:value-of select="TestResult/@testPlan"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Start time</TD>
+ <TD>
+ <xsl:value-of select="TestResult/@starttime"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">End time</TD>
+ <TD>
+ <xsl:value-of select="TestResult/@endtime"/>
+ </TD>
+ </TR>
+
+ <!-- Test Summary -->
+ <TR><TD><BR></BR></TD><TD></TD></TR>
+ <TR>
+ <TD class="rowtitle">Tests Passed</TD>
+ <TD>
+ <xsl:value-of select="TestResult/Summary/@pass"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Tests Failed</TD>
+ <TD>
+ <xsl:value-of select="TestResult/Summary/@failed"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Tests Timed out</TD>
+ <TD>
+ <xsl:value-of select="TestResult/Summary/@timeout"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Tests Not Executed</TD>
+ <TD>
+ <xsl:value-of select="TestResult/Summary/@notExecuted"/>
+ </TD>
+ </TR>
+ </TABLE>
+ </div>
+ </TD>
+ </TR>
+ </TABLE>
+ </DIV>
+
+ <!-- High level summary of test execution -->
+ <h2 align="center">Test Summary by Package</h2>
+ <DIV id="testsummary">
+ <TABLE>
+ <TR>
+ <TH>Test Package</TH>
+ <TH>Passed</TH>
+ <TH>Failed</TH>
+ <TH>Timed Out</TH>
+ <TH>Total Tests</TH>
+ </TR>
+ <xsl:for-each select="TestResult/TestPackage">
+ <TR>
+ <TD>
+ <xsl:variable name="href"><xsl:value-of select="@name"/></xsl:variable>
+ <a href="#{$href}"><xsl:value-of select="@name"/></a>
+ </TD>
+ <TD>
+ <xsl:value-of select="count(TestSuite//Test[@result = 'pass'])"/>
+ </TD>
+ <TD>
+ <xsl:value-of select="count(TestSuite//Test[@result = 'fail'])"/>
+ </TD>
+ <TD>
+ <xsl:value-of select="count(TestSuite//Test[@result = 'timeout'])"/>
+ </TD>
+ <TD>
+ <xsl:value-of select="count(TestSuite//Test)"/>
+ </TD>
+ </TR>
+ </xsl:for-each> <!-- end package -->
+ </TABLE>
+ </DIV>
+
+ <xsl:call-template name="filteredResultTestReport">
+ <xsl:with-param name="header" select="'Test Failures'" />
+ <xsl:with-param name="resultFilter" select="'fail'" />
+ </xsl:call-template>
+
+ <xsl:call-template name="filteredResultTestReport">
+ <xsl:with-param name="header" select="'Test Timeouts'" />
+ <xsl:with-param name="resultFilter" select="'timeout'" />
+ </xsl:call-template>
+
+ <h2 align="center">Detailed Test Report</h2>
+ <xsl:call-template name="detailedTestReport" />
+
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="filteredResultTestReport">
+ <xsl:param name="header" />
+ <xsl:param name="resultFilter" />
+ <xsl:variable name="numMatching" select="count(TestResult/TestPackage/TestSuite//TestCase/Test[@result=$resultFilter])" />
+ <xsl:if test="$numMatching > 0">
+ <h2 align="center"><xsl:value-of select="$header" /> (<xsl:value-of select="$numMatching"/>)</h2>
+ <xsl:call-template name="detailedTestReport">
+ <xsl:with-param name="resultFilter" select="$resultFilter"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="detailedTestReport">
+ <xsl:param name="resultFilter" />
+ <DIV id="testdetail">
+ <xsl:for-each select="TestResult/TestPackage">
+ <xsl:if test="$resultFilter=''
+ or count(TestSuite//TestCase/Test[@result=$resultFilter]) > 0">
<DIV id="none">
<TABLE>
<TR>
@@ -375,104 +423,108 @@
<!-- test case -->
<xsl:for-each select="TestSuite//TestCase">
- <!-- emit a blank row before every test suite name -->
- <xsl:if test="position()!=1">
- <TR> <TD class="testcasespacer" colspan="3"></TD> </TR>
+ <xsl:if test="$resultFilter='' or count(Test[@result=$resultFilter]) > 0">
+ <!-- emit a blank row before every test suite name -->
+ <xsl:if test="position()!=1">
+ <TR><TD class="testcasespacer" colspan="3"></TD></TR>
+ </xsl:if>
+
+ <TR>
+ <TD class="testcase" colspan="3">
+ <xsl:for-each select="ancestor::TestSuite">
+ <xsl:if test="position()!=1">.</xsl:if>
+ <xsl:value-of select="@name"/>
+ </xsl:for-each>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="@name"/>
+ </TD>
+ </TR>
</xsl:if>
- <TR>
- <TD class="testcase" colspan="3">
- <xsl:for-each select="ancestor::TestSuite">
- <xsl:if test="position()!=1">.</xsl:if>
- <xsl:value-of select="@name"/>
- </xsl:for-each>
- <xsl:text>.</xsl:text>
- <xsl:value-of select="@name"/>
- </TD>
- </TR>
<!-- test -->
<xsl:for-each select="Test">
- <TR>
- <TD class="testname"> -- <xsl:value-of select="@name"/></TD>
+ <xsl:if test="$resultFilter='' or $resultFilter=@result">
+ <TR>
+ <TD class="testname"> -- <xsl:value-of select="@name"/></TD>
- <!-- test results -->
- <xsl:choose>
- <xsl:when test="string(@KnownFailure)">
- <!-- "pass" indicates the that test actually passed (results have been inverted already) -->
- <xsl:if test="@result='pass'">
- <TD class="pass">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- known problem
- </div>
- </TD>
- <TD class="failuredetails"></TD>
- </xsl:if>
+ <!-- test results -->
+ <xsl:choose>
+ <xsl:when test="string(@KnownFailure)">
+ <!-- "pass" indicates the that test actually passed (results have been inverted already) -->
+ <xsl:if test="@result='pass'">
+ <TD class="pass">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ known problem
+ </div>
+ </TD>
+ <TD class="failuredetails"></TD>
+ </xsl:if>
- <!-- "fail" indicates that a known failure actually passed (results have been inverted already) -->
- <xsl:if test="@result='fail'">
- <TD class="failed">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- </TD>
- <TD class="failuredetails">
- <div id="details">
- A test that was a known failure actually passed. Please check.
- </div>
- </TD>
- </xsl:if>
- </xsl:when>
+ <!-- "fail" indicates that a known failure actually passed (results have been inverted already) -->
+ <xsl:if test="@result='fail'">
+ <TD class="failed">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ </TD>
+ <TD class="failuredetails">
+ <div id="details">
+ A test that was a known failure actually passed. Please check.
+ </div>
+ </TD>
+ </xsl:if>
+ </xsl:when>
- <xsl:otherwise>
- <xsl:if test="@result='pass'">
- <TD class="pass">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- </TD>
- <TD class="failuredetails"></TD>
- </xsl:if>
+ <xsl:otherwise>
+ <xsl:if test="@result='pass'">
+ <TD class="pass">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ </TD>
+ <TD class="failuredetails"></TD>
+ </xsl:if>
- <xsl:if test="@result='fail'">
- <TD class="failed">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- </TD>
- <TD class="failuredetails">
- <div id="details">
- <xsl:value-of select="FailedScene/@message"/>
- </div>
- </TD>
- </xsl:if>
+ <xsl:if test="@result='fail'">
+ <TD class="failed">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ </TD>
+ <TD class="failuredetails">
+ <div id="details">
+ <xsl:value-of select="FailedScene/@message"/>
+ </div>
+ </TD>
+ </xsl:if>
- <xsl:if test="@result='timeout'">
- <TD class="timeout">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- <TD class="failuredetails"></TD>
- </TD>
- </xsl:if>
+ <xsl:if test="@result='timeout'">
+ <TD class="timeout">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ <TD class="failuredetails"></TD>
+ </TD>
+ </xsl:if>
- <xsl:if test="@result='notExecuted'">
- <TD class="notExecuted">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- </TD>
- <TD class="failuredetails"></TD>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </TR> <!-- finished with a row -->
+ <xsl:if test="@result='notExecuted'">
+ <TD class="notExecuted">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ </TD>
+ <TD class="failuredetails"></TD>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </TR> <!-- finished with a row -->
+ </xsl:if>
</xsl:for-each> <!-- end test -->
</xsl:for-each> <!-- end test case -->
</TABLE>
- </xsl:for-each> <!-- end test package -->
- </DIV>
- </body>
- </html>
+ </xsl:if>
+ </xsl:for-each> <!-- end test package -->
+ </DIV>
</xsl:template>
<!-- Take a delimited string and insert line breaks after a some number of elements. -->
diff --git a/tools/host/test/com/android/cts/TestSessionBuilderTests.java b/tools/host/test/com/android/cts/TestSessionBuilderTests.java
index 26eb561..d0f5230 100644
--- a/tools/host/test/com/android/cts/TestSessionBuilderTests.java
+++ b/tools/host/test/com/android/cts/TestSessionBuilderTests.java
@@ -34,6 +34,8 @@
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
+import android.annotation.cts.Profile;
+
import com.android.cts.TestDevice.DeviceParameterCollector;
/**
@@ -107,7 +109,7 @@
createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
HostConfig.getInstance().loadTestPackages();
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -288,7 +290,7 @@
createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
HostConfig.getInstance().loadTestPackages();
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -369,7 +371,7 @@
createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
HostConfig.getInstance().loadTestPackages();
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -474,7 +476,7 @@
createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
HostConfig.getInstance().loadTestPackages();
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -558,7 +560,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -640,7 +642,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -706,7 +708,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -787,7 +789,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -848,7 +850,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -923,7 +925,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -996,7 +998,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -1091,7 +1093,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -1172,7 +1174,7 @@
createTestPackage(descriptionConfigStr, mTestPackageBinaryName);
HostConfig.getInstance().loadTestPackages();
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(2, ts.getNumOfRequiredDevices());
TestSessionLog tsl = ts.getSessionLog();
@@ -1201,7 +1203,7 @@
* Test serializing the test plan.
*/
public void testSerialize() throws Exception {
- final String srcStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ final String srcStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
+ "<TestPlan version=\"1.0\">\n"
+ "<PlanSettings/>\n"
+ "<Entry uri=\"com.google.android.cts.CtsTest\"/>\n"
@@ -1284,7 +1286,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
assertEquals(1, ts.getNumOfRequiredDevices());
ts.getSessionLog().setStartTime(System.currentTimeMillis());
@@ -1423,7 +1425,7 @@
String planPath = HostConfig.getInstance().getPlanRepository().getPlanPath(planName);
TestSessionBuilder.getInstance().serialize(planName, packageNames, results);
- TestSession ts = TestSessionBuilder.getInstance().build(planPath);
+ TestSession ts = TestSessionBuilder.getInstance().build(planPath, Profile.ALL);
ts.getSessionLog().setStartTime(System.currentTimeMillis());
TestSessionLog tsl = ts.getSessionLog();
TestPackage testPackage = tsl.getTestPackages().iterator().next();
diff --git a/tools/host/test/com/android/cts/TestSessionLogBuilderTests.java b/tools/host/test/com/android/cts/TestSessionLogBuilderTests.java
index 7deb9af..a2b5274 100644
--- a/tools/host/test/com/android/cts/TestSessionLogBuilderTests.java
+++ b/tools/host/test/com/android/cts/TestSessionLogBuilderTests.java
@@ -40,7 +40,7 @@
"<?xml-stylesheet type=\"text/xsl\" href=\"cts_result.xsl\"?>\n" +
"\n" +
"<TestResult endtime=\"Wed Apr 29 10:36:47 CST 2009\" " +
- "starttime=\"Wed Apr 29 10:36:30 CST 2009\" testPlan=\"location\" version=\"1.0\">\n" +
+ "starttime=\"Wed Apr 29 10:36:30 CST 2009\" testPlan=\"location\" version=\"1.0\" profile=\"ALL\">\n" +
" <DeviceInfo>\n" +
" <Screen resolution=\"480x320\"/>\n" +
" <PhoneSubInfo subscriberId=\"15555218135\"/>\n" +
diff --git a/tools/utils/CollectAllTests.java b/tools/utils/CollectAllTests.java
index 73e1a43..7628ba2 100644
--- a/tools/utils/CollectAllTests.java
+++ b/tools/utils/CollectAllTests.java
@@ -297,6 +297,11 @@
return getAnnotation(testClass, testName, BROKEN_TEST) != null;
}
+ private boolean isSuppressed(final Class<? extends TestCase> testClass,
+ final String testName) {
+ return getAnnotation(testClass, testName, SUPPRESSED_TEST) != null;
+ }
+
private String getAnnotation(final Class<? extends TestCase> testClass,
final String testName, final String annotationName) {
try {
@@ -341,6 +346,9 @@
} else if (isBrokenTest(test.getClass(), testName)) {
System.out.println("ignoring broken test: " + test);
return;
+ } else if (isSuppressed(test.getClass(), testName)) {
+ System.out.println("ignoring suppressed test: " + test);
+ return;
}
if (!testName.startsWith("test")) {
@@ -359,7 +367,7 @@
testCases.put(testClassName, testClass);
}
- testClass.mCases.add(new TestMethod(testName, "", "", knownFailure, false));
+ testClass.mCases.add(new TestMethod(testName, "", "", knownFailure, false, false));
try {
test.getClass().getConstructor(new Class<?>[0]);
diff --git a/tools/utils/DescriptionGenerator.java b/tools/utils/DescriptionGenerator.java
index 22cc622..99be6dc 100644
--- a/tools/utils/DescriptionGenerator.java
+++ b/tools/utils/DescriptionGenerator.java
@@ -65,6 +65,7 @@
static final String HOST_CONTROLLER = "dalvik.annotation.HostController";
static final String KNOWN_FAILURE = "dalvik.annotation.KnownFailure";
static final String BROKEN_TEST = "dalvik.annotation.BrokenTest";
+ static final String SUPPRESSED_TEST = "android.test.suitebuilder.annotation.Suppress";
static final String JUNIT_TEST_CASE_CLASS_NAME = "junit.framework.testcase";
static final String TAG_PACKAGE = "TestPackage";
@@ -403,7 +404,7 @@
elem.getParentNode().removeChild(elem);
} else {
for (TestMethod caze : cases) {
- if (caze.mIsBroken || caze.mKnownFailure != null) {
+ if (caze.mIsBroken || caze.mIsSuppressed || caze.mKnownFailure != null) {
continue;
}
Node caseNode = elem.appendChild(mDoc.createElement(TAG_TEST));
@@ -524,6 +525,7 @@
String controller = "";
String knownFailure = null;
boolean isBroken = false;
+ boolean isSuppressed = false;
for (AnnotationDesc cAnnot : annotations) {
AnnotationTypeDoc atype = cAnnot.annotationType();
@@ -533,12 +535,14 @@
knownFailure = getAnnotationDescription(cAnnot);
} else if (atype.toString().equals(BROKEN_TEST)) {
isBroken = true;
+ } else if (atype.toString().equals(SUPPRESSED_TEST)) {
+ isSuppressed = true;
}
}
if (name.startsWith("test")) {
cases.add(new TestMethod(name, method.commentText(), controller, knownFailure,
- isBroken));
+ isBroken, isSuppressed));
}
}
@@ -596,6 +600,7 @@
String mController;
String mKnownFailure;
boolean mIsBroken;
+ boolean mIsSuppressed;
/**
* Construct an test case object.
@@ -605,12 +610,13 @@
* @param knownFailure The reason of known failure.
*/
TestMethod(String name, String description, String controller, String knownFailure,
- boolean isBroken) {
+ boolean isBroken, boolean isSuppressed) {
mName = name;
mDescription = description;
mController = controller;
mKnownFailure = knownFailure;
mIsBroken = isBroken;
+ mIsSuppressed = isSuppressed;
}
}
}
diff --git a/tools/vm-tests/Android.mk b/tools/vm-tests/Android.mk
index 9c8051e..f807774 100644
--- a/tools/vm-tests/Android.mk
+++ b/tools/vm-tests/Android.mk
@@ -30,7 +30,7 @@
LOCAL_MODULE := cts-dalvik-buildutil
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_JAVA_LIBRARIES := dx dasm cfassembler
+LOCAL_JAVA_LIBRARIES := dx dasm cfassembler hosttestlib ddmlib
LOCAL_CLASSPATH := $(HOST_JDK_TOOLS_JAR)
include $(BUILD_HOST_JAVA_LIBRARY)
@@ -66,12 +66,13 @@
$(GENERATED_FILES): PRIVATE_INTERMEDIATES := $(intermediates)/tests
$(GENERATED_FILES): PRIVATE_INTERMEDIATES_MAIN_FILES := $(intermediates)/main_files
$(GENERATED_FILES): PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES := $(intermediates)/hostjunit_files
-$(GENERATED_FILES): $(HOST_OUT_JAVA_LIBRARIES)/cts-dalvik-buildutil.jar $(HOST_OUT_JAVA_LIBRARIES)/dasm.jar $(HOST_OUT_JAVA_LIBRARIES)/dx.jar $(HOST_OUT_JAVA_LIBRARIES)/cfassembler.jar
+$(GENERATED_FILES): $(HOST_OUT_JAVA_LIBRARIES)/cts-dalvik-buildutil.jar $(HOST_OUT_JAVA_LIBRARIES)/dasm.jar $(HOST_OUT_JAVA_LIBRARIES)/dx.jar $(HOST_OUT_JAVA_LIBRARIES)/cfassembler.jar $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar $(HOST_OUT_JAVA_LIBRARIES)/ddmlib.jar
+
$(hide) mkdir -p $@
# copy Util class to compile later together with the generated host side junit tests
$(hide) mkdir -p $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES)/dot/junit && cp $(PRIVATE_SRC_FOLDER)/util/build/DeviceUtil.java.template $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES)/dot/junit/DeviceUtil.java
# generated and compile the host side junit tests
- $(hide) java -cp $(subst $(space),$(colon),$^):$(HOST_JDK_TOOLS_JAR) util.build.BuildDalvikSuite $(PRIVATE_SRC_FOLDER) $(PRIVATE_INTERMEDIATES) $<:$(PRIVATE_LIB_FOLDER)/junit.jar $(PRIVATE_INTERMEDIATES_MAIN_FILES) $(BUILD_UTIL_INTERMEDIATES_CLASSES) $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES) $$RUN_VM_TESTS_RTO
+ $(hide) java -cp $(subst $(space),$(colon),$^):$(HOST_JDK_TOOLS_JAR) util.build.BuildDalvikSuite $(PRIVATE_SRC_FOLDER) $(PRIVATE_INTERMEDIATES) $<:$(PRIVATE_LIB_FOLDER)/junit.jar:$(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar:$(HOST_OUT_JAVA_LIBRARIES)/ddmlib.jar $(PRIVATE_INTERMEDIATES_MAIN_FILES) $(BUILD_UTIL_INTERMEDIATES_CLASSES) $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES) $$RUN_VM_TESTS_RTO
@echo "wrote generated Main_*.java files to $(PRIVATE_INTERMEDIATES_MAIN_FILES)"
INSTALLED_TESTS := $(dir $(LOCAL_INSTALLED_MODULE))../cts_dalviktests/timestamp
diff --git a/tools/vm-tests/src/dot/junit/opcodes/check_cast/TestStubs.java b/tools/vm-tests/src/dot/junit/opcodes/check_cast/TestStubs.java
index 53af56d..67f8f04 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/check_cast/TestStubs.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/check_cast/TestStubs.java
@@ -16,12 +16,5 @@
package dot.junit.opcodes.check_cast;
-public class TestStubs {
- @SuppressWarnings("unused")
- private class TestStub {
- // used by testVFE5
- public void foo() {
-
- }
- }
+class TestStubs {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/check_cast/Test_check_cast.java b/tools/vm-tests/src/dot/junit/opcodes/check_cast/Test_check_cast.java
index ea9e38c..78a0479 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/check_cast/Test_check_cast.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/check_cast/Test_check_cast.java
@@ -20,6 +20,8 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.check_cast.d.T_check_cast_1;
import dot.junit.opcodes.check_cast.d.T_check_cast_2;
+import dot.junit.opcodes.check_cast.d.T_check_cast_3;
+import dot.junit.opcodes.check_cast.d.T_check_cast_7;
public class Test_check_cast extends DxTestCase {
@@ -118,34 +120,34 @@
}
}
-
/**
* @constraint n/a
- * @title Attempt to access inaccessible class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
- */
+ * @title Attempt to access inaccessible class, expect throws IllegalAccessError
+ */
public void testVFE5() {
//@uses dot.junit.opcodes.check_cast.TestStubs
//@uses dot.junit.opcodes.check_cast.d.T_check_cast_3
+ T_check_cast_3 t = new T_check_cast_3();
try {
- Class.forName("dot.junit.opcodes.check_cast.d.T_check_cast_3");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ t.run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError iae) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to access undefined class. Java throws NoClassDefFoundError on
- * first access but Dalvik throws VerifyError on class loading.
- */
+ * @title Attempt to access undefined class, expect throws NoClassDefFoundError on
+ * first access
+ */
public void testVFE6() {
+ T_check_cast_7 t = new T_check_cast_7();
try {
- Class.forName("dot.junit.opcodes.check_cast.d.T_check_cast_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ t.run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError iae) {
+ // expected
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/check_cast/d/T_check_cast_3.d b/tools/vm-tests/src/dot/junit/opcodes/check_cast/d/T_check_cast_3.d
index 5b5dea0..d269a31 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/check_cast/d/T_check_cast_3.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/check_cast/d/T_check_cast_3.d
@@ -26,7 +26,7 @@
.method public run()V
.limit regs 6
- check-cast v5, dot/junit/opcodes/check_cast/Test_check_cast$TestStub
+ check-cast v5, dot/junit/opcodes/check_cast/TestStubs
return-void
.end method
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/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_10.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_10.java
index d01314b..4caf263 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.filled_new_array.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+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/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.java
index d01314b..f25d58f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array/d/T_filled_new_array_11.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.filled_new_array.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_filled_new_array_11 {
+ public Object[] run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/TestStubs.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/TestStubs.java
index d38808e..47b87e4 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/TestStubs.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/TestStubs.java
@@ -16,9 +16,6 @@
package dot.junit.opcodes.filled_new_array_range;
-public class TestStubs {
- @SuppressWarnings("unused")
- private class TestStub{
- // used by T_filled_new_array_range_11
- }
+// used by T_filled_new_array_range_11
+class TestStubs {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/Test_filled_new_array_range.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/Test_filled_new_array_range.java
index b69d5b4..84b1379 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/Test_filled_new_array_range.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/Test_filled_new_array_range.java
@@ -19,8 +19,9 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.filled_new_array_range.d.T_filled_new_array_range_1;
+import dot.junit.opcodes.filled_new_array_range.d.T_filled_new_array_range_10;
+import dot.junit.opcodes.filled_new_array_range.d.T_filled_new_array_range_11;
import dot.junit.opcodes.filled_new_array_range.d.T_filled_new_array_range_2;
-import dot.junit.opcodes.filled_new_array_range.d.T_filled_new_array_range_9;
public class Test_filled_new_array_range extends DxTestCase {
/**
@@ -140,31 +141,32 @@
}
/**
- * @constraint n/a
+ * @constraint n/a
* @title attempt to instantiate array of non-existent class
*/
public void testVFE8() {
+ T_filled_new_array_range_10 t = new T_filled_new_array_range_10();
try {
- Class.forName("dot.junit.opcodes.filled_new_array_range.d.T_filled_new_array_range_10");
- fail("expected a verification exception");
- } catch(Throwable t) {
- DxUtil.checkVerifyException(t);
+ t.run();
+ fail("expected NoClassDefFoundError exception");
+ } catch (NoClassDefFoundError e) {
+ // expected
}
}
-
+
/**
- * @constraint n/a
+ * @constraint n/a
* @title attempt to instantiate array of inaccessible class
*/
public void testVFE9() {
- //@uses dot.junit.opcodes.filled_new_array_range.d.T_filled_new_array_range_11
+ //@uses dot.junit.opcodes.filled_new_array_range.d.T_filled_new_array_range_11
//@uses dot.junit.opcodes.filled_new_array_range.TestStubs
+ T_filled_new_array_range_11 t = new T_filled_new_array_range_11();
try {
- Class.forName("dot.junit.opcodes.filled_new_array_range.d.T_filled_new_array_range_11");
- fail("expected a verification exception");
- } catch(Throwable t) {
- DxUtil.checkVerifyException(t);
+ t.run();
+ fail("expected IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
-
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_10.java
similarity index 73%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_10.java
index d01314b..57075bd 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.filled_new_array_range.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_filled_new_array_range_10 {
+ public Object[] run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_11.d b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_11.d
index a628f07..e3a21e9 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_11.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_11.d
@@ -27,7 +27,7 @@
.method public run()[Ljava/lang/Object;
.limit regs 10
const v9, 0
- filled-new-array/range {v9}, [Ldot/junit/opcodes/filled_new_array_range/TestStubs$TestStub;
+ filled-new-array/range {v9}, [Ldot/junit/opcodes/filled_new_array_range/TestStubs;
move-result-object v0
return-object v0
.end method
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_11.java
similarity index 73%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_11.java
index d01314b..f4ca611 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/filled_new_array_range/d/T_filled_new_array_range_11.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.filled_new_array_range.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_filled_new_array_range_11 {
+ public Object[] run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iget/Test_iget.java b/tools/vm-tests/src/dot/junit/opcodes/iget/Test_iget.java
index b5fcb67..50658ce 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iget/Test_iget.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget/Test_iget.java
@@ -20,7 +20,14 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.iget.d.T_iget_1;
import dot.junit.opcodes.iget.d.T_iget_11;
+import dot.junit.opcodes.iget.d.T_iget_12;
+import dot.junit.opcodes.iget.d.T_iget_13;
import dot.junit.opcodes.iget.d.T_iget_2;
+import dot.junit.opcodes.iget.d.T_iget_21;
+import dot.junit.opcodes.iget.d.T_iget_5;
+import dot.junit.opcodes.iget.d.T_iget_6;
+import dot.junit.opcodes.iget.d.T_iget_7;
+import dot.junit.opcodes.iget.d.T_iget_8;
import dot.junit.opcodes.iget.d.T_iget_9;
public class Test_iget extends DxTestCase {
@@ -98,70 +105,66 @@
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.iget.d.T_iget_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_13().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read inaccessible private field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible private field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.iget.d.T_iget_6
//@uses dot.junit.opcodes.iget.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget.d.T_iget_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_6().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iget.d.T_iget_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_7().run();
+ fail("expected a NoClassDefFoundError exception");
+ } catch (NoClassDefFoundError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.iget.d.T_iget_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_8().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.iget.d.T_iget_12
//@uses dot.junit.opcodes.iget.d.T_iget_1
try {
- Class.forName("dot.junit.opcodes.iget.d.T_iget_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_12().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
@@ -264,37 +267,33 @@
/**
* @constraint B12
- * @title Attempt to read protected field of unrelated class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read protected field of unrelated class.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.iget.d.T_iget_21
//@uses dot.junit.opcodes.iget.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget.d.T_iget_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_21().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
-
/**
* @constraint A11
- * @title Attempt to read static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read static field.
*/
public void testVFE16() {
//@uses dot.junit.opcodes.iget.d.T_iget_5
- //@uses dot.junit.opcodes.iget.TestStubs
+ //@uses dot.junit.opcodes.iget.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget.d.T_iget_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_5().run();
+ fail("expected an IncompatibleClassChangeError exception");
+ } catch (IncompatibleClassChangeError e) {
+ // expected
}
}
-
/**
* @constraint B6
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_12.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_12.java
index d01314b..b9f40ae 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget.d;
+public class T_iget_12 extends T_iget_1 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ @Override
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_13.java
index d01314b..1038f56 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget.d;
-
-public class T_invoke_interface_17 {
+public class T_iget_13 {
public void run() {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_21.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_21.java
index d01314b..31db5f1 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_21.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget.d;
+public class T_iget_21 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_5.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_5.java
index d01314b..053f013 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget.d;
+public class T_iget_5 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_6.java
index d01314b..efb61d2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget.d;
+public class T_iget_6 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_7.java
index d01314b..54b848f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget.d;
+public class T_iget_7 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_8.java
index d01314b..249b4d0 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget/d/T_iget_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget.d;
+public class T_iget_8 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/Test_iget_boolean.java b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/Test_iget_boolean.java
index 2b24d6d..b23f330 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/Test_iget_boolean.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/Test_iget_boolean.java
@@ -20,6 +20,13 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_1;
import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_11;
+import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_12;
+import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_13;
+import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_21;
+import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_5;
+import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_6;
+import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_7;
+import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_8;
import dot.junit.opcodes.iget_boolean.d.T_iget_boolean_9;
public class Test_iget_boolean extends DxTestCase {
@@ -91,70 +98,66 @@
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_boolean_13().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field
*/
public void testVFE4() {
//@uses dot.junit.opcodes.iget_boolean.d.T_iget_boolean_6
//@uses dot.junit.opcodes.iget_boolean.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_boolean_6().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_boolean_7().run();
+ fail("expected a NoClassDefFoundError exception");
+ } catch (NoClassDefFoundError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_boolean_8().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.iget_boolean.d.T_iget_boolean_12
//@uses dot.junit.opcodes.iget_boolean.d.T_iget_boolean_1
try {
- Class.forName("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_boolean_12().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
@@ -252,35 +255,32 @@
/**
* @constraint B12
- * @title Attempt to read inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible protected field.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.iget_boolean.d.T_iget_boolean_21
//@uses dot.junit.opcodes.iget_boolean.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_boolean_21().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
/**
* @constraint A11
- * @title Attempt to read static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read static field.
*/
public void testVFE16() {
//@uses dot.junit.opcodes.iget_boolean.d.T_iget_boolean_5
//@uses dot.junit.opcodes.iget_boolean.TestStubs
-
try {
- Class.forName("dot.junit.opcodes.iget_boolean.d.T_iget_boolean_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_boolean_5().run();
+ fail("expected an IncompatibleClassChangeError exception");
+ } catch (IncompatibleClassChangeError e) {
+ // expected
}
}
@@ -297,4 +297,3 @@
}
}
}
-
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_12.java
similarity index 72%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_12.java
index d01314b..5af996f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_boolean.d;
+public class T_iget_boolean_12 extends T_iget_boolean_1 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ @Override
+ public boolean run(){
+ return false;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_13.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_13.java
index d01314b..b652090 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_boolean.d;
+public class T_iget_boolean_13 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public void run(){
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_21.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_21.java
index d01314b..74e2da1 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_21.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_boolean.d;
+public class T_iget_boolean_21 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public boolean run(){
+ return false;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_5.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_5.java
index d01314b..5b275aa 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_boolean.d;
+public class T_iget_boolean_5 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public boolean run(){
+ return false;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_6.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_6.java
index d01314b..0d91cab 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_boolean.d;
+public class T_iget_boolean_6 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public boolean run(){
+ return false;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_7.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_7.java
index d01314b..3ec333b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_boolean.d;
+public class T_iget_boolean_7 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public boolean run(){
+ return false;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_8.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_8.java
index d01314b..b87cf8d 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_boolean/d/T_iget_boolean_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_boolean.d;
+public class T_iget_boolean_8 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public boolean run(){
+ return false;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iget_byte/Test_iget_byte.java b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/Test_iget_byte.java
index 5d8630b..de48192 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iget_byte/Test_iget_byte.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/Test_iget_byte.java
@@ -20,6 +20,13 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.iget_byte.d.T_iget_byte_1;
import dot.junit.opcodes.iget_byte.d.T_iget_byte_11;
+import dot.junit.opcodes.iget_byte.d.T_iget_byte_12;
+import dot.junit.opcodes.iget_byte.d.T_iget_byte_13;
+import dot.junit.opcodes.iget_byte.d.T_iget_byte_21;
+import dot.junit.opcodes.iget_byte.d.T_iget_byte_5;
+import dot.junit.opcodes.iget_byte.d.T_iget_byte_6;
+import dot.junit.opcodes.iget_byte.d.T_iget_byte_7;
+import dot.junit.opcodes.iget_byte.d.T_iget_byte_8;
import dot.junit.opcodes.iget_byte.d.T_iget_byte_9;
public class Test_iget_byte extends DxTestCase {
@@ -89,70 +96,66 @@
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.iget_byte.d.T_iget_byte_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_byte_13().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.iget_byte.d.T_iget_byte_6
//@uses dot.junit.opcodes.iget_byte.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_byte.d.T_iget_byte_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_byte_6().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iget_byte.d.T_iget_byte_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_byte_7().run();
+ fail("expected a NoClassDefFoundError exception");
+ } catch (NoClassDefFoundError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.iget_byte.d.T_iget_byte_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_byte_8().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.iget_byte.d.T_iget_byte_12
//@uses dot.junit.opcodes.iget_byte.d.T_iget_byte_1
try {
- Class.forName("dot.junit.opcodes.iget_byte.d.T_iget_byte_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_byte_12().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
@@ -249,34 +252,32 @@
/**
* @constraint B12
- * @title Attempt to read inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible protected field.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.iget_byte.d.T_iget_byte_21
//@uses dot.junit.opcodes.iget_byte.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_byte.d.T_iget_byte_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_byte_21().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
/**
* @constraint A11
- * @title Attempt to read static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read static field.
*/
public void testVFE16() {
//@uses dot.junit.opcodes.iget_byte.d.T_iget_byte_5
//@uses dot.junit.opcodes.iget_byte.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_byte.d.T_iget_byte_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_byte_5().run();
+ fail("expected an IncompatibleClassChangeError exception");
+ } catch (IncompatibleClassChangeError e) {
+ // expected
}
}
@@ -293,4 +294,3 @@
}
}
}
-
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_12.java
similarity index 73%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_12.java
index d01314b..3927a5b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_byte.d;
+public class T_iget_byte_12 extends T_iget_byte_1 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ @Override
+ public byte run() {
+ return p1;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_13.java
index d01314b..755b896 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_byte.d;
-
-public class T_invoke_interface_17 {
+public class T_iget_byte_13 {
public void run() {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_21.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_21.java
index d01314b..10deb39 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_21.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_byte.d;
+public class T_iget_byte_21 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public byte run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_5.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_5.java
index d01314b..75f7a5c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_byte.d;
+public class T_iget_byte_5 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public byte run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_6.java
index d01314b..20af80f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_byte.d;
+public class T_iget_byte_6 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public byte run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_7.java
index d01314b..f13071d 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_byte.d;
+public class T_iget_byte_7 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public byte run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_8.java
index d01314b..6f89bf3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_byte/d/T_iget_byte_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_byte.d;
+public class T_iget_byte_8 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public byte run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iget_char/Test_iget_char.java b/tools/vm-tests/src/dot/junit/opcodes/iget_char/Test_iget_char.java
index 1805534..c7516e8 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iget_char/Test_iget_char.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_char/Test_iget_char.java
@@ -20,6 +20,13 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.iget_char.d.T_iget_char_1;
import dot.junit.opcodes.iget_char.d.T_iget_char_11;
+import dot.junit.opcodes.iget_char.d.T_iget_char_12;
+import dot.junit.opcodes.iget_char.d.T_iget_char_13;
+import dot.junit.opcodes.iget_char.d.T_iget_char_21;
+import dot.junit.opcodes.iget_char.d.T_iget_char_5;
+import dot.junit.opcodes.iget_char.d.T_iget_char_6;
+import dot.junit.opcodes.iget_char.d.T_iget_char_7;
+import dot.junit.opcodes.iget_char.d.T_iget_char_8;
import dot.junit.opcodes.iget_char.d.T_iget_char_9;
public class Test_iget_char extends DxTestCase {
@@ -92,70 +99,66 @@
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.iget_char.d.T_iget_char_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_char_13().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError t) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.iget_char.d.T_iget_char_6
//@uses dot.junit.opcodes.iget_char.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_char.d.T_iget_char_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_char_6().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError t) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iget_char.d.T_iget_char_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_char_7().run();
+ fail("expected a NoClassDefFoundError exception");
+ } catch (NoClassDefFoundError t) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.iget_char.d.T_iget_char_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_char_8().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError t) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.iget_char.d.T_iget_char_12
//@uses dot.junit.opcodes.iget_char.d.T_iget_char_1
try {
- Class.forName("dot.junit.opcodes.iget_char.d.T_iget_char_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_char_12().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError t) {
+ // expected
}
}
@@ -256,34 +259,32 @@
/**
* @constraint B12
- * @title Attempt to read inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible protected field.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.iget_char.d.T_iget_char_21
//@uses dot.junit.opcodes.iget_char.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_char.d.T_iget_char_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_char_21().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError t) {
+ // expected
}
}
/**
* @constraint A11
- * @title Attempt to read static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read static field.
*/
public void testVFE16() {
//@uses dot.junit.opcodes.iget_char.d.T_iget_char_5
//@uses dot.junit.opcodes.iget_char.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_char.d.T_iget_char_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_char_5().run();
+ fail("expected an IncompatibleClassChangeError exception");
+ } catch (IncompatibleClassChangeError t) {
+ // expected
}
}
@@ -301,4 +302,3 @@
}
}
}
-
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_12.java
similarity index 73%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_12.java
index d01314b..611b24b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_char.d;
+public class T_iget_char_12 extends T_iget_char_1 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ @Override
+ public char run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_13.java
index d01314b..33cae33 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_char.d;
-
-public class T_invoke_interface_17 {
+public class T_iget_char_13 {
public void run() {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_21.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_21.java
index d01314b..6517824 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_21.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_char.d;
+public class T_iget_char_21 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public char run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_5.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_5.java
index d01314b..4975e76 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_char.d;
+public class T_iget_char_5 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public char run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_6.java
index d01314b..8be8c2b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_char.d;
+public class T_iget_char_6 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public char run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_7.java
index d01314b..4ca80d7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_char.d;
+public class T_iget_char_7 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public char run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_8.java
index d01314b..49d35c6 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_char/d/T_iget_char_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_char.d;
+public class T_iget_char_8 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public char run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iget_object/Test_iget_object.java b/tools/vm-tests/src/dot/junit/opcodes/iget_object/Test_iget_object.java
index 7c6e03c..3a735b6 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iget_object/Test_iget_object.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_object/Test_iget_object.java
@@ -20,6 +20,14 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.iget_object.d.T_iget_object_1;
import dot.junit.opcodes.iget_object.d.T_iget_object_11;
+import dot.junit.opcodes.iget_object.d.T_iget_object_12;
+import dot.junit.opcodes.iget_object.d.T_iget_object_13;
+import dot.junit.opcodes.iget_object.d.T_iget_object_21;
+import dot.junit.opcodes.iget_object.d.T_iget_object_22;
+import dot.junit.opcodes.iget_object.d.T_iget_object_5;
+import dot.junit.opcodes.iget_object.d.T_iget_object_6;
+import dot.junit.opcodes.iget_object.d.T_iget_object_7;
+import dot.junit.opcodes.iget_object.d.T_iget_object_8;
import dot.junit.opcodes.iget_object.d.T_iget_object_9;
public class Test_iget_object extends DxTestCase {
@@ -91,70 +99,66 @@
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.iget_object.d.T_iget_object_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_object_13().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.iget_object.d.T_iget_object_6
//@uses dot.junit.opcodes.iget_object.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_object.d.T_iget_object_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_object_6().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iget_object.d.T_iget_object_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_object_7().run();
+ fail("expected a NoClassDefFoundError exception");
+ } catch (NoClassDefFoundError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.iget_object.d.T_iget_object_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_object_8().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.iget_object.d.T_iget_object_12
//@uses dot.junit.opcodes.iget_object.d.T_iget_object_1
try {
- Class.forName("dot.junit.opcodes.iget_object.d.T_iget_object_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_object_12().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
@@ -262,43 +266,40 @@
*/
public void testVFE15() {
try {
- Class.forName("dot.junit.opcodes.iget_object.d.T_iget_object_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_object_21().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint B12
- * @title Attempt to read inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible protected field.
*/
public void testVFE16() {
//@uses dot.junit.opcodes.iget_object.d.T_iget_object_22
//@uses dot.junit.opcodes.iget_object.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_object.d.T_iget_object_22");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_object_22().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
-
/**
* @constraint A11
- * @title Attempt to read static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read static field.
*/
public void testVFE17() {
//@uses dot.junit.opcodes.iget_object.d.T_iget_object_5
- //@uses dot.junit.opcodes.iget_object.TestStubs
+ //@uses dot.junit.opcodes.iget_object.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_object.d.T_iget_object_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_object_5().run();
+ fail("expected an IncompatibleClassChangeError exception");
+ } catch (IncompatibleClassChangeError e) {
+ // expected
}
}
@@ -315,4 +316,3 @@
}
}
}
-
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_12.java
similarity index 73%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_12.java
index d01314b..f98c36a 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_object.d;
+public class T_iget_object_12 extends T_iget_object_1 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_13.java
index d01314b..85a8761 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_object.d;
-
-public class T_invoke_interface_17 {
+public class T_iget_object_13 {
public void run() {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_21.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_21.java
index d01314b..e301893 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_21.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_object.d;
+public class T_iget_object_21 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public String run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_22.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_22.java
index d01314b..d9ad933 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_22.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_object.d;
+public class T_iget_object_22 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_5.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_5.java
index d01314b..3626499 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_object.d;
+public class T_iget_object_5 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_6.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_6.java
index d01314b..a4ba515 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_object.d;
+public class T_iget_object_6 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_7.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_7.java
index d01314b..2940ca4 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_object.d;
+public class T_iget_object_7 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_8.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_8.java
index d01314b..3b5c4d7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_object/d/T_iget_object_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_object.d;
+public class T_iget_object_8 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iget_short/Test_iget_short.java b/tools/vm-tests/src/dot/junit/opcodes/iget_short/Test_iget_short.java
index aaa8270..a7d3658 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iget_short/Test_iget_short.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_short/Test_iget_short.java
@@ -20,6 +20,13 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.iget_short.d.T_iget_short_1;
import dot.junit.opcodes.iget_short.d.T_iget_short_11;
+import dot.junit.opcodes.iget_short.d.T_iget_short_12;
+import dot.junit.opcodes.iget_short.d.T_iget_short_13;
+import dot.junit.opcodes.iget_short.d.T_iget_short_21;
+import dot.junit.opcodes.iget_short.d.T_iget_short_5;
+import dot.junit.opcodes.iget_short.d.T_iget_short_6;
+import dot.junit.opcodes.iget_short.d.T_iget_short_7;
+import dot.junit.opcodes.iget_short.d.T_iget_short_8;
import dot.junit.opcodes.iget_short.d.T_iget_short_9;
public class Test_iget_short extends DxTestCase {
@@ -93,70 +100,66 @@
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.iget_short.d.T_iget_short_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_short_13().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.iget_short.d.T_iget_short_6
//@uses dot.junit.opcodes.iget_short.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_short.d.T_iget_short_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_short_6().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iget_short.d.T_iget_short_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_short_7().run();
+ fail("expected a NoClassDefFoundError exception");
+ } catch (NoClassDefFoundError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.iget_short.d.T_iget_short_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_short_8().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.iget_short.d.T_iget_short_12
//@uses dot.junit.opcodes.iget_short.d.T_iget_short_1
try {
- Class.forName("dot.junit.opcodes.iget_short.d.T_iget_short_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_short_12().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
@@ -259,34 +262,32 @@
/**
* @constraint B12
- * @title Attempt to read inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible protected field.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.iget_short.d.T_iget_short_21
//@uses dot.junit.opcodes.iget_short.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_short.d.T_iget_short_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_short_21().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
/**
* @constraint A11
- * @title Attempt to read static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read static field.
*/
public void testVFE16() {
//@uses dot.junit.opcodes.iget_short.d.T_iget_short_5
- //@uses dot.junit.opcodes.iget_short.TestStubs
+ //@uses dot.junit.opcodes.iget_short.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_short.d.T_iget_short_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_short_5().run();
+ fail("expected an IncompatibleClassChangeError exception");
+ } catch (IncompatibleClassChangeError e) {
+ // expected
}
}
@@ -303,4 +304,3 @@
}
}
}
-
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_12.java
similarity index 73%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_12.java
index d01314b..be322f3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_short.d;
+public class T_iget_short_12 extends T_iget_short_1 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ @Override
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_13.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_13.java
index d01314b..3b27d6c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_short.d;
+public class T_iget_short_13 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public void run(){
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.java b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.java
index 2c7fd32..5bb7f6e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_21.java
@@ -18,4 +18,6 @@
public class T_iget_short_21 {
+ public void run() {
+ }
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_5.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_5.java
index d01314b..37c4351 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_short.d;
+public class T_iget_short_5 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_6.java
index d01314b..5ac127b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_short.d;
+public class T_iget_short_6 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_7.java
index d01314b..7c81be5 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_short.d;
+public class T_iget_short_7 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_8.java
index d01314b..f22a81e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_short/d/T_iget_short_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_short.d;
+public class T_iget_short_8 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iget_wide/Test_iget_wide.java b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/Test_iget_wide.java
index 2260220..7e42d32 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iget_wide/Test_iget_wide.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/Test_iget_wide.java
@@ -20,7 +20,14 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.iget_wide.d.T_iget_wide_1;
import dot.junit.opcodes.iget_wide.d.T_iget_wide_11;
+import dot.junit.opcodes.iget_wide.d.T_iget_wide_12;
+import dot.junit.opcodes.iget_wide.d.T_iget_wide_13;
import dot.junit.opcodes.iget_wide.d.T_iget_wide_2;
+import dot.junit.opcodes.iget_wide.d.T_iget_wide_21;
+import dot.junit.opcodes.iget_wide.d.T_iget_wide_5;
+import dot.junit.opcodes.iget_wide.d.T_iget_wide_6;
+import dot.junit.opcodes.iget_wide.d.T_iget_wide_7;
+import dot.junit.opcodes.iget_wide.d.T_iget_wide_8;
import dot.junit.opcodes.iget_wide.d.T_iget_wide_9;
public class Test_iget_wide extends DxTestCase {
@@ -99,70 +106,66 @@
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.iget_wide.d.T_iget_wide_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_wide_13().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.iget_wide.d.T_iget_wide_6
//@uses dot.junit.opcodes.iget_wide.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_wide.d.T_iget_wide_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_wide_6().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iget_wide.d.T_iget_wide_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_wide_7().run();
+ fail("expected a NoClassDefFoundError exception");
+ } catch (NoClassDefFoundError e) {
+ // expected
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.iget_wide.d.T_iget_wide_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_wide_8().run();
+ fail("expected a NoSuchFieldError exception");
+ } catch (NoSuchFieldError e) {
+ // expected
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.iget_wide.d.T_iget_wide_12
//@uses dot.junit.opcodes.iget_wide.d.T_iget_wide_1
try {
- Class.forName("dot.junit.opcodes.iget_wide.d.T_iget_wide_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_wide_12().run();
+ fail("expected a IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
@@ -265,34 +268,31 @@
/**
* @constraint B12
- * @title Attempt to read inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible protected field.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.iget_wide.d.T_iget_wide_21
- //@uses dot.junit.opcodes.iget.TestStubs
+ //@uses dot.junit.opcodes.iget_wide.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_wide.d.T_iget_wide_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_wide_21().run();
+ fail("expected an IllegalAccessError exception");
+ } catch (IllegalAccessError e) {
+ // expected
}
}
-
/**
* @constraint A11
- * @title Attempt to read static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read static field.
*/
public void testVFE16() {
//@uses dot.junit.opcodes.iget_wide.d.T_iget_wide_5
- //@uses dot.junit.opcodes.iget_wide.TestStubs
+ //@uses dot.junit.opcodes.iget_wide.TestStubs
try {
- Class.forName("dot.junit.opcodes.iget_wide.d.T_iget_wide_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iget_wide_5().run();
+ fail("expected a IncompatibleClassChangeError exception");
+ } catch (IncompatibleClassChangeError e) {
+ // expected
}
}
@@ -309,4 +309,3 @@
}
}
}
-
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_12.java
similarity index 73%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_12.java
index d01314b..af3cbda 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_wide.d;
+public class T_iget_wide_12 extends T_iget_wide_1 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ @Override
+ public long run() {
+ return -99;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_13.java
index d01314b..98086a6 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_wide.d;
-
-public class T_invoke_interface_17 {
+public class T_iget_wide_13 {
public void run() {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_21.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_21.java
index d01314b..affeadf 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_21.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_wide.d;
+public class T_iget_wide_21 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public long run() {
+ return -99;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_5.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_5.java
index d01314b..c4c130e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_wide.d;
+public class T_iget_wide_5 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public long run() {
+ return -99;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_6.java
index d01314b..649795f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_wide.d;
+public class T_iget_wide_6 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public long run() {
+ return -99;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_7.java
index d01314b..0866645 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_wide.d;
+public class T_iget_wide_7 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public long run() {
+ return -99;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_8.java
index d01314b..570764d 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iget_wide/d/T_iget_wide_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iget_wide.d;
+public class T_iget_wide_8 {
-public class T_invoke_interface_17 {
-
- public void run() {
+ public long run() {
+ return -99;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/instance_of/TestStubs.java b/tools/vm-tests/src/dot/junit/opcodes/instance_of/TestStubs.java
index 1343108..9867d92 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/instance_of/TestStubs.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/instance_of/TestStubs.java
@@ -16,12 +16,5 @@
package dot.junit.opcodes.instance_of;
-public class TestStubs {
- @SuppressWarnings("unused")
- private class TestStub {
- // used by testVFE5
- public void foo() {
-
- }
- }
+class TestStubs {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/instance_of/Test_instance_of.java b/tools/vm-tests/src/dot/junit/opcodes/instance_of/Test_instance_of.java
index fc27929..b0a6cc6 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/instance_of/Test_instance_of.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/instance_of/Test_instance_of.java
@@ -24,8 +24,8 @@
import dot.junit.opcodes.instance_of.d.T_instance_of_7;
public class Test_instance_of extends DxTestCase {
-
-
+
+
/**
* @title (Object)String instanceof String
*/
@@ -60,25 +60,22 @@
}
/**
- * @title Attempt to access inaccessible class.
- */
+ * @title Attempt to access inaccessible class.
+ */
public void testE2() {
- //@uses dot.junit.opcodes.instance_of.TestStubs$TestStub
+ //@uses dot.junit.opcodes.instance_of.TestStubs
//@uses dot.junit.opcodes.instance_of.d.T_instance_of_3
try {
T_instance_of_3 tt = new T_instance_of_3();
tt.run();
- fail("expected a verification exception");
+ fail("expected IllegalAccessError");
} catch (IllegalAccessError e) {
- // expected
- } catch(VerifyError e) {
- // expected
}
}
-
+
/**
- * @title Attempt to access undefined class.
- */
+ * @title Attempt to access undefined class.
+ */
public void testE3() {
try {
T_instance_of_7 tt = new T_instance_of_7();
@@ -92,7 +89,7 @@
}
/**
- * @constraint A19
+ * @constraint A19
* @title constant pool index
*/
public void testVFE1() {
@@ -105,8 +102,8 @@
}
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title type of argument - int
*/
public void testVFE2() {
@@ -119,8 +116,8 @@
}
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title type of argument - long
*/
public void testVFE3() {
@@ -131,10 +128,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title number of registers
*/
public void testVFE4() {
@@ -146,5 +143,5 @@
}
}
-
+
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/instance_of/d/T_instance_of_3.d b/tools/vm-tests/src/dot/junit/opcodes/instance_of/d/T_instance_of_3.d
index 60457a1..6705dcf 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/instance_of/d/T_instance_of_3.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/instance_of/d/T_instance_of_3.d
@@ -26,7 +26,7 @@
.method public run()V
.limit regs 6
- instance-of v0, v5, dot/junit/opcodes/instance_of/TestStubs$TestStub
+ instance-of v0, v5, dot/junit/opcodes/instance_of/TestStubs
return-void
.end method
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/Test_invoke_direct.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/Test_invoke_direct.java
index 69e1fe2..e7c6a0b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/Test_invoke_direct.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/Test_invoke_direct.java
@@ -18,9 +18,13 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
-
+import dot.junit.opcodes.invoke_direct.d.T_invoke_direct_12;
+import dot.junit.opcodes.invoke_direct.d.T_invoke_direct_13;
+import dot.junit.opcodes.invoke_direct.d.T_invoke_direct_16;
import dot.junit.opcodes.invoke_direct.d.T_invoke_direct_2;
import dot.junit.opcodes.invoke_direct.d.T_invoke_direct_21;
+import dot.junit.opcodes.invoke_direct.d.T_invoke_direct_6;
+import dot.junit.opcodes.invoke_direct.d.T_invoke_direct_7;
import dot.junit.opcodes.invoke_direct.d.T_invoke_direct_8;
import dot.junit.opcodes.invoke_direct.d.T_invoke_direct_9;
@@ -69,11 +73,11 @@
} catch (UnsatisfiedLinkError e) {
// expected
}
- }
+ }
/**
- * @constraint A13
- * @title invalid constant pool index
+ * @constraint A13
+ * @title invalid constant pool index
*/
public void testVFE1() {
try {
@@ -85,7 +89,7 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title invoke-direct may not be used to invoke <clinit>
*/
public void testVFE3() {
@@ -98,22 +102,21 @@
}
/**
- * @constraint B4
+ * @constraint B4
* @title invoke-direct target must be in self or superclass
*/
public void testVFE4() {
//@uses dot.junit.opcodes.invoke_direct.d.T_invoke_direct_6
- //@uses dot.junit.opcodes.invoke_direct.TSuper
+ //@uses dot.junit.opcodes.invoke_direct.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_direct.d.T_invoke_direct_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_6();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
/**
- * @constraint B1
+ * @constraint B1
* @title number of arguments
*/
public void testVFE5() {
@@ -126,7 +129,7 @@
}
/**
- * @constraint B1
+ * @constraint B1
* @title int is passed instead of obj ref
*/
public void testVFE6() {
@@ -171,7 +174,7 @@
*/
public void testVFE10() {
//@uses dot.junit.opcodes.invoke_direct.d.T_invoke_direct_25
- //@uses dot.junit.opcodes.invoke_direct.TPlain
+ //@uses dot.junit.opcodes.invoke_direct.TPlain
//@uses dot.junit.opcodes.invoke_direct.TSuper
try {
Class.forName("dot.junit.opcodes.invoke_direct.d.T_invoke_direct_25");
@@ -195,9 +198,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE12() {
@@ -209,38 +212,34 @@
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call undefined method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call undefined method.
*/
public void testVFE13() {
try {
- Class.forName("dot.junit.opcodes.invoke_direct.d.T_invoke_direct_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_7().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Method has different signature. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE14() {
try {
- Class.forName("dot.junit.opcodes.invoke_direct.d.T_invoke_direct_16");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_16().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to invoke static method. Java throws IncompatibleClassChangeError
+ * @title Attempt to invoke static method. Java throws IncompatibleClassChangeError
* on first access but Dalvik throws VerifyError on class loading.
*/
public void testVFE15() {
@@ -252,23 +251,21 @@
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to invoke private method of superclass. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke private method of superclass.
*/
public void testVFE16() {
//@uses dot.junit.opcodes.invoke_direct.d.T_invoke_direct_12
//@uses dot.junit.opcodes.invoke_direct.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_direct.d.T_invoke_direct_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_12().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
* @constraint n/a
@@ -276,18 +273,17 @@
*/
public void testVFE17() {
//@uses dot.junit.opcodes.invoke_direct.d.T_invoke_direct_13
- //@uses dot.junit.opcodes.invoke_direct.TAbstract
+ //@uses dot.junit.opcodes.invoke_direct.TAbstract
try {
- Class.forName("dot.junit.opcodes.invoke_direct.d.T_invoke_direct_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_13().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
- * @constraint B5
- * @title An instance initializer must only be invoked on an uninitialized instance.
+ * @constraint B5
+ * @title An instance initializer must only be invoked on an uninitialized instance.
*/
public void testVFE18() {
try {
@@ -297,14 +293,14 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B8
+ * @constraint B8
* @title attempt to access inherited instance field before <init> is called
*/
public void testVFE19() {
//@uses dot.junit.opcodes.invoke_direct.d.T_invoke_direct_18
- //@uses dot.junit.opcodes.invoke_direct.TSuper
+ //@uses dot.junit.opcodes.invoke_direct.TSuper
try {
Class.forName("dot.junit.opcodes.invoke_direct.d.T_invoke_direct_18");
fail("expected a verification exception");
@@ -312,9 +308,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A13
+ * @constraint A13
* @title attempt to invoke interface method
*/
public void testVFE20() {
@@ -325,10 +321,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B6
- * @title instance methods may only be invoked on already initialized instances.
+ * @constraint B6
+ * @title instance methods may only be invoked on already initialized instances.
*/
public void testVFE21() {
try {
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_12.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_12.java
index d01314b..2911abf 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct.d;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_direct_12 {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_13.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_13.java
index d01314b..df8d0d5 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct.d;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_direct_13 {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_16.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_16.java
index d01314b..cae7ae8 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_16.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct.d;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_direct_16 {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_6.java
index d01314b..6f95a12 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_direct_6 {
+ public T_invoke_direct_6() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_7.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_7.java
index d01314b..b640fa3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct/d/T_invoke_direct_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct.d;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_direct_7 {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/Test_invoke_direct_range.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/Test_invoke_direct_range.java
index 0a903f3..1682c68 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/Test_invoke_direct_range.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/Test_invoke_direct_range.java
@@ -18,9 +18,13 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
-
+import dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_12;
+import dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_13;
+import dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_16;
import dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_2;
import dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_21;
+import dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_6;
+import dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_7;
import dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_8;
import dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_9;
@@ -69,11 +73,11 @@
} catch (UnsatisfiedLinkError e) {
// expected
}
- }
+ }
/**
- * @constraint A14
- * @title invalid constant pool index
+ * @constraint A14
+ * @title invalid constant pool index
*/
public void testVFE1() {
try {
@@ -85,7 +89,7 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title invoke-direct may not be used to invoke <clinit>
*/
public void testVFE3() {
@@ -103,17 +107,16 @@
*/
public void testVFE4() {
//@uses dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_6
- //@uses dot.junit.opcodes.invoke_direct_range.TSuper
+ //@uses dot.junit.opcodes.invoke_direct_range.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_range_6();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
/**
- * @constraint B1
+ * @constraint B1
* @title number of arguments
*/
public void testVFE5() {
@@ -126,7 +129,7 @@
}
/**
- * @constraint B1
+ * @constraint B1
* @title int is passed instead of obj ref
*/
public void testVFE6() {
@@ -171,7 +174,7 @@
*/
public void testVFE10() {
//@uses dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_25
- //@uses dot.junit.opcodes.invoke_direct_range.TPlain
+ //@uses dot.junit.opcodes.invoke_direct_range.TPlain
//@uses dot.junit.opcodes.invoke_direct_range.TSuper
try {
Class.forName("dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_25");
@@ -195,9 +198,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE12() {
@@ -209,38 +212,34 @@
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call undefined method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call undefined method.
*/
public void testVFE13() {
try {
- Class.forName("dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_range_7().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Method has different signature. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE14() {
try {
- Class.forName("dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_16");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_range_16().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to invoke static method. Java throws IncompatibleClassChangeError
+ * @title Attempt to invoke static method. Java throws IncompatibleClassChangeError
* on first access but Dalvik throws VerifyError on class loading.
*/
public void testVFE15() {
@@ -252,23 +251,22 @@
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to invoke private method of superclass. Java throws IllegalAccessError
+ * @title Attempt to invoke private method of superclass. Java throws IllegalAccessError
* on first access but Dalvik throws VerifyError on class loading.
*/
public void testVFE16() {
//@uses dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_12
//@uses dot.junit.opcodes.invoke_direct_range.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_range_12().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
* @constraint n/a
@@ -276,18 +274,17 @@
*/
public void testVFE17() {
//@uses dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_13
- //@uses dot.junit.opcodes.invoke_direct_range.TAbstract
+ //@uses dot.junit.opcodes.invoke_direct_range.TAbstract
try {
- Class.forName("dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_direct_range_13().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
- * @constraint B5
- * @title An instance initializer must only be invoked on an uninitialized instance.
+ * @constraint B5
+ * @title An instance initializer must only be invoked on an uninitialized instance.
*/
public void testVFE18() {
try {
@@ -297,14 +294,14 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B8
+ * @constraint B8
* @title attempt to access inherited instance field before <init> is called
*/
public void testVFE19() {
//@uses dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_18
- //@uses dot.junit.opcodes.invoke_direct_range.TSuper
+ //@uses dot.junit.opcodes.invoke_direct_range.TSuper
try {
Class.forName("dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_18");
fail("expected a verification exception");
@@ -312,7 +309,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint A14
* @title attempt to invoke interface method
@@ -325,10 +322,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B6
- * @title instance methods may only be invoked on already initialized instances.
+ * @constraint B6
+ * @title instance methods may only be invoked on already initialized instances.
*/
public void testVFE21() {
try {
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_12.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_12.java
index d01314b..e01b4f7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct_range.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_direct_range_12 {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_13.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_13.java
index d01314b..39c9977 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct_range.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_direct_range_13 {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_16.java
similarity index 70%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_16.java
index d01314b..c593d95 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_16.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,14 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct_range.d;
+public class T_invoke_direct_range_16 {
+ public int run() {
+ return 0;
+ }
-public class T_invoke_interface_17 {
-
- public void run() {
+ private int toInt() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_6.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_6.java
index d01314b..b1e3a6e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct_range.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_direct_range_6 {
+ public T_invoke_direct_range_6() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_7.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_7.java
index d01314b..f68ed92 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_direct_range/d/T_invoke_direct_range_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_direct_range.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_direct_range_7 {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/ITestImpl.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/ITestImpl.java
index 6d27e1e..cf0c0c2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/ITestImpl.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/ITestImpl.java
@@ -16,8 +16,6 @@
package dot.junit.opcodes.invoke_interface;
-
-
public class ITestImpl implements ITest {
public void doit() {
// impl
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/Test_invoke_interface.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/Test_invoke_interface.java
index 3f8a7e9..377cc58 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/Test_invoke_interface.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/Test_invoke_interface.java
@@ -23,8 +23,14 @@
import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_12;
import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_13;
import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_14;
-import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_17;
+import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_16;
+import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_18;
+import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_20;
+import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_21;
import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_3;
+import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_4;
+import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_5;
+import dot.junit.opcodes.invoke_interface.d.T_invoke_interface_7;
public class Test_invoke_interface extends DxTestCase {
@@ -37,7 +43,7 @@
assertEquals(-1, t.run("aa", "bb"));
assertEquals(1, t.run("bb", "aa"));
}
-
+
/**
* @title Check that new frame is created by invoke_interface and
* arguments are passed to method
@@ -52,7 +58,7 @@
}
-
+
/**
* @title objref is null
*/
@@ -117,27 +123,6 @@
}
}
-
- /**
- * @title Attempt to invoke non-public interface method
- */
- public void testE8() {
- //@uses dot.junit.opcodes.invoke_interface.d.T_invoke_interface_17
- //@uses dot.junit.opcodes.invoke_interface.ITest
- //@uses dot.junit.opcodes.invoke_interface.ITestImpl
- //@uses dot.junit.opcodes.invoke_interface.ITestImplAbstract
- try {
- T_invoke_interface_17 t = new T_invoke_interface_17();
- t.run();
- fail("expected a verification exception");
- } catch (IllegalAccessError e) {
- // expected
- } catch (VerifyError e) {
- // expected
- }
- }
-
-
/**
* @constraint A16
* @title invalid constant pool index
@@ -150,17 +135,16 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint A16
- * @title The referenced method_id must belong to an interface (not a class).
+ * @title The referenced method_id must belong to an interface (not a class).
*/
public void testVFE2() {
try {
- Class.forName("dot.junit.opcodes.invoke_interface.d.T_invoke_interface_4");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_4().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
@@ -169,11 +153,12 @@
* @title number of arguments
*/
public void testVFE5() {
+ //@uses dot.junit.opcodes.invoke_interface.ITest
+ //@uses dot.junit.opcodes.invoke_interface.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface.d.T_invoke_interface_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_5(new ITestImpl());
+ fail("expected VerifyError");
+ } catch (VerifyError t) {
}
}
@@ -191,7 +176,7 @@
}
/**
- * @constraint B9
+ * @constraint B9
* @title number of arguments passed to method
*/
public void testVFE9() {
@@ -204,28 +189,31 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title invoke-interface may not be used to call <init>.
*/
public void testVFE10() {
+ //@uses dot.junit.opcodes.invoke_interface.ITest
+ //@uses dot.junit.opcodes.invoke_interface.ITestImpl
+ //@uses dot.junit.opcodes.invoke_interface.ITestImplAbstract
try {
- Class.forName("dot.junit.opcodes.invoke_interface.d.T_invoke_interface_18");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_18().run(new ITestImpl());
+ fail("expected InstantiationError");
+ } catch (InstantiationError t) {
}
}
/**
- * @constraint A15
+ * @constraint A15
* @title invoke-interface may not be used to call <clinit>.
*/
public void testVFE11() {
+ //@uses dot.junit.opcodes.invoke_interface.ITest
+ //@uses dot.junit.opcodes.invoke_interface.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface.d.T_invoke_interface_20");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_20().run(new ITestImpl());
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
@@ -234,16 +222,17 @@
* @title types of arguments passed to method
*/
public void testVFE12() {
+ //@uses dot.junit.opcodes.invoke_interface.ITest
+ //@uses dot.junit.opcodes.invoke_interface.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface.d.T_invoke_interface_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_21().run(new ITestImpl());
+ fail("expected VerifyError");
+ } catch (VerifyError t) {
}
}
-
+
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE13() {
@@ -254,50 +243,46 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call undefined method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call undefined method.
*/
public void testVFE14() {
//@uses dot.junit.opcodes.invoke_interface.d.T_invoke_interface_7
//@uses dot.junit.opcodes.invoke_interface.ITest
- //@uses dot.junit.opcodes.invoke_interface.ITestImpl
+ //@uses dot.junit.opcodes.invoke_interface.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface.d.T_invoke_interface_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_7().run(new ITestImpl());
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Method has different signature. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.invoke_interface.d.T_invoke_interface_16
//@uses dot.junit.opcodes.invoke_interface.ITest
- //@uses dot.junit.opcodes.invoke_interface.ITestImpl
+ //@uses dot.junit.opcodes.invoke_interface.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface.d.T_invoke_interface_16");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_16().run(new ITestImpl());
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
-
+
+
/**
- * @constraint B6
- * @title instance methods may only be invoked on already initialized instances.
+ * @constraint B6
+ * @title instance methods may only be invoked on already initialized instances.
*/
public void testVFE21() {
//@uses dot.junit.opcodes.invoke_interface.d.T_invoke_interface_22
//@uses dot.junit.opcodes.invoke_interface.ITest
- //@uses dot.junit.opcodes.invoke_interface.ITestImpl
+ //@uses dot.junit.opcodes.invoke_interface.ITestImpl
try {
Class.forName("dot.junit.opcodes.invoke_interface.d.T_invoke_interface_22");
fail("expected a verification exception");
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_16.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_16.java
index d01314b..f244ea3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_16.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -16,9 +16,10 @@
package dot.junit.opcodes.invoke_interface.d;
+import dot.junit.opcodes.invoke_interface.ITest;
-public class T_invoke_interface_17 {
+public class T_invoke_interface_16 {
- public void run() {
+ public void run(ITest test) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.d b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.d
deleted file mode 100644
index cc24097..0000000
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.d
+++ /dev/null
@@ -1,60 +0,0 @@
-; Copyright (C) 2008 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.
-
-.source ITestImplProtected.java
-.class public dot.junit.opcodes.invoke_interface.ITestImplProtected
-.super java/lang/Object
-.implements dot/junit/opcodes/invoke_interface/ITest
-
-.method public <init>()V
-.limit regs 2
-
- invoke-direct {v1}, java/lang/Object/<init>()V
- return-void
-.end method
-
-.method protected test(I)I
-.limit regs 2
- const v0, 0
- return v0
-.end method
-
-
-
-
-.source T_invoke_interface_17.java
-.class public dot.junit.opcodes.invoke_interface.d.T_invoke_interface_17
-.super java/lang/Object
-
-
-.method public <init>()V
-.limit regs 2
-
- invoke-direct {v1}, java/lang/Object/<init>()V
- return-void
-.end method
-
-
-.method public run()V
-.limit regs 7
- new-instance v0, Ldot/junit/opcodes/invoke_interface/ITestImplProtected;
- invoke-direct v0, dot.junit.opcodes.invoke_interface.ITestImplProtected/<init>()V
-
- const v1, 0
- invoke-interface {v0, v1}, dot/junit/opcodes/invoke_interface/ITest/test(I)I
-
- return-void
-.end method
-
-
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_21.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_21.java
index d01314b..f777a6b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_21.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -16,9 +16,10 @@
package dot.junit.opcodes.invoke_interface.d;
+import dot.junit.opcodes.invoke_interface.ITest;
-public class T_invoke_interface_17 {
+public class T_invoke_interface_21 {
- public void run() {
+ public void run(ITest test) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_4.java
similarity index 83%
rename from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
rename to tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_4.java
index d01314b..4f751fe 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_4.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -17,8 +17,9 @@
package dot.junit.opcodes.invoke_interface.d;
-public class T_invoke_interface_17 {
-
+public class T_invoke_interface_4 {
+ public void test() {
+ }
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_5.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_5.java
index d01314b..7615134 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -16,9 +16,11 @@
package dot.junit.opcodes.invoke_interface.d;
+import dot.junit.opcodes.invoke_interface.ITest;
-public class T_invoke_interface_17 {
- public void run() {
+public class T_invoke_interface_5 {
+
+ public T_invoke_interface_5(ITest test) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_7.java
similarity index 78%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_7.java
index d01314b..b249ded 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -16,9 +16,10 @@
package dot.junit.opcodes.invoke_interface.d;
+import dot.junit.opcodes.invoke_interface.ITest;
-public class T_invoke_interface_17 {
+public class T_invoke_interface_7 {
- public void run() {
+ public void run(ITest test) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/Test_invoke_interface_range.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/Test_invoke_interface_range.java
index fe650bd..abb4855 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/Test_invoke_interface_range.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/Test_invoke_interface_range.java
@@ -23,8 +23,14 @@
import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_12;
import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_13;
import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_14;
-import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_17;
+import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_16;
+import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_18;
+import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_20;
+import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_21;
import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_3;
+import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_4;
+import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_5;
+import dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_7;
public class Test_invoke_interface_range extends DxTestCase {
@@ -37,7 +43,7 @@
assertEquals(-1, t.run("aa", "bb"));
assertEquals(1, t.run("bb", "aa"));
}
-
+
/**
* @title Check that new frame is created by invoke_interface_range and
* arguments are passed to method
@@ -52,7 +58,7 @@
}
-
+
/**
* @title objref is null
*/
@@ -117,27 +123,6 @@
}
}
-
- /**
- * @title Attempt to invoke non-public interface method
- */
- public void testE8() {
- //@uses dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_17
- //@uses dot.junit.opcodes.invoke_interface_range.ITest
- //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
- //@uses dot.junit.opcodes.invoke_interface_range.ITestImplAbstract
- try {
- T_invoke_interface_range_17 t = new T_invoke_interface_range_17();
- t.run();
- fail("expected a verification exception");
- } catch (IllegalAccessError e) {
- // expected
- } catch (VerifyError e) {
- // expected
- }
- }
-
-
/**
* @constraint A17
* @title invalid constant pool index
@@ -150,17 +135,16 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint A17
- * @title The referenced method_id must belong to an interface (not a class).
+ * @title The referenced method_id must belong to an interface (not a class).
*/
public void testVFE2() {
try {
- Class.forName("dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_4");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_range_4().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
@@ -169,11 +153,12 @@
* @title number of arguments
*/
public void testVFE5() {
+ //@uses dot.junit.opcodes.invoke_interface_range.ITest
+ //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_range_5(new ITestImpl());
+ fail("expected VerifyError");
+ } catch (VerifyError t) {
}
}
@@ -191,7 +176,7 @@
}
/**
- * @constraint B9
+ * @constraint B9
* @title number of arguments passed to method
*/
public void testVFE9() {
@@ -204,28 +189,31 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title invoke-interface may not be used to call <init>.
*/
public void testVFE10() {
+ //@uses dot.junit.opcodes.invoke_interface_range.ITest
+ //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
+ //@uses dot.junit.opcodes.invoke_interface_range.ITestImplAbstract
try {
- Class.forName("dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_18");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_range_18().run(new ITestImpl());
+ fail("expected InstantiationError");
+ } catch (InstantiationError t) {
}
}
/**
- * @constraint A15
+ * @constraint A15
* @title invoke-interface may not be used to call <clinit>.
*/
public void testVFE11() {
+ //@uses dot.junit.opcodes.invoke_interface_range.ITest
+ //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_20");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_range_20().run(new ITestImpl());
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
@@ -234,16 +222,17 @@
* @title types of arguments passed to method
*/
public void testVFE12() {
+ //@uses dot.junit.opcodes.invoke_interface_range.ITest
+ //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_range_21().run(new ITestImpl());
+ fail("expected VerifyError");
+ } catch (VerifyError t) {
}
}
-
+
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE13() {
@@ -254,49 +243,46 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call undefined method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call undefined method.
*/
public void testVFE14() {
//@uses dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_7
//@uses dot.junit.opcodes.invoke_interface_range.ITest
- //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
+ //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_interface_range_7().run(new ITestImpl());
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Method has different signature. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_16
//@uses dot.junit.opcodes.invoke_interface_range.ITest
- //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
+ //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
try {
- Class.forName("dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_16");
- fail("expected a verification exception");
+ new T_invoke_interface_range_16().run(new ITestImpl());
+ fail("expected NoSuchMethodError");
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B6
- * @title instance methods may only be invoked on already initialized instances.
+ * @constraint B6
+ * @title instance methods may only be invoked on already initialized instances.
*/
public void testVFE21() {
//@uses dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_22
//@uses dot.junit.opcodes.invoke_interface_range.ITest
- //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
+ //@uses dot.junit.opcodes.invoke_interface_range.ITestImpl
try {
Class.forName("dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_22");
fail("expected a verification exception");
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_16.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_16.java
index 9d766e6..ada5988 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_16.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -16,9 +16,9 @@
package dot.junit.opcodes.invoke_interface_range.d;
+import dot.junit.opcodes.invoke_interface_range.ITest;
-public class T_invoke_interface_range_17 {
-
- public void run() {
+public class T_invoke_interface_range_16 {
+ public void run(ITest test) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.d b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.d
deleted file mode 100644
index cbb2c12..0000000
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.d
+++ /dev/null
@@ -1,60 +0,0 @@
-; Copyright (C) 2008 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.
-
-.source ITestImplProtected.java
-.class public dot.junit.opcodes.invoke_interface_range.ITestImplProtected
-.super java/lang/Object
-.implements dot/junit/opcodes/invoke_interface_range/ITest
-
-.method public <init>()V
-.limit regs 2
-
- invoke-direct {v1}, java/lang/Object/<init>()V
- return-void
-.end method
-
-.method protected test(I)I
-.limit regs 2
- const v0, 0
- return v0
-.end method
-
-
-
-
-.source T_invoke_interface_range_17.java
-.class public dot.junit.opcodes.invoke_interface_range.d.T_invoke_interface_range_17
-.super java/lang/Object
-
-
-.method public <init>()V
-.limit regs 2
-
- invoke-direct {v1}, java/lang/Object/<init>()V
- return-void
-.end method
-
-
-.method public run()V
-.limit regs 7
- new-instance v0, Ldot/junit/opcodes/invoke_interface_range/ITestImplProtected;
- invoke-direct v0, dot.junit.opcodes.invoke_interface_range.ITestImplProtected/<init>()V
-
- const v1, 0
- invoke-interface/range {v0..v1}, dot/junit/opcodes/invoke_interface_range/ITest/test(I)I
-
- return-void
-.end method
-
-
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_21.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_21.java
index 9d766e6..b26ae98 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_21.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -16,9 +16,9 @@
package dot.junit.opcodes.invoke_interface_range.d;
+import dot.junit.opcodes.invoke_interface_range.ITest;
-public class T_invoke_interface_range_17 {
-
- public void run() {
+public class T_invoke_interface_range_21 {
+ public void run(ITest test) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_4.java
similarity index 90%
rename from tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
rename to tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_4.java
index 9d766e6..aa0b9ab 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_4.java
@@ -17,8 +17,9 @@
package dot.junit.opcodes.invoke_interface_range.d;
-public class T_invoke_interface_range_17 {
-
+public class T_invoke_interface_range_4 {
+ public void test() {
+ }
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_5.java
similarity index 81%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_5.java
index 9d766e6..cfbcd8c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_5.java
@@ -16,9 +16,9 @@
package dot.junit.opcodes.invoke_interface_range.d;
+import dot.junit.opcodes.invoke_interface_range.ITest;
-public class T_invoke_interface_range_17 {
-
- public void run() {
+public class T_invoke_interface_range_5 {
+ public T_invoke_interface_range_5(ITest test) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_7.java
index 9d766e6..82b6c7c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_interface_range/d/T_invoke_interface_range_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -16,9 +16,9 @@
package dot.junit.opcodes.invoke_interface_range.d;
+import dot.junit.opcodes.invoke_interface_range.ITest;
-public class T_invoke_interface_range_17 {
-
- public void run() {
+public class T_invoke_interface_range_7 {
+ public void run(ITest test) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_static/Test_invoke_static.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/Test_invoke_static.java
index 81f5aa0..c7b77aa 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_static/Test_invoke_static.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/Test_invoke_static.java
@@ -19,12 +19,18 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.invoke_static.d.T_invoke_static_1;
+import dot.junit.opcodes.invoke_static.d.T_invoke_static_13;
import dot.junit.opcodes.invoke_static.d.T_invoke_static_14;
import dot.junit.opcodes.invoke_static.d.T_invoke_static_15;
+import dot.junit.opcodes.invoke_static.d.T_invoke_static_17;
import dot.junit.opcodes.invoke_static.d.T_invoke_static_18;
+import dot.junit.opcodes.invoke_static.d.T_invoke_static_19;
import dot.junit.opcodes.invoke_static.d.T_invoke_static_2;
import dot.junit.opcodes.invoke_static.d.T_invoke_static_4;
+import dot.junit.opcodes.invoke_static.d.T_invoke_static_5;
import dot.junit.opcodes.invoke_static.d.T_invoke_static_6;
+import dot.junit.opcodes.invoke_static.d.T_invoke_static_7;
+import dot.junit.opcodes.invoke_static.d.T_invoke_static_8;
@@ -77,7 +83,7 @@
/**
* @title Native method can't be linked
- *
+ *
*/
public void testE2() {
T_invoke_static_6 t = new T_invoke_static_6();
@@ -105,7 +111,7 @@
/**
- * @constraint A13
+ * @constraint A13
* @title invalid constant pool index
*/
public void testVFE1() {
@@ -118,7 +124,7 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <clinit> may not be called using invoke-static
*/
public void testVFE3() {
@@ -131,7 +137,7 @@
}
/**
- * @constraint B1
+ * @constraint B1
* @title number of arguments passed to method.
*/
public void testVFE4() {
@@ -149,15 +155,14 @@
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.invoke_static.d.T_invoke_static_19");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_19().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
/**
- * @constraint B9
+ * @constraint B9
* @title types of arguments passed to method
*/
public void testVFE6() {
@@ -168,87 +173,77 @@
DxUtil.checkVerifyException(t);
}
}
-
-
+
+
/**
* @constraint n/a
- * @title Attempt to call non-static method. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call non-static method.
*/
public void testVFE7() {
try {
- Class.forName("dot.junit.opcodes.invoke_static.d.T_invoke_static_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_5().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call undefined method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call undefined method.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.invoke_static.d.T_invoke_static_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_7().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call private method of other class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call private method of other class.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.invoke_static.d.T_invoke_static_8
//@uses dot.junit.opcodes.invoke_static.TestClass
try {
- Class.forName("dot.junit.opcodes.invoke_static.d.T_invoke_static_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_8().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Method has different signature. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE10() {
//@uses dot.junit.opcodes.invoke_static.d.T_invoke_static_13
//@uses dot.junit.opcodes.invoke_static.TestClass
try {
- Class.forName("dot.junit.opcodes.invoke_static.d.T_invoke_static_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_13().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint B12
- * @title Attempt to call protected method of unrelated class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call protected method of unrelated class.
*/
public void testVFE12() {
//@uses dot.junit.opcodes.invoke_static.d.T_invoke_static_17
//@uses dot.junit.opcodes.invoke_static.TestClass
try {
- Class.forName("dot.junit.opcodes.invoke_static.d.T_invoke_static_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_17().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE13() {
@@ -259,9 +254,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A13
+ * @constraint A13
* @title attempt to invoke interface method
*/
public void testVFE18() {
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_13.java
index d01314b..a51532c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_static_13 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_17.d b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_17.d
index ae7204d..1ce4ed4 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_17.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_17.d
@@ -27,7 +27,7 @@
.method public run()V
.limit regs 1
- invoke-static {}, dot/junit/opcodes/invokestatic/TestClass/testProtected()V
+ invoke-static {}, dot/junit/opcodes/invoke_static/TestClass/testProtected()V
return-void
.end method
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_17.java
index d01314b..194ef10 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_static_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_5.java
similarity index 71%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_5.java
index d01314b..ace37b8 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,13 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_static_5 {
+ public int run() {
+ return 0;
+ }
+ public int test(int i) {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_7.java
index d01314b..55a2327 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_static_7 {
+ public static void test() {
+ }
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_8.java
index d01314b..61acbc9 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static/d/T_invoke_static_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_static_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/Test_invoke_static_range.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/Test_invoke_static_range.java
index 8b996fd..c62b333 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/Test_invoke_static_range.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/Test_invoke_static_range.java
@@ -19,12 +19,18 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_1;
+import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_13;
import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_14;
import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_15;
+import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_17;
import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_18;
+import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_19;
import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_2;
import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_4;
+import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_5;
import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_6;
+import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_7;
+import dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_8;
@@ -77,7 +83,7 @@
/**
* @title Native method can't be linked
- *
+ *
*/
public void testE2() {
T_invoke_static_range_6 t = new T_invoke_static_range_6();
@@ -104,7 +110,7 @@
}
/**
- * @constraint A14
+ * @constraint A14
* @title invalid constant pool index
*/
public void testVFE1() {
@@ -117,7 +123,7 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <clinit> may not be called using invoke_static_range
*/
public void testVFE3() {
@@ -130,7 +136,7 @@
}
/**
- * @constraint B1
+ * @constraint B1
* @title number of arguments passed to method
*/
public void testVFE4() {
@@ -143,20 +149,19 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <init> may not be called using invoke_static_range
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_19");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_range_19().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
/**
- * @constraint B9
+ * @constraint B9
* @title types of arguments passed to method
*/
public void testVFE6() {
@@ -167,87 +172,77 @@
DxUtil.checkVerifyException(t);
}
}
-
-
+
+
/**
* @constraint n/a
- * @title Attempt to call non-static method. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call non-static method.
*/
public void testVFE7() {
try {
- Class.forName("dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_range_5().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call undefined method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call undefined method.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_range_7().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call private method of other class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call private method of other class.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_8
//@uses dot.junit.opcodes.invoke_static_range.TestClass
try {
- Class.forName("dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_range_8().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Method has different signature. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE10() {
//@uses dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_13
//@uses dot.junit.opcodes.invoke_static_range.TestClass
try {
- Class.forName("dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_range_13().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint B12
- * @title Attempt to call protected method of unrelated class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call protected method of unrelated class.
*/
public void testVFE12() {
//@uses dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_17
//@uses dot.junit.opcodes.invoke_static_range.TestClass
try {
- Class.forName("dot.junit.opcodes.invoke_static_range.d.T_invoke_static_range_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_static_range_17().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE13() {
@@ -258,9 +253,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A14
+ * @constraint A14
* @title attempt to invoke interface method
*/
public void testVFE18() {
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_13.java
index d01314b..b3278c4 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static_range.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_static_range_13 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_17.d b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_17.d
index bc2e9e9..b2ce948 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_17.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_17.d
@@ -27,7 +27,7 @@
.method public run()V
.limit regs 1
- invoke-static/range {}, dot/junit/opcodes/invokestatic/TestClass/testProtected()V
+ invoke-static/range {}, dot/junit/opcodes/invoke_static_range/TestClass/testProtected()V
return-void
.end method
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_17.java
index d01314b..4b020b1 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static_range.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_static_range_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_5.java
similarity index 70%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_5.java
index d01314b..3e1f9cb 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,13 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static_range.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_static_range_5 {
+ public int run() {
+ return 0;
+ }
+ public int test(int i) {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_7.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_7.java
index d01314b..5e81cca 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static_range.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_static_range_7 {
+ public static void test() {
+ }
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_8.java
index d01314b..ac8e6c3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_static_range/d/T_invoke_static_range_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_static_range.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_static_range_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_super/Test_invoke_super.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/Test_invoke_super.java
index 00e983d..a2fd2d8 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_super/Test_invoke_super.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/Test_invoke_super.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.invoke_super.d.T_invoke_super_1;
+import dot.junit.opcodes.invoke_super.d.T_invoke_super_10;
import dot.junit.opcodes.invoke_super.d.T_invoke_super_14;
+import dot.junit.opcodes.invoke_super.d.T_invoke_super_15;
import dot.junit.opcodes.invoke_super.d.T_invoke_super_17;
+import dot.junit.opcodes.invoke_super.d.T_invoke_super_18;
+import dot.junit.opcodes.invoke_super.d.T_invoke_super_19;
import dot.junit.opcodes.invoke_super.d.T_invoke_super_2;
+import dot.junit.opcodes.invoke_super.d.T_invoke_super_20;
import dot.junit.opcodes.invoke_super.d.T_invoke_super_4;
+import dot.junit.opcodes.invoke_super.d.T_invoke_super_5;
import dot.junit.opcodes.invoke_super.d.T_invoke_super_6;
import dot.junit.opcodes.invoke_super.d.T_invoke_super_7;
@@ -37,7 +43,7 @@
T_invoke_super_1 t = new T_invoke_super_1();
assertEquals(5, t.run());
}
-
+
/**
* @title Invoke protected method of superclass
@@ -65,7 +71,7 @@
*/
public void testN6() {
//@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_17
- //@uses dot.junit.opcodes.invoke_super.d.TSuper
+ //@uses dot.junit.opcodes.invoke_super.d.TSuper
//@uses dot.junit.opcodes.invoke_super.d.TSuper2
T_invoke_super_17 t = new T_invoke_super_17();
assertEquals(5, t.run());
@@ -91,7 +97,7 @@
*/
public void testE2() {
//@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_4
- //@uses dot.junit.opcodes.invoke_super.d.TSuper
+ //@uses dot.junit.opcodes.invoke_super.d.TSuper
T_invoke_super_4 t = new T_invoke_super_4();
try {
t.run();
@@ -117,7 +123,7 @@
}
/**
- * @constraint A13
+ * @constraint A13
* @title invalid constant pool index
*/
public void testVFE1() {
@@ -130,20 +136,19 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <clinit> may not be called using invoke-super
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.invoke_super.d.T_invoke_super_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_10().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
/**
- * @constraint B1
+ * @constraint B1
* @title number of arguments passed to method
*/
public void testVFE4() {
@@ -156,12 +161,12 @@
}
/**
- * @constraint B9
+ * @constraint B9
* @title types of arguments passed to method.
*/
public void testVFE5() {
//@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_12
- //@uses dot.junit.opcodes.invoke_super.d.TSuper
+ //@uses dot.junit.opcodes.invoke_super.d.TSuper
try {
Class.forName("dot.junit.opcodes.invoke_super.d.T_invoke_super_12");
fail("expected a verification exception");
@@ -171,7 +176,7 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <init> may not be called using invoke_super
*/
public void testVFE6() {
@@ -184,7 +189,7 @@
}
/**
- * @constraint B10
+ * @constraint B10
* @title assignment incompatible references when accessing
* protected method
*/
@@ -201,14 +206,14 @@
}
/**
- * @constraint B10
+ * @constraint B10
* @title assignment incompatible references when accessing
* public method
*/
public void testVFE9() {
//@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_23
//@uses dot.junit.opcodes.invoke_super.d.TSuper
- //@uses dot.junit.opcodes.invoke_super.d.TSuper2
+ //@uses dot.junit.opcodes.invoke_super.d.TSuper2
try {
Class.forName("dot.junit.opcodes.invoke_super.d.T_invoke_super_23");
fail("expected a verification exception");
@@ -216,103 +221,78 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call static method. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call static method.
*/
public void testVFE10() {
//@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_5
//@uses dot.junit.opcodes.invoke_super.d.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_super.d.T_invoke_super_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_5().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
-
+
+
/**
* @constraint n/a
- * @title Attempt to invoke non-existing method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke non-existing method.
*/
public void testVFE12() {
try {
- Class.forName("dot.junit.opcodes.invoke_super.d.T_invoke_super_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_15().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to invoke private method of other class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke private method of other class.
*/
public void testVFE13() {
//@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_18
//@uses dot.junit.opcodes.invoke_super.TestStubs
try {
- Class.forName("dot.junit.opcodes.invoke_super.d.T_invoke_super_18");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_18().run(new TestStubs());
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint B12
- * @title Attempt to invoke protected method of unrelated class. Java throws
- * IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke protected method of unrelated class.
*/
public void testVFE14() {
//@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_20
//@uses dot.junit.opcodes.invoke_super.TestStubs
try {
- Class.forName("dot.junit.opcodes.invoke_super.d.T_invoke_super_20");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_20().run(new TestStubs());
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Method has different signature. Java throws
- * NoSuchMethodError on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_19
//@uses dot.junit.opcodes.invoke_super.d.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_super.d.T_invoke_super_19");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_19().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
- * @constraint n/a
- * @title invoke-super shall be used to invoke private methods
- */
- public void testVFE16() {
- //@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_13
- //@uses dot.junit.opcodes.invoke_super.d.TSuper
- try {
- Class.forName("dot.junit.opcodes.invoke_super.d.T_invoke_super_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
- }
- }
-
- /**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE17() {
@@ -325,7 +305,7 @@
}
/**
- * @constraint A13
+ * @constraint A13
* @title attempt to invoke interface method
*/
public void testVFE18() {
@@ -336,10 +316,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B6
- * @title instance methods may only be invoked on already initialized instances.
+ * @constraint B6
+ * @title instance methods may only be invoked on already initialized instances.
*/
public void testVFE19() {
//@uses dot.junit.opcodes.invoke_super.d.T_invoke_super_25
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/TSuper.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/TSuper.java
new file mode 100644
index 0000000..7767485
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/TSuper.java
@@ -0,0 +1,49 @@
+/*
+ * 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.invoke_super.d;
+
+public class TSuper {
+
+ public int toInt() {
+ return 0;
+ }
+
+ public int toInt(float f) {
+ return 0;
+ }
+
+ public native int toIntNative();
+
+ public static int toIntStatic() {
+ return 0;
+ }
+
+ protected int toIntP() {
+ return 0;
+ }
+
+ private int toIntPvt() {
+ return 0;
+ }
+
+ public int testArgsOrder(int arg1, int arg2) {
+ return 0;
+ }
+
+ public void testString(String s) {
+ }
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_15.java
index d01314b..f3e30f8 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_super_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_18.java
similarity index 72%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_18.java
index d01314b..9c256a2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_18.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super.d;
+import dot.junit.opcodes.invoke_super.TestStubs;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_super_18 {
+ public void run(TestStubs stubs) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_19.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_19.java
index d01314b..15256e1 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_19.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_super_19 extends TSuper {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_20.java
similarity index 72%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_20.java
index d01314b..2ae592e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_20.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super.d;
+import dot.junit.opcodes.invoke_super.TestStubs;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_super_20 {
+ public void run(TestStubs stubs) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_5.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_5.java
index d01314b..c633829 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super/d/T_invoke_super_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_super_5 extends TSuper {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/Test_invoke_super_range.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/Test_invoke_super_range.java
index 7797474..7bee936 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/Test_invoke_super_range.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/Test_invoke_super_range.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_1;
+import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_10;
import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_14;
+import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_15;
import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_17;
+import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_18;
+import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_19;
import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_2;
+import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_20;
import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_4;
+import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_5;
import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_6;
import dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_7;
@@ -37,7 +43,7 @@
T_invoke_super_range_1 t = new T_invoke_super_range_1();
assertEquals(5, t.run());
}
-
+
/**
* @title Invoke protected method of superclass
@@ -65,7 +71,7 @@
*/
public void testN6() {
//@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_17
- //@uses dot.junit.opcodes.invoke_super_range.d.TSuper
+ //@uses dot.junit.opcodes.invoke_super_range.d.TSuper
//@uses dot.junit.opcodes.invoke_super_range.d.TSuper2
T_invoke_super_range_17 t = new T_invoke_super_range_17();
assertEquals(5, t.run());
@@ -91,7 +97,7 @@
*/
public void testE2() {
//@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_4
- //@uses dot.junit.opcodes.invoke_super_range.d.TSuper
+ //@uses dot.junit.opcodes.invoke_super_range.d.TSuper
T_invoke_super_range_4 t = new T_invoke_super_range_4();
try {
t.run();
@@ -117,7 +123,7 @@
}
/**
- * @constraint A14
+ * @constraint A14
* @title invalid constant pool index
*/
public void testVFE1() {
@@ -130,20 +136,19 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <clinit> may not be called using invoke-super
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_range_10().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
/**
- * @constraint B1
+ * @constraint B1
* @title number of arguments passed to method
*/
public void testVFE4() {
@@ -156,12 +161,12 @@
}
/**
- * @constraint B9
+ * @constraint B9
* @title types of arguments passed to method.
*/
public void testVFE5() {
//@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_12
- //@uses dot.junit.opcodes.invoke_super_range.d.TSuper
+ //@uses dot.junit.opcodes.invoke_super_range.d.TSuper
try {
Class.forName("dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_12");
fail("expected a verification exception");
@@ -171,7 +176,7 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <init> may not be called using invoke_super_range
*/
public void testVFE6() {
@@ -184,7 +189,7 @@
}
/**
- * @constraint B10
+ * @constraint B10
* @title assignment incompatible references when accessing
* protected method
*/
@@ -201,14 +206,14 @@
}
/**
- * @constraint B10
+ * @constraint B10
* @title assignment incompatible references when accessing
* public method
*/
public void testVFE9() {
//@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_23
//@uses dot.junit.opcodes.invoke_super_range.d.TSuper
- //@uses dot.junit.opcodes.invoke_super_range.d.TSuper2
+ //@uses dot.junit.opcodes.invoke_super_range.d.TSuper2
try {
Class.forName("dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_23");
fail("expected a verification exception");
@@ -216,103 +221,78 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call static method. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call static method.
*/
public void testVFE10() {
//@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_5
//@uses dot.junit.opcodes.invoke_super_range.d.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_range_5().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
-
+
+
/**
* @constraint n/a
- * @title Attempt to invoke non-existing method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke non-existing method.
*/
public void testVFE12() {
try {
- Class.forName("dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_range_15().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to invoke private method of other class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke private method of other class.
*/
public void testVFE13() {
//@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_18
//@uses dot.junit.opcodes.invoke_super_range.TestStubs
try {
- Class.forName("dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_18");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_range_18().run(new TestStubs());
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint B12
- * @title Attempt to invoke protected method of unrelated class. Java throws
- * IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke protected method of unrelated class.
*/
public void testVFE14() {
//@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_20
//@uses dot.junit.opcodes.invoke_super_range.TestStubs
try {
- Class.forName("dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_20");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_range_20().run(new TestStubs());
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Method has different signature. Java throws
- * NoSuchMethodError on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_19
//@uses dot.junit.opcodes.invoke_super_range.d.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_19");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_super_range_19().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
- * @constraint n/a
- * @title invoke-super/range shall be used to invoke private methods
- */
- public void testVFE16() {
- //@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_13
- //@uses dot.junit.opcodes.invoke_super_range.d.TSuper
- try {
- Class.forName("dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
- }
- }
-
- /**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE17() {
@@ -323,9 +303,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A14
+ * @constraint A14
* @title attempt to invoke interface method
*/
public void testVFE18() {
@@ -336,10 +316,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B6
- * @title instance methods may only be invoked on already initialized instances.
+ * @constraint B6
+ * @title instance methods may only be invoked on already initialized instances.
*/
public void testVFE19() {
//@uses dot.junit.opcodes.invoke_super_range.d.T_invoke_super_range_25
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/TSuper.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/TSuper.java
new file mode 100644
index 0000000..004b573
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/TSuper.java
@@ -0,0 +1,49 @@
+/*
+ * 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.invoke_super_range.d;
+
+public class TSuper {
+
+ public int toInt() {
+ return 0;
+ }
+
+ public int toInt(float f) {
+ return 0;
+ }
+
+ public native int toIntNative();
+
+ public static int toIntStatic() {
+ return 0;
+ }
+
+ protected int toIntP() {
+ return 0;
+ }
+
+ private int toIntPvt() {
+ return 0;
+ }
+
+ public int testArgsOrder(int arg1, int arg2) {
+ return 0;
+ }
+
+ public void testString(String s) {
+ }
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_15.java
similarity index 78%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_15.java
index d01314b..dfd335a 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super_range.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_super_range_15 extends TSuper {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_18.java
similarity index 70%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_18.java
index d01314b..fec68ae 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_18.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super_range.d;
+import dot.junit.opcodes.invoke_super_range.TestStubs;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_super_range_18 {
+ public void run(TestStubs stubs) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_19.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_19.java
index d01314b..d359454 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_19.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super_range.d;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_super_range_19 {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_20.java
similarity index 70%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_20.java
index d01314b..2e9724c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_20.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super_range.d;
+import dot.junit.opcodes.invoke_super_range.TestStubs;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_super_range_20 {
+ public void run(TestStubs stubs) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_5.java
similarity index 78%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_5.java
index d01314b..aa448e6 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_super_range/d/T_invoke_super_range_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_super_range.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_super_range_5 extends TSuper {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/Test_invoke_virtual.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/Test_invoke_virtual.java
index 96a3f64..70e9f9e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/Test_invoke_virtual.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/Test_invoke_virtual.java
@@ -19,9 +19,15 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_1;
+import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_10;
import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_14;
+import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_15;
import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_17;
+import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_18;
+import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_19;
+import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_20;
import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_4;
+import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_5;
import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_6;
import dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_7;
@@ -66,7 +72,7 @@
*/
public void testN6() {
//@uses dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_17
- //@uses dot.junit.opcodes.invoke_virtual.d.TSuper
+ //@uses dot.junit.opcodes.invoke_virtual.d.TSuper
T_invoke_virtual_17 t = new T_invoke_virtual_17();
assertEquals(5, t.run());
}
@@ -114,7 +120,7 @@
}
/**
- * @constraint A13
+ * @constraint A13
* @title invalid constant pool index
*/
public void testVFE1() {
@@ -127,20 +133,19 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <clinit> may not be called using invoke-virtual
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_10().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
/**
- * @constraint B1
+ * @constraint B1
* @title number of arguments passed to method
*/
public void testVFE4() {
@@ -153,7 +158,7 @@
}
/**
- * @constraint B9
+ * @constraint B9
* @title types of arguments passed to method
*/
public void testVFE5() {
@@ -166,7 +171,7 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <init> may not be called using invoke_virtual
*/
public void testVFE6() {
@@ -179,7 +184,7 @@
}
/**
- * @constraint B10
+ * @constraint B10
* @title assignment incompatible references when accessing
* protected method
*/
@@ -196,14 +201,14 @@
}
/**
- * @constraint B10
+ * @constraint B10
* @title assignment incompatible references when accessing
* public method
*/
public void testVFE9() {
//@uses dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_23
//@uses dot.junit.opcodes.invoke_virtual.d.TSuper
- //@uses dot.junit.opcodes.invoke_virtual.d.TSuper2
+ //@uses dot.junit.opcodes.invoke_virtual.d.TSuper2
try {
Class.forName("dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_23");
fail("expected a verification exception");
@@ -211,100 +216,77 @@
DxUtil.checkVerifyException(t);
}
}
-
-
+
+
/**
* @constraint n/a
- * @title Attempt to call static method. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call static method.
*/
public void testVFE10() {
try {
- Class.forName("dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_5().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
-
+
+
/**
* @constraint n/a
- * @title Attempt to invoke non-existing method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke non-existing method.
*/
public void testVFE12() {
try {
- Class.forName("dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_15().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to invoke private method of other class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke private method of other class.
*/
public void testVFE13() {
//@uses dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_18
//@uses dot.junit.opcodes.invoke_virtual.TestStubs
try {
- Class.forName("dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_18");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_18().run(new TestStubs());
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint B12
- * @title Attempt to invoke protected method of unrelated class. Java throws
- * IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke protected method of unrelated class.
*/
public void testVFE14() {
//@uses dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_20
//@uses dot.junit.opcodes.invoke_virtual.TestStubs
try {
- Class.forName("dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_20");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_20().run(new TestStubs());
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Method has different signature. Java throws
- * NoSuchMethodError on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_19
//@uses dot.junit.opcodes.invoke_virtual.d.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_19");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_19().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
- * @constraint n/a
- * @title invoke-virtual shall be used to invoke private methods
- */
- public void testVFE16() {
- try {
- Class.forName("dot.junit.opcodes.invoke_virtual.d.T_invoke_virtual_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
- }
- }
-
- /**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE17() {
@@ -315,9 +297,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A13
+ * @constraint A13
* @title attempt to invoke interface method
*/
public void testVFE18() {
@@ -328,10 +310,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B6
- * @title instance methods may only be invoked on already initialized instances.
+ * @constraint B6
+ * @title instance methods may only be invoked on already initialized instances.
*/
public void testVFE19() {
try {
@@ -341,5 +323,5 @@
DxUtil.checkVerifyException(t);
}
}
-
+
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/TSuper.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/TSuper.java
new file mode 100644
index 0000000..eb0b27a
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/TSuper.java
@@ -0,0 +1,46 @@
+/*
+ * 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.invoke_virtual.d;
+
+public class TSuper {
+
+ public int toInt() {
+ return 0;
+ }
+
+ public int toInt(float value) {
+ return 0;
+ }
+
+ public native int toIntNative();
+
+ public static int toIntStatic() {
+ return 0;
+ }
+
+ protected int toIntP() {
+ return 0;
+ }
+
+ private int toIntPvt() {
+ return 0;
+ }
+
+ public int testArgsOrder(int arg1, int arg2) {
+ return 0;
+ }
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_15.java
similarity index 78%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_15.java
index d01314b..a3d1b68 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_virtual_15 {
public void run() {
}
+ public void test() {
+ }
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_18.java
similarity index 71%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_18.java
index d01314b..c6b0c6f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_18.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual.d;
+import dot.junit.opcodes.invoke_virtual.TestStubs;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_virtual_18 {
+ public void run(TestStubs stub) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_19.java
similarity index 74%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_19.java
index d01314b..36e3515 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_19.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_virtual_19 extends TSuper {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_20.java
similarity index 71%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_20.java
index d01314b..0954ddb 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_20.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual.d;
+import dot.junit.opcodes.invoke_virtual.TestStubs;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_virtual_20 {
+ public void run(TestStubs stub) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_5.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_5.java
index d01314b..a2e32f8 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual/d/T_invoke_virtual_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_virtual_5 {
+ public static void test() {
+ }
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/Test_invoke_virtual_range.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/Test_invoke_virtual_range.java
index 4281069..4f91ba8 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/Test_invoke_virtual_range.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/Test_invoke_virtual_range.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_1;
+import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_10;
import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_14;
+import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_15;
import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_17;
+import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_18;
+import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_19;
import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_2;
+import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_20;
import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_4;
+import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_5;
import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_6;
import dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_7;
@@ -67,11 +73,11 @@
*/
public void testN6() {
//@uses dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_17
- //@uses dot.junit.opcodes.invoke_virtual_range.d.TSuper
+ //@uses dot.junit.opcodes.invoke_virtual_range.d.TSuper
T_invoke_virtual_range_17 t = new T_invoke_virtual_range_17();
assertEquals(5, t.run());
}
-
+
/**
* @title Big number of arguments
*/
@@ -123,7 +129,7 @@
}
/**
- * @constraint A14
+ * @constraint A14
* @title invalid constant pool index
*/
public void testVFE1() {
@@ -136,20 +142,19 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <clinit> may not be called using invoke-virtual
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_range_10().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
/**
- * @constraint B1
+ * @constraint B1
* @title number of arguments passed to method
*/
public void testVFE4() {
@@ -162,7 +167,7 @@
}
/**
- * @constraint B9
+ * @constraint B9
* @title types of arguments passed to method
*/
public void testVFE5() {
@@ -175,7 +180,7 @@
}
/**
- * @constraint A15
+ * @constraint A15
* @title <init> may not be called using invoke_virtual_range
*/
public void testVFE6() {
@@ -188,7 +193,7 @@
}
/**
- * @constraint B10
+ * @constraint B10
* @title assignment incompatible references when accessing
* protected method
*/
@@ -205,14 +210,14 @@
}
/**
- * @constraint B10
+ * @constraint B10
* @title assignment incompatible references when accessing
* public method
*/
public void testVFE9() {
//@uses dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_23
//@uses dot.junit.opcodes.invoke_virtual_range.d.TSuper
- //@uses dot.junit.opcodes.invoke_virtual_range.d.TSuper2
+ //@uses dot.junit.opcodes.invoke_virtual_range.d.TSuper2
try {
Class.forName("dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_23");
fail("expected a verification exception");
@@ -220,99 +225,76 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to call static method. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to call static method.
*/
public void testVFE10() {
try {
- Class.forName("dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_range_5().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
-
+
+
/**
* @constraint n/a
- * @title Attempt to invoke non-existing method. Java throws NoSuchMethodError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke non-existing method.
*/
public void testVFE12() {
try {
- Class.forName("dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_range_15().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to invoke private method of other class. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke private method of other class.
*/
public void testVFE13() {
//@uses dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_18
//@uses dot.junit.opcodes.invoke_virtual_range.TestStubs
try {
- Class.forName("dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_18");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_range_18().run(new TestStubs());
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint B12
- * @title Attempt to invoke protected method of unrelated class. Java throws
- * IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to invoke protected method of unrelated class.
*/
public void testVFE14() {
//@uses dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_20
//@uses dot.junit.opcodes.invoke_virtual_range.TestStubs
try {
- Class.forName("dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_20");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_range_20().run(new TestStubs());
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Method has different signature. Java throws
- * NoSuchMethodError on first access but Dalvik throws VerifyError on class loading.
+ * @title Method has different signature.
*/
public void testVFE15() {
//@uses dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_19
//@uses dot.junit.opcodes.invoke_virtual_range.d.TSuper
try {
- Class.forName("dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_19");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_invoke_virtual_range_19().run();
+ fail("expected NoSuchMethodError");
+ } catch (NoSuchMethodError t) {
}
}
-
+
/**
- * @constraint n/a
- * @title invoke-virtual/range shall be used to invoke private methods
- */
- public void testVFE16() {
- try {
- Class.forName("dot.junit.opcodes.invoke_virtual_range.d.T_invoke_virtual_range_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
- }
- }
-
- /**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE17() {
@@ -323,9 +305,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A14
+ * @constraint A14
* @title attempt to invoke interface method
*/
public void testVFE18() {
@@ -336,10 +318,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B6
- * @title instance methods may only be invoked on already initialized instances.
+ * @constraint B6
+ * @title instance methods may only be invoked on already initialized instances.
*/
public void testVFE19() {
try {
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/Snippet.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/Snippet.java
new file mode 100644
index 0000000..14c735e
--- /dev/null
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/Snippet.java
@@ -0,0 +1,7 @@
+package dot.junit.opcodes.invoke_virtual_range.d;
+
+public class Snippet {
+ public void test() {
+ }
+}
+
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_15.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_15.java
index d01314b..969a1ab 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual_range.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_virtual_range_15 {
public void run() {
}
+ public void test() {
+ }
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_18.java
similarity index 70%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_18.java
index d01314b..8f01c30 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_18.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual_range.d;
+import dot.junit.opcodes.invoke_virtual_range.TestStubs;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_virtual_range_18 {
+ public void run(TestStubs stubs) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_19.java
similarity index 75%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_19.java
index d01314b..fefa96d 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_19.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual_range.d;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_virtual_range_19 {
+ public int run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_20.java
similarity index 70%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_20.java
index d01314b..77c639d 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_20.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual_range.d;
+import dot.junit.opcodes.invoke_virtual_range.TestStubs;
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_invoke_virtual_range_20 {
+ public void run(TestStubs stubs) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_5.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_5.java
index d01314b..b14ffb7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/invoke_virtual_range/d/T_invoke_virtual_range_5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.invoke_virtual_range.d;
-
-public class T_invoke_interface_17 {
-
+public class T_invoke_virtual_range_5 {
+ public static void test() {
+ }
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iput/Test_iput.java b/tools/vm-tests/src/dot/junit/opcodes/iput/Test_iput.java
index 7a83f26..f69b308 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iput/Test_iput.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput/Test_iput.java
@@ -19,12 +19,18 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.iput.d.T_iput_1;
+import dot.junit.opcodes.iput.d.T_iput_10;
import dot.junit.opcodes.iput.d.T_iput_11;
import dot.junit.opcodes.iput.d.T_iput_12;
import dot.junit.opcodes.iput.d.T_iput_13;
import dot.junit.opcodes.iput.d.T_iput_14;
+import dot.junit.opcodes.iput.d.T_iput_15;
+import dot.junit.opcodes.iput.d.T_iput_17;
import dot.junit.opcodes.iput.d.T_iput_19;
import dot.junit.opcodes.iput.d.T_iput_5;
+import dot.junit.opcodes.iput.d.T_iput_7;
+import dot.junit.opcodes.iput.d.T_iput_8;
+import dot.junit.opcodes.iput.d.T_iput_9;
public class Test_iput extends DxTestCase {
@@ -48,7 +54,7 @@
assertEquals(3.14f, t.st_f1);
}
-
+
/**
* @title modification of final field
*/
@@ -72,8 +78,8 @@
}
/**
- * @title Trying to put float into integer field. Dalvik doens't distinguish 32-bits types
- * internally, so this operation makes no sense but shall not crash the VM.
+ * @title Trying to put float into integer field. Dalvik doens't distinguish 32-bits types
+ * internally, so this operation makes no sense but shall not crash the VM.
*/
public void testN6() {
T_iput_5 t = new T_iput_5();
@@ -83,7 +89,7 @@
}
}
-
+
/**
* @title expected NullPointerException
*/
@@ -98,7 +104,7 @@
}
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -111,8 +117,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -126,24 +132,24 @@
/**
- *
- * @constraint B14
- * @title put integer into long field - only field with same name but
+ *
+ * @constraint B14
+ * @title put integer into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iput.d.T_iput_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
+ new T_iput_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
DxUtil.checkVerifyException(t);
}
}
/**
- *
- * @constraint B14
- * @title type of field doesn't match opcode - attempt to modify double field
+ *
+ * @constraint B14
+ * @title type of field doesn't match opcode - attempt to modify double field
* with single-width register
*/
public void testVFE7() {
@@ -154,86 +160,77 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A11
- * @title Attempt to set static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @constraint A11
+ * @title Attempt to set static field.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.iput.d.T_iput_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_7().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint B12
- * @title Attempt to modify inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify inaccessible protected field.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.iput.TestStubs
//@uses dot.junit.opcodes.iput.d.T_iput_8
try {
- Class.forName("dot.junit.opcodes.iput.d.T_iput_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_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.iput.d.T_iput_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_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.iput.d.T_iput_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_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.iput.d.T_iput_1
//@uses dot.junit.opcodes.iput.d.T_iput_15
try {
- Class.forName("dot.junit.opcodes.iput.d.T_iput_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
+ new T_iput_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
DxUtil.checkVerifyException(t);
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title iput shall not work for wide numbers
*/
public void testVFE13() {
@@ -244,10 +241,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput shall not work for reference fields
*/
public void testVFE14() {
@@ -258,10 +255,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput shall not work for short fields
*/
public void testVFE15() {
@@ -272,10 +269,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput shall not work for boolean fields
*/
public void testVFE16() {
@@ -286,10 +283,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput shall not work for char fields
*/
public void testVFE17() {
@@ -300,10 +297,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput shall not work for byte fields
*/
public void testVFE18() {
@@ -314,11 +311,11 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
try {
@@ -328,7 +325,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -337,10 +334,9 @@
//@uses dot.junit.opcodes.iput.TestStubs
//@uses dot.junit.opcodes.iput.d.T_iput_11
try {
- Class.forName("dot.junit.opcodes.iput.d.T_iput_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_10.java
index d01314b..4f630e7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_15.java
index d01314b..f432d27 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_17.java
index d01314b..0c1bb0c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_7.java
index d01314b..c7407e0 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_8.java
index d01314b..264aef0 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_9.java
index d01314b..a3c1695 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput/d/T_iput_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/Test_iput_boolean.java b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/Test_iput_boolean.java
index cb51be8..6a2419b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/Test_iput_boolean.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/Test_iput_boolean.java
@@ -19,16 +19,22 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_1;
+import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_10;
import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_11;
import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_12;
import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_13;
import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_14;
+import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_15;
+import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_17;
+import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_7;
+import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_8;
+import dot.junit.opcodes.iput_boolean.d.T_iput_boolean_9;
public class Test_iput_boolean extends DxTestCase {
/**
- * @title put boolean into field
+ * @title put boolean into field
*/
public void testN1() {
T_iput_boolean_1 t = new T_iput_boolean_1();
@@ -37,7 +43,7 @@
assertEquals(true, t.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -59,8 +65,8 @@
t.run();
assertEquals(true, t.getProtectedField());
}
-
-
+
+
/**
* @title expected NullPointerException
@@ -76,7 +82,7 @@
}
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -89,7 +95,7 @@
}
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -103,21 +109,20 @@
/**
- * @constraint B14
- * @title put boolean into long field - only field with same name but
+ * @constraint B14
+ * @title put boolean into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iput_boolean.d.T_iput_boolean_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_boolean_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
- *
+ *
* @constraint B14
* @title put value '2' into boolean field
*/
@@ -131,9 +136,9 @@
}
/**
- *
+ *
* @constraint B14
- * @title type of field doesn't match opcode - attempt to modify double
+ * @title type of field doesn't match opcode - attempt to modify double
* field with single-width register
*/
public void testVFE7() {
@@ -144,87 +149,77 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint A11
- * @title Attempt to set static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ *
+ * @constraint A11
+ * @title Attempt to set static field.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.iput_boolean.d.T_iput_boolean_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_boolean_7().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint B12
- * @title Attempt to modify inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify inaccessible protected field.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.iput_boolean.TestStubs
//@uses dot.junit.opcodes.iput_boolean.d.T_iput_boolean_8
try {
- Class.forName("dot.junit.opcodes.iput_boolean.d.T_iput_boolean_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_boolean_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.iput_boolean.d.T_iput_boolean_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_boolean_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.iput_boolean.d.T_iput_boolean_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_boolean_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.iput_boolean.d.T_iput_boolean_1
//@uses dot.junit.opcodes.iput_boolean.d.T_iput_boolean_15
try {
- Class.forName("dot.junit.opcodes.iput_boolean.d.T_iput_boolean_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_boolean_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title iput_boolean shall not work for wide numbers
*/
public void testVFE13() {
@@ -235,10 +230,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput_boolean shall not work for reference fields
*/
public void testVFE14() {
@@ -249,10 +244,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput_boolean shall not work for short fields
*/
public void testVFE15() {
@@ -263,10 +258,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput_boolean shall not work for int fields
*/
public void testVFE16() {
@@ -277,9 +272,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iput_boolean shall not work for char fields
*/
public void testVFE17() {
@@ -290,9 +285,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title iput_boolean shall not work for byte fields
*/
public void testVFE18() {
@@ -305,8 +300,8 @@
}
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
try {
@@ -316,7 +311,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -325,10 +320,9 @@
//@uses dot.junit.opcodes.iput_boolean.TestStubs
//@uses dot.junit.opcodes.iput_boolean.d.T_iput_boolean_11
try {
- Class.forName("dot.junit.opcodes.iput_boolean.d.T_iput_boolean_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_boolean_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_10.java
index d01314b..7279fe0 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_boolean_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_15.java
index d01314b..893595b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_boolean_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_17.java
index d01314b..c7dbaeb 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_boolean_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_7.java
index d01314b..c48328e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_boolean_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_8.d b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_8.d
index 8d69496..ce16612 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_8.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_8.d
@@ -27,8 +27,8 @@
.method public run()V
.limit regs 3
- new-instance v0, Ldot/junit/opcodes/iput/TestStubs;
- invoke-direct {v0}, dot/junit/opcodes/iput/TestStubs/<init>()V
+ new-instance v0, Ldot/junit/opcodes/iput_boolean/TestStubs;
+ invoke-direct {v0}, dot/junit/opcodes/iput_boolean/TestStubs/<init>()V
const v1, 0
iput-boolean v1, v0, dot.junit.opcodes.iput_boolean.TestStubs.TestStubField Z
return-void
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_8.java
index d01314b..6706b11 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_boolean_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_9.java
index d01314b..86c2fbf 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_boolean/d/T_iput_boolean_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_boolean_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iput_byte/Test_iput_byte.java b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/Test_iput_byte.java
index 9fb87f5..f67e22b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iput_byte/Test_iput_byte.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/Test_iput_byte.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.iput_byte.d.T_iput_byte_1;
+import dot.junit.opcodes.iput_byte.d.T_iput_byte_10;
import dot.junit.opcodes.iput_byte.d.T_iput_byte_11;
import dot.junit.opcodes.iput_byte.d.T_iput_byte_12;
import dot.junit.opcodes.iput_byte.d.T_iput_byte_13;
import dot.junit.opcodes.iput_byte.d.T_iput_byte_14;
+import dot.junit.opcodes.iput_byte.d.T_iput_byte_15;
+import dot.junit.opcodes.iput_byte.d.T_iput_byte_17;
+import dot.junit.opcodes.iput_byte.d.T_iput_byte_7;
+import dot.junit.opcodes.iput_byte.d.T_iput_byte_8;
+import dot.junit.opcodes.iput_byte.d.T_iput_byte_9;
public class Test_iput_byte extends DxTestCase {
/**
@@ -35,7 +41,7 @@
assertEquals(77, t.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -57,7 +63,7 @@
t.run();
assertEquals(77, t.getProtectedField());
}
-
+
/**
* @title expected NullPointerException
*/
@@ -72,7 +78,7 @@
}
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -85,8 +91,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -100,23 +106,22 @@
/**
- *
- * @constraint B14
- * @title put byte into long field - only field with same name but
+ *
+ * @constraint B14
+ * @title put byte into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iput_byte.d.T_iput_byte_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_byte_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
- *
- * @constraint B14
+ *
+ * @constraint B14
* @title put value '256' into byte field
*/
public void testVFE6() {
@@ -129,9 +134,9 @@
}
/**
- *
- * @constraint B14
- * @title type of field doesn't match opcode - attempt to modify double
+ *
+ * @constraint B14
+ * @title type of field doesn't match opcode - attempt to modify double
* field with single-width register
*/
public void testVFE7() {
@@ -142,87 +147,77 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint A11
- * @title Attempt to set static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ *
+ * @constraint A11
+ * @title Attempt to set static field.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.iput_byte.d.T_iput_byte_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_byte_7().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint B12
- * @title Attempt to modify inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify inaccessible protected field.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.iput_byte.TestStubs
//@uses dot.junit.opcodes.iput_byte.d.T_iput_byte_8
try {
- Class.forName("dot.junit.opcodes.iput_byte.d.T_iput_byte_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_byte_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.iput_byte.d.T_iput_byte_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_byte_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.iput_byte.d.T_iput_byte_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_byte_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.iput_byte.d.T_iput_byte_1
//@uses dot.junit.opcodes.iput_byte.d.T_iput_byte_15
try {
- Class.forName("dot.junit.opcodes.iput_byte.d.T_iput_byte_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_byte_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title iput-byte shall not work for wide numbers
*/
public void testVFE13() {
@@ -233,10 +228,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-byte shall not work for reference fields
*/
public void testVFE14() {
@@ -247,10 +242,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-byte shall not work for short fields
*/
public void testVFE15() {
@@ -261,10 +256,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-byte shall not work for int fields
*/
public void testVFE16() {
@@ -275,10 +270,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-byte shall not work for char fields
*/
public void testVFE17() {
@@ -289,10 +284,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-byte shall not work for boolean fields
*/
public void testVFE18() {
@@ -306,8 +301,8 @@
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
try {
@@ -317,7 +312,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -326,10 +321,9 @@
//@uses dot.junit.opcodes.iput_byte.TestStubs
//@uses dot.junit.opcodes.iput_byte.d.T_iput_byte_11
try {
- Class.forName("dot.junit.opcodes.iput_byte.d.T_iput_byte_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_byte_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_10.java
index d01314b..f7278f2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_byte_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_15.java
index d01314b..249926f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_byte_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_17.java
index d01314b..6eca2a9 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_byte_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_7.java
index d01314b..3ff9a3f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_byte_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_8.java
index d01314b..8a29bb2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_byte_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_9.java
index d01314b..37f7a6d 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_byte/d/T_iput_byte_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_byte_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iput_char/Test_iput_char.java b/tools/vm-tests/src/dot/junit/opcodes/iput_char/Test_iput_char.java
index 7674c21..f3a4f9e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iput_char/Test_iput_char.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_char/Test_iput_char.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.iput_char.d.T_iput_char_1;
+import dot.junit.opcodes.iput_char.d.T_iput_char_10;
import dot.junit.opcodes.iput_char.d.T_iput_char_11;
import dot.junit.opcodes.iput_char.d.T_iput_char_12;
import dot.junit.opcodes.iput_char.d.T_iput_char_13;
import dot.junit.opcodes.iput_char.d.T_iput_char_14;
+import dot.junit.opcodes.iput_char.d.T_iput_char_15;
+import dot.junit.opcodes.iput_char.d.T_iput_char_17;
+import dot.junit.opcodes.iput_char.d.T_iput_char_7;
+import dot.junit.opcodes.iput_char.d.T_iput_char_8;
+import dot.junit.opcodes.iput_char.d.T_iput_char_9;
public class Test_iput_char extends DxTestCase {
/**
@@ -35,7 +41,7 @@
assertEquals(77, t.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -57,7 +63,7 @@
t.run();
assertEquals(77, t.getProtectedField());
}
-
+
/**
* @title expected NullPointerException
*/
@@ -70,10 +76,10 @@
// expected
}
}
-
-
+
+
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -86,7 +92,7 @@
}
/**
- *
+ *
* @constraint A23
* @title number of registers
*/
@@ -101,23 +107,22 @@
/**
- *
- * @constraint B14
- * @title put char into long field - only field with same name but
+ *
+ * @constraint B14
+ * @title put char into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iput_char.d.T_iput_char_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_char_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
- *
- * @constraint B14
+ *
+ * @constraint B14
* @title put value '66000' into byte field
*/
public void testVFE6() {
@@ -130,9 +135,9 @@
}
/**
- *
- * @constraint B14
- * @title type of field doesn't match opcode - attempt to modify double
+ *
+ * @constraint B14
+ * @title type of field doesn't match opcode - attempt to modify double
* field with single-width register
*/
public void testVFE7() {
@@ -143,88 +148,78 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint A11
- * @title Attempt to set static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ *
+ * @constraint A11
+ * @title Attempt to set static field.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.iput_char.d.T_iput_char_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_char_7().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint B12
- * @title Attempt to modify inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify inaccessible protected field.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.iput_char.TestStubs
//@uses dot.junit.opcodes.iput_char.d.T_iput_char_8
try {
- Class.forName("dot.junit.opcodes.iput_char.d.T_iput_char_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_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.iput_char.d.T_iput_char_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_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.iput_char.d.T_iput_char_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_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.iput_char.d.T_iput_char_1
//@uses dot.junit.opcodes.iput_char.d.T_iput_char_15
try {
- Class.forName("dot.junit.opcodes.iput_char.d.T_iput_char_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_char_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title iput-char shall not work for wide numbers
*/
public void testVFE13() {
@@ -235,10 +230,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-char shall not work for reference fields
*/
public void testVFE14() {
@@ -249,10 +244,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-char shall not work for short fields
*/
public void testVFE15() {
@@ -263,10 +258,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-char shall not work for int fields
*/
public void testVFE16() {
@@ -277,10 +272,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-char shall not work for byte fields
*/
public void testVFE17() {
@@ -291,10 +286,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-char shall not work for boolean fields
*/
public void testVFE18() {
@@ -308,8 +303,8 @@
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
try {
@@ -319,7 +314,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -328,10 +323,9 @@
//@uses dot.junit.opcodes.iput_char.TestStubs
//@uses dot.junit.opcodes.iput_char.d.T_iput_char_11
try {
- Class.forName("dot.junit.opcodes.iput_char.d.T_iput_char_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_char_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_10.java
index d01314b..2e2c554 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_char_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_15.java
index d01314b..9419df4 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_char_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_17.java
index d01314b..41d3dfb 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_char_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_7.java
index d01314b..4e148d7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_char_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_8.java
index d01314b..186ce0b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_char_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_9.java
index d01314b..3cb3667 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_char/d/T_iput_char_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_char_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iput_object/Test_iput_object.java b/tools/vm-tests/src/dot/junit/opcodes/iput_object/Test_iput_object.java
index d0dd8ad..e2f8fa4 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iput_object/Test_iput_object.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_object/Test_iput_object.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.iput_object.d.T_iput_object_1;
+import dot.junit.opcodes.iput_object.d.T_iput_object_10;
import dot.junit.opcodes.iput_object.d.T_iput_object_11;
import dot.junit.opcodes.iput_object.d.T_iput_object_12;
import dot.junit.opcodes.iput_object.d.T_iput_object_13;
import dot.junit.opcodes.iput_object.d.T_iput_object_14;
+import dot.junit.opcodes.iput_object.d.T_iput_object_15;
+import dot.junit.opcodes.iput_object.d.T_iput_object_17;
+import dot.junit.opcodes.iput_object.d.T_iput_object_7;
+import dot.junit.opcodes.iput_object.d.T_iput_object_8;
+import dot.junit.opcodes.iput_object.d.T_iput_object_9;
public class Test_iput_object extends DxTestCase {
/**
@@ -35,7 +41,7 @@
assertEquals(t, t.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -57,7 +63,7 @@
t.run();
assertEquals(t, t.getProtectedField());
}
-
+
/**
* @title expected NullPointerException
*/
@@ -70,10 +76,10 @@
// expected
}
}
-
-
+
+
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -86,8 +92,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -101,25 +107,24 @@
/**
- *
- * @constraint B14
- * @title put object into long field - only field with same name but
+ *
+ * @constraint B14
+ * @title put object into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iput_object.d.T_iput_object_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_object_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
- *
+ *
* @constraint B14
- * @title type of field doesn't match opcode - attempt to modify double
+ * @title type of field doesn't match opcode - attempt to modify double
* field with single-width register
*/
public void testVFE7() {
@@ -130,87 +135,77 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint A11
- * @title Attempt to set non-static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ *
+ * @constraint A11
+ * @title Attempt to set non-static field.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.iput_object.d.T_iput_object_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_object_7().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint B12
- * @title Attempt to modify inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify inaccessible protected field.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.iput_object.TestStubs
//@uses dot.junit.opcodes.iput_object.d.T_iput_object_8
try {
- Class.forName("dot.junit.opcodes.iput_object.d.T_iput_object_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_object_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.iput_object.d.T_iput_object_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_object_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.iput_object.d.T_iput_object_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_object_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.iput_object.d.T_iput_object_1
//@uses dot.junit.opcodes.iput_object.d.T_iput_object_15
try {
- Class.forName("dot.junit.opcodes.iput_object.d.T_iput_object_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_object_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title iput-object shall not work for wide numbers
*/
public void testVFE13() {
@@ -221,10 +216,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B13
+ *
+ * @constraint B13
* @title assignment incompatible references
*/
public void testVFE14() {
@@ -235,10 +230,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-object shall not work for char fields
*/
public void testVFE15() {
@@ -249,10 +244,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-object shall not work for int fields
*/
public void testVFE16() {
@@ -263,10 +258,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-object shall not work for byte fields
*/
public void testVFE17() {
@@ -277,10 +272,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-object shall not work for boolean fields
*/
public void testVFE18() {
@@ -293,8 +288,8 @@
}
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-object shall not work for short fields
*/
public void testVFE6() {
@@ -306,11 +301,11 @@
}
}
-
+
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
try {
@@ -320,7 +315,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -329,10 +324,9 @@
//@uses dot.junit.opcodes.iput_object.TestStubs
//@uses dot.junit.opcodes.iput_object.d.T_iput_object_11
try {
- Class.forName("dot.junit.opcodes.iput_object.d.T_iput_object_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_object_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_10.java
index d01314b..01e9cb6 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_object_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_15.java
index d01314b..84667f8 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_object_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_17.java
index d01314b..6db4b58 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_object_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_7.java
index d01314b..60bba2f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_object_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_8.java
index d01314b..f104e78 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_object_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_9.java
index d01314b..7b53911 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_object/d/T_iput_object_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_object_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iput_short/Test_iput_short.java b/tools/vm-tests/src/dot/junit/opcodes/iput_short/Test_iput_short.java
index d3c44b9..0ea32e5 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iput_short/Test_iput_short.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_short/Test_iput_short.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.iput_short.d.T_iput_short_1;
+import dot.junit.opcodes.iput_short.d.T_iput_short_10;
import dot.junit.opcodes.iput_short.d.T_iput_short_11;
import dot.junit.opcodes.iput_short.d.T_iput_short_12;
import dot.junit.opcodes.iput_short.d.T_iput_short_13;
import dot.junit.opcodes.iput_short.d.T_iput_short_14;
+import dot.junit.opcodes.iput_short.d.T_iput_short_15;
+import dot.junit.opcodes.iput_short.d.T_iput_short_17;
+import dot.junit.opcodes.iput_short.d.T_iput_short_7;
+import dot.junit.opcodes.iput_short.d.T_iput_short_8;
+import dot.junit.opcodes.iput_short.d.T_iput_short_9;
public class Test_iput_short extends DxTestCase {
/**
@@ -35,7 +41,7 @@
assertEquals(77, t.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -57,7 +63,7 @@
t.run();
assertEquals(77, t.getProtectedField());
}
-
+
/**
* @title expected NullPointerException
*/
@@ -70,11 +76,11 @@
// expected
}
}
-
-
+
+
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -87,8 +93,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -102,23 +108,22 @@
/**
- *
- * @constraint B14
- * @title put short into long field - only field with same name but
+ *
+ * @constraint B14
+ * @title put short into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iput_short.d.T_iput_short_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_short_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
- *
- * @constraint B14
+ *
+ * @constraint B14
* @title put value '66000' into byte field
*/
public void testVFE6() {
@@ -131,9 +136,9 @@
}
/**
- *
+ *
* @constraint B14
- * @title type of field doesn't match opcode - attempt to modify double
+ * @title type of field doesn't match opcode - attempt to modify double
* field with single-width register
*/
public void testVFE7() {
@@ -144,87 +149,77 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint A11
- * @title Attempt to set static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ *
+ * @constraint A11
+ * @title Attempt to set static field.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.iput_short.d.T_iput_short_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_short_7().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint B12
- * @title Attempt to modify inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify inaccessible protected field.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.iput_short.TestStubs
//@uses dot.junit.opcodes.iput_short.d.T_iput_short_8
try {
- Class.forName("dot.junit.opcodes.iput_short.d.T_iput_short_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_short_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.iput_short.d.T_iput_short_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_short_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.iput_short.d.T_iput_short_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_short_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.iput_short.d.T_iput_short_1
//@uses dot.junit.opcodes.iput_short.d.T_iput_short_15
try {
- Class.forName("dot.junit.opcodes.iput_short.d.T_iput_short_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_short_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title iput-short shall not work for wide numbers
*/
public void testVFE13() {
@@ -235,10 +230,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-short shall not work for reference fields
*/
public void testVFE14() {
@@ -249,10 +244,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-short shall not work for char fields
*/
public void testVFE15() {
@@ -263,10 +258,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-short shall not work for int fields
*/
public void testVFE16() {
@@ -277,10 +272,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-short shall not work for byte fields
*/
public void testVFE17() {
@@ -291,10 +286,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-short shall not work for boolean fields
*/
public void testVFE18() {
@@ -308,8 +303,8 @@
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
try {
@@ -319,7 +314,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -328,10 +323,9 @@
//@uses dot.junit.opcodes.iput_short.TestStubs
//@uses dot.junit.opcodes.iput_short.d.T_iput_short_11
try {
- Class.forName("dot.junit.opcodes.iput_short.d.T_iput_short_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_short_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_10.java
index d01314b..eb01ab1 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_short_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_15.java
index d01314b..17398b7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_short_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_17.java
index d01314b..b89d34b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_short_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_7.java
index d01314b..6969f12 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_short_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_8.d b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_8.d
index 0fc4550..05b5100 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_8.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_8.d
@@ -27,8 +27,8 @@
.method public run()V
.limit regs 3
- new-instance v0, Ldot/junit/opcodes/iput/TestStubs;
- invoke-direct {v0}, dot/junit/opcodes/iput/TestStubs/<init>()V
+ new-instance v0, Ldot/junit/opcodes/iput_short/TestStubs;
+ invoke-direct {v0}, dot/junit/opcodes/iput_short/TestStubs/<init>()V
const v1, 0
iput-short v1, v0, dot.junit.opcodes.iput_short.TestStubs.TestStubField S
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_8.java
index d01314b..689c54b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_short_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_9.java
index d01314b..7f81b96 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_short/d/T_iput_short_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_short_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/iput_wide/Test_iput_wide.java b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/Test_iput_wide.java
index a0cac2d..a61bb70 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/iput_wide/Test_iput_wide.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/Test_iput_wide.java
@@ -18,16 +18,22 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
-import dot.junit.opcodes.iput_wide.d.T_iput_wide_13;
import dot.junit.opcodes.iput_wide.d.T_iput_wide_1;
+import dot.junit.opcodes.iput_wide.d.T_iput_wide_10;
import dot.junit.opcodes.iput_wide.d.T_iput_wide_11;
import dot.junit.opcodes.iput_wide.d.T_iput_wide_12;
+import dot.junit.opcodes.iput_wide.d.T_iput_wide_13;
import dot.junit.opcodes.iput_wide.d.T_iput_wide_14;
+import dot.junit.opcodes.iput_wide.d.T_iput_wide_15;
+import dot.junit.opcodes.iput_wide.d.T_iput_wide_17;
import dot.junit.opcodes.iput_wide.d.T_iput_wide_5;
+import dot.junit.opcodes.iput_wide.d.T_iput_wide_7;
+import dot.junit.opcodes.iput_wide.d.T_iput_wide_8;
+import dot.junit.opcodes.iput_wide.d.T_iput_wide_9;
public class Test_iput_wide extends DxTestCase {
/**
- * @title put long into field
+ * @title put long into field
*/
public void testN1() {
T_iput_wide_1 t = new T_iput_wide_1();
@@ -35,7 +41,7 @@
t.run();
assertEquals(778899112233l, t.st_i1);
}
-
+
/**
* @title put double into field
*/
@@ -46,7 +52,7 @@
assertEquals(0.5d, t.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -68,7 +74,7 @@
t.run();
assertEquals(77, t.getProtectedField());
}
-
+
/**
* @title expected NullPointerException
*/
@@ -81,11 +87,11 @@
// expected
}
}
-
-
+
+
/**
- * @constraint A11
+ * @constraint A11
* @title constant pool index
*/
public void testVFE1() {
@@ -98,8 +104,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -113,26 +119,25 @@
/**
- *
- * @constraint B14
- * @title put int into long field - only field with same name but
+ *
+ * @constraint B14
+ * @title put int into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.iput_wide.d.T_iput_wide_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_wide_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
-
+
+
/**
- *
+ *
* @constraint B14
- * @title type of field doesn't match opcode - attempt to modify float
+ * @title type of field doesn't match opcode - attempt to modify float
* field with double-width register
*/
public void testVFE7() {
@@ -143,88 +148,78 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint A11
- * @title Attempt to set non-static field. Java throws IncompatibleClassChangeError
- * on first access but Dalvik throws VerifyError on class loading.
+ *
+ * @constraint A11
+ * @title Attempt to set non-static field.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.iput_wide.d.T_iput_wide_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_wide_7().run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError t) {
}
}
-
+
/**
* @constraint B12
- * @title Attempt to modify inaccessible protected field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to modify inaccessible protected field.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.iput_wide.TestStubs
//@uses dot.junit.opcodes.iput_wide.d.T_iput_wide_8
try {
- Class.forName("dot.junit.opcodes.iput_wide.d.T_iput_wide_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_wide_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.iput_wide.d.T_iput_wide_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_wide_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.iput_wide.d.T_iput_wide_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_wide_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.iput_wide.d.T_iput_wide_1
//@uses dot.junit.opcodes.iput_wide.d.T_iput_wide_15
try {
- Class.forName("dot.junit.opcodes.iput_wide.d.T_iput_wide_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_iput_wide_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title iput-wide shall not work for single-width numbers
*/
public void testVFE13() {
@@ -235,10 +230,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-wide shall not work for reference fields
*/
public void testVFE14() {
@@ -249,10 +244,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-wide shall not work for char fields
*/
public void testVFE15() {
@@ -263,10 +258,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-wide shall not work for int fields
*/
public void testVFE16() {
@@ -277,10 +272,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-wide shall not work for byte fields
*/
public void testVFE17() {
@@ -291,10 +286,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-wide shall not work for boolean fields
*/
public void testVFE18() {
@@ -307,8 +302,8 @@
}
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title iput-wide shall not work for short fields
*/
public void testVFE6() {
@@ -319,12 +314,12 @@
DxUtil.checkVerifyException(t);
}
}
-
-
+
+
/**
- * @constraint B6
- * @title instance fields may only be accessed on already initialized instances.
+ * @constraint B6
+ * @title instance fields may only be accessed on already initialized instances.
*/
public void testVFE30() {
try {
@@ -334,7 +329,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -342,11 +337,10 @@
public void testE5() {
//@uses dot.junit.opcodes.iput_wide.TestStubs
//@uses dot.junit.opcodes.iput_wide.d.T_iput_wide_11
- try {
- Class.forName("dot.junit.opcodes.iput_wide.d.T_iput_wide_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ try {
+ new T_iput_wide_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_10.java
index d01314b..9653b55 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_wide_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_15.java
index d01314b..9818c22 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_wide_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_17.java
index d01314b..60c005e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_wide_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_7.java
index d01314b..e476c01 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_wide_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_8.java
index d01314b..dc2e2bf 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_wide_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_9.java
index d01314b..c9d1da2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/iput_wide/d/T_iput_wide_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.iput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_iput_wide_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/new_array/TestStubs.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/new_array/TestStubs.java
index d01314b..587b4d1 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/new_array/TestStubs.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,8 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.new_array;
-
-public class T_invoke_interface_17 {
-
- public void run() {
- }
+// package access to trigger IllegalAccessError in testVFE8
+class TestStubs {
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/new_array/Test_new_array.java b/tools/vm-tests/src/dot/junit/opcodes/new_array/Test_new_array.java
index d474ec1..44aedaa 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/new_array/Test_new_array.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/new_array/Test_new_array.java
@@ -19,16 +19,13 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.new_array.d.T_new_array_1;
+import dot.junit.opcodes.new_array.d.T_new_array_10;
+import dot.junit.opcodes.new_array.d.T_new_array_11;
import dot.junit.opcodes.new_array.d.T_new_array_2;
import dot.junit.opcodes.new_array.d.T_new_array_3;
public class Test_new_array extends DxTestCase {
-
- @SuppressWarnings("unused")
- private class TestStub{
- // used by testVFE8
- }
-
+
/**
* @title Array of ints
*/
@@ -59,7 +56,7 @@
assertFalse(r[i]);
}
}
-
+
/**
* @title Array of Objects
*/
@@ -74,7 +71,7 @@
assertNull(r[i]);
}
}
-
+
/**
* @title Array size = 0
*/
@@ -83,7 +80,7 @@
int[] r = t.run(0);
assertNotNull(r);
assertEquals(0, r.length);
- }
+ }
/**
* @title expected NegativeArraySizeException
@@ -97,10 +94,10 @@
// expected
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title number of registers
*/
public void testVFE1() {
@@ -113,8 +110,8 @@
}
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title size argument - long
*/
public void testVFE2() {
@@ -125,9 +122,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
+ *
* @constraint B1
* @title size argument - reference
*/
@@ -141,8 +138,8 @@
}
/**
- *
- * @constraint A19
+ *
+ * @constraint A19
* @title constant pool index
*/
public void testVFE4() {
@@ -155,8 +152,8 @@
}
/**
- *
- * @constraint A22
+ *
+ * @constraint A22
* @title attempt to create object
*/
public void testVFE5() {
@@ -167,10 +164,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint A20
+ *
+ * @constraint A20
* @title array of more than 255 dimensions
*/
public void testVFE6() {
@@ -181,33 +178,30 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to instantiate array of non-existent class. Java
- * throws NoClassDefFoundError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to instantiate array of non-existent class.
*/
public void testVFE7() {
try {
- Class.forName("dot.junit.opcodes.new_array.d.T_new_array_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_new_array_11().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to instantiate array of inaccessible class. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to instantiate array of inaccessible class.
*/
public void testVFE8() {
+ //@uses dot.junit.opcodes.new_array.TestStubs
try {
- Class.forName("dot.junit.opcodes.new_array.d.T_new_array_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_new_array_10().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_10.d b/tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_10.d
index bcd570b..4c99085 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_10.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_10.d
@@ -28,7 +28,7 @@
.limit regs 5
const v0, 3
- new-array v0, v0, [Ldot/junit/opcodes/new_array/Test_new_array$TestStub;
+ new-array v0, v0, [Ldot/junit/opcodes/new_array/TestStubs;
return-object v0
.end method
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_10.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_10.java
index d01314b..81b7a7e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.new_array.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_new_array_10 {
+ public Object[] run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_11.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_11.java
index d01314b..e37e1ec 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/new_array/d/T_new_array_11.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.new_array.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_new_array_11 {
+ public Object[] run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/new_instance/TestStubs.java b/tools/vm-tests/src/dot/junit/opcodes/new_instance/TestStubs.java
index 9cba0ea..ca22946 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/new_instance/TestStubs.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/new_instance/TestStubs.java
@@ -16,9 +16,6 @@
package dot.junit.opcodes.new_instance;
-public class TestStubs {
- @SuppressWarnings("unused")
- private class TestStub {
- // used by testVFE5
- }
-}
\ No newline at end of file
+// package access to trigger IllegalAccessError in testVFE5
+class TestStubs {
+}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/new_instance/Test_new_instance.java b/tools/vm-tests/src/dot/junit/opcodes/new_instance/Test_new_instance.java
index 6a9fcbe..d994f65 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/new_instance/Test_new_instance.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/new_instance/Test_new_instance.java
@@ -20,6 +20,8 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.new_instance.d.T_new_instance_1;
import dot.junit.opcodes.new_instance.d.T_new_instance_3;
+import dot.junit.opcodes.new_instance.d.T_new_instance_4;
+import dot.junit.opcodes.new_instance.d.T_new_instance_5;
import dot.junit.opcodes.new_instance.d.T_new_instance_8;
import dot.junit.opcodes.new_instance.d.T_new_instance_9;
@@ -37,7 +39,7 @@
}
/**
- * @title class initialization throws exception
+ * @title class initialization throws exception
*/
public void testE1() {
try {
@@ -49,7 +51,7 @@
}
/**
- * @constraint A21
+ * @constraint A21
* @title attempt to instantiate interface
*/
public void testE4() {
@@ -65,7 +67,7 @@
}
/**
- * @constraint A21
+ * @constraint A21
* @title attempt to instantiate abstract
* class
*/
@@ -82,7 +84,7 @@
}
/**
- * @constraint A18
+ * @constraint A18
* @title constant pool index
*/
public void testVFE1() {
@@ -95,8 +97,8 @@
}
/**
- *
- * @constraint A21
+ *
+ * @constraint A21
* @title attempt to create array using new
*/
public void testVFE2() {
@@ -121,9 +123,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint A23
+ * @constraint A23
* @title number of registers
*/
public void testVFE4() {
@@ -134,41 +136,37 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to instantiate array of inaccessible class. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to instantiate array of inaccessible class.
*/
public void testVFE5() {
//@uses dot.junit.opcodes.new_instance.TestStubs
//@uses dot.junit.opcodes.new_instance.d.T_new_instance_4
try {
- Class.forName("dot.junit.opcodes.new_instance.d.T_new_instance_4");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_new_instance_4().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to instantiate array of non-existent class. Java
- * throws NoClassDefFoundError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to instantiate array of non-existent class.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.new_instance.d.T_new_instance_5");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_new_instance_5().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
/**
* @constraint B7
- * @title A register which holds the result of a new-instance instruction must not be used
- * if the same new-instance instruction is again executed before the instance is initialized
+ * @title A register which holds the result of a new-instance instruction must not be used
+ * if the same new-instance instruction is again executed before the instance is initialized
*/
public void testVFE7() {
try {
@@ -178,11 +176,11 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint B7
- * @title A register which holds the result of a new-instance instruction must not be used
- * if the same new-instance instruction is again executed before the instance is initialized
+ * @title A register which holds the result of a new-instance instruction must not be used
+ * if the same new-instance instruction is again executed before the instance is initialized
*/
public void testVFE8() {
try {
diff --git a/tools/vm-tests/src/dot/junit/opcodes/new_instance/d/T_new_instance_4.d b/tools/vm-tests/src/dot/junit/opcodes/new_instance/d/T_new_instance_4.d
index 508e63c..a92c597 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/new_instance/d/T_new_instance_4.d
+++ b/tools/vm-tests/src/dot/junit/opcodes/new_instance/d/T_new_instance_4.d
@@ -27,8 +27,8 @@
.method public run()Ljava/lang/Object;
.limit regs 5
- new-instance v1, dot/junit/opcodes/new_instance/TestStubs$TestStub
-; invoke-direct {v1}, dot/junit/opcodes/new_instance/TestStubs$TestStub/<init>()V
+ new-instance v1, dot/junit/opcodes/new_instance/TestStubs
+; invoke-direct {v1}, dot/junit/opcodes/new_instance/TestStubs/<init>()V
; intentionally return v4 ("this")
return-object v4
.end method
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sget/Test_sget.java b/tools/vm-tests/src/dot/junit/opcodes/sget/Test_sget.java
index de7e2dd..981b19a 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sget/Test_sget.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget/Test_sget.java
@@ -20,12 +20,17 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.sget.d.T_sget_1;
import dot.junit.opcodes.sget.d.T_sget_11;
+import dot.junit.opcodes.sget.d.T_sget_12;
+import dot.junit.opcodes.sget.d.T_sget_13;
import dot.junit.opcodes.sget.d.T_sget_2;
import dot.junit.opcodes.sget.d.T_sget_5;
+import dot.junit.opcodes.sget.d.T_sget_6;
+import dot.junit.opcodes.sget.d.T_sget_7;
+import dot.junit.opcodes.sget.d.T_sget_8;
import dot.junit.opcodes.sget.d.T_sget_9;
public class Test_sget extends DxTestCase {
-
+
/**
* @title type - int
*/
@@ -65,7 +70,7 @@
// expected
}
}
-
+
/**
* @title initialization of referenced class throws exception
*/
@@ -80,7 +85,7 @@
}
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -93,8 +98,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -105,84 +110,75 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B13
- * @title read integer from long field - only field with same name but
+ *
+ * @constraint B13
+ * @title read integer from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.sget.d.T_sget_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_13().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.sget.d.T_sget_6
//@uses dot.junit.opcodes.sget.TestStubs
try {
- Class.forName("dot.junit.opcodes.sget.d.T_sget_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_6().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sget.d.T_sget_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_7().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.sget.d.T_sget_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_8().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.sget.d.T_sget_12
//@uses dot.junit.opcodes.sget.d.T_sget_1
try {
- Class.forName("dot.junit.opcodes.sget.d.T_sget_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_12().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title sget shall not work for reference fields
*/
public void testVFE8() {
@@ -193,10 +189,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget shall not work for short fields
*/
public void testVFE9() {
@@ -207,10 +203,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget shall not work for boolean fields
*/
public void testVFE10() {
@@ -221,10 +217,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget shall not work for char fields
*/
public void testVFE11() {
@@ -235,10 +231,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget shall not work for byte fields
*/
public void testVFE12() {
@@ -248,11 +244,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget shall not work for double fields
*/
public void testVFE13() {
@@ -262,11 +258,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget shall not work for long fields
*/
public void testVFE14() {
@@ -276,5 +272,5 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
+ }
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_12.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_12.java
index d01314b..f4232d3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_12 {
+ public int run(){
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_13.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_13.java
index d01314b..a1d862f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_13 {
+ public void run(){
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_6.java
index d01314b..8f81780 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_6 {
+ public int run(){
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_7.java
index d01314b..8960240 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_7 {
+ public int run(){
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_8.java
index d01314b..17e16f0 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget/d/T_sget_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_8 {
+ public int run(){
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/Test_sget_boolean.java b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/Test_sget_boolean.java
index 85ef065..ccbeb09 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/Test_sget_boolean.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/Test_sget_boolean.java
@@ -20,11 +20,16 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.sget_boolean.d.T_sget_boolean_1;
import dot.junit.opcodes.sget_boolean.d.T_sget_boolean_11;
+import dot.junit.opcodes.sget_boolean.d.T_sget_boolean_12;
+import dot.junit.opcodes.sget_boolean.d.T_sget_boolean_13;
import dot.junit.opcodes.sget_boolean.d.T_sget_boolean_5;
+import dot.junit.opcodes.sget_boolean.d.T_sget_boolean_6;
+import dot.junit.opcodes.sget_boolean.d.T_sget_boolean_7;
+import dot.junit.opcodes.sget_boolean.d.T_sget_boolean_8;
import dot.junit.opcodes.sget_boolean.d.T_sget_boolean_9;
public class Test_sget_boolean extends DxTestCase {
-
+
/**
* @title get boolean from static field
*/
@@ -49,7 +54,7 @@
* @title attempt to access non-static field
*/
public void testE1() {
-
+
T_sget_boolean_5 t = new T_sget_boolean_5();
try {
t.run();
@@ -58,7 +63,7 @@
// expected
}
}
-
+
/**
* @title initialization of referenced class throws exception
*/
@@ -72,10 +77,10 @@
}
}
-
+
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -88,8 +93,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -100,84 +105,74 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B13
- * @title read boolean from long field - only field with same name but
+ *
+ * @constraint B13
+ * @title read boolean from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.sget_boolean.d.T_sget_boolean_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_boolean_13().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.sget_boolean.d.T_sget_boolean_6
//@uses dot.junit.opcodes.sget_boolean.TestStubs
try {
- Class.forName("dot.junit.opcodes.sget_boolean.d.T_sget_boolean_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_boolean_6().run();
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sget_boolean.d.T_sget_boolean_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_boolean_7().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.sget_boolean.d.T_sget_boolean_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_boolean_8().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.sget_boolean.d.T_sget_boolean_12
//@uses dot.junit.opcodes.sget_boolean.d.T_sget_boolean_1
try {
- Class.forName("dot.junit.opcodes.sget_boolean.d.T_sget_boolean_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_boolean_12().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title sget_boolean shall not work for reference fields
*/
public void testVFE8() {
@@ -188,10 +183,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_boolean shall not work for short fields
*/
public void testVFE9() {
@@ -202,10 +197,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_boolean shall not work for int fields
*/
public void testVFE10() {
@@ -216,10 +211,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_boolean shall not work for char fields
*/
public void testVFE11() {
@@ -230,10 +225,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_boolean shall not work for byte fields
*/
public void testVFE12() {
@@ -243,11 +238,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_boolean shall not work for double fields
*/
public void testVFE13() {
@@ -257,11 +252,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_boolean shall not work for long fields
*/
public void testVFE14() {
@@ -271,5 +266,5 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
+ }
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_12.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_12.java
index d01314b..74566c4 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_boolean.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_boolean_12 {
+ public boolean run(){
+ return true;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_13.java
index d01314b..f69d590 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sget_boolean_13 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_6.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_6.java
index d01314b..ecf8943 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_boolean.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_boolean_6 {
+ public boolean run(){
+ return true;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_7.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_7.java
index d01314b..4db0e16 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_boolean.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_boolean_7 {
+ public boolean run(){
+ return true;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_8.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_8.java
index d01314b..42cf804 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_boolean/d/T_sget_boolean_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_boolean.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_boolean_8 {
+ public boolean run(){
+ return true;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sget_byte/Test_sget_byte.java b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/Test_sget_byte.java
index 87781ac..9a19f98 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sget_byte/Test_sget_byte.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/Test_sget_byte.java
@@ -20,11 +20,16 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.sget_byte.d.T_sget_byte_1;
import dot.junit.opcodes.sget_byte.d.T_sget_byte_11;
+import dot.junit.opcodes.sget_byte.d.T_sget_byte_12;
+import dot.junit.opcodes.sget_byte.d.T_sget_byte_13;
import dot.junit.opcodes.sget_byte.d.T_sget_byte_5;
+import dot.junit.opcodes.sget_byte.d.T_sget_byte_6;
+import dot.junit.opcodes.sget_byte.d.T_sget_byte_7;
+import dot.junit.opcodes.sget_byte.d.T_sget_byte_8;
import dot.junit.opcodes.sget_byte.d.T_sget_byte_9;
public class Test_sget_byte extends DxTestCase {
-
+
/**
* @title get byte from static field
*/
@@ -49,7 +54,7 @@
* @title attempt to access non-static field
*/
public void testE1() {
-
+
T_sget_byte_5 t = new T_sget_byte_5();
try {
t.run();
@@ -58,7 +63,7 @@
// expected
}
}
-
+
/**
* @title initialization of referenced class throws exception
*/
@@ -72,10 +77,10 @@
}
}
-
+
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -88,8 +93,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -100,84 +105,75 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B13
- * @title read byte from long field - only field with same name but
+ *
+ * @constraint B13
+ * @title read byte from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.sget_byte.d.T_sget_byte_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_byte_13().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.sget_byte.d.T_sget_byte_6
//@uses dot.junit.opcodes.sget_byte.TestStubs
try {
- Class.forName("dot.junit.opcodes.sget_byte.d.T_sget_byte_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_byte_6().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sget_byte.d.T_sget_byte_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_byte_7().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.sget_byte.d.T_sget_byte_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_byte_8().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.sget_byte.d.T_sget_byte_12
//@uses dot.junit.opcodes.sget_byte.d.T_sget_byte_1
try {
- Class.forName("dot.junit.opcodes.sget_byte.d.T_sget_byte_12");
+ new T_sget_byte_12().run();
fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title sget_byte shall not work for reference fields
*/
public void testVFE8() {
@@ -188,10 +184,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_byte shall not work for short fields
*/
public void testVFE9() {
@@ -202,10 +198,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_byte shall not work for int fields
*/
public void testVFE10() {
@@ -216,10 +212,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_byte shall not work for char fields
*/
public void testVFE11() {
@@ -230,10 +226,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_byte shall not work for boolean fields
*/
public void testVFE12() {
@@ -243,11 +239,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_byte shall not work for double fields
*/
public void testVFE13() {
@@ -257,11 +253,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_byte shall not work for long fields
*/
public void testVFE14() {
@@ -271,5 +267,5 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
+ }
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_12.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_12.java
index d01314b..cbfb2c0 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_byte.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_byte_12 {
+ public byte run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_13.java
index d01314b..b2723ae 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sget_byte_13 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_6.java
index d01314b..df4e3f9 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_byte.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_byte_6 {
+ public byte run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_7.java
index d01314b..b865dde 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_byte.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_byte_7 {
+ public byte run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_8.java
index d01314b..605616f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_byte/d/T_sget_byte_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_byte.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_byte_8 {
+ public byte run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sget_char/Test_sget_char.java b/tools/vm-tests/src/dot/junit/opcodes/sget_char/Test_sget_char.java
index 1cf81b7..10324a5 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sget_char/Test_sget_char.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_char/Test_sget_char.java
@@ -20,11 +20,16 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.sget_char.d.T_sget_char_1;
import dot.junit.opcodes.sget_char.d.T_sget_char_11;
+import dot.junit.opcodes.sget_char.d.T_sget_char_12;
+import dot.junit.opcodes.sget_char.d.T_sget_char_13;
import dot.junit.opcodes.sget_char.d.T_sget_char_5;
+import dot.junit.opcodes.sget_char.d.T_sget_char_6;
+import dot.junit.opcodes.sget_char.d.T_sget_char_7;
+import dot.junit.opcodes.sget_char.d.T_sget_char_8;
import dot.junit.opcodes.sget_char.d.T_sget_char_9;
public class Test_sget_char extends DxTestCase {
-
+
/**
* @title get char from static field
*/
@@ -49,7 +54,7 @@
* @title attempt to access non-static field
*/
public void testE1() {
-
+
T_sget_char_5 t = new T_sget_char_5();
try {
t.run();
@@ -58,7 +63,7 @@
// expected
}
}
-
+
/**
* @title initialization of referenced class throws exception
*/
@@ -72,10 +77,10 @@
}
}
-
+
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -88,8 +93,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -100,84 +105,75 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B13
- * @title read char from long field - only field with same name but
+ *
+ * @constraint B13
+ * @title read char from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.sget_char.d.T_sget_char_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_char_13().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.sget_char.d.T_sget_char_6
//@uses dot.junit.opcodes.sget_char.TestStubs
try {
- Class.forName("dot.junit.opcodes.sget_char.d.T_sget_char_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_char_6().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sget_char.d.T_sget_char_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_char_7().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.sget_char.d.T_sget_char_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_char_8().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.sget_char.d.T_sget_char_12
//@uses dot.junit.opcodes.sget_char.d.T_sget_char_1
try {
- Class.forName("dot.junit.opcodes.sget_char.d.T_sget_char_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_char_12().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title sget_char shall not work for reference fields
*/
public void testVFE8() {
@@ -188,10 +184,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_char shall not work for short fields
*/
public void testVFE9() {
@@ -202,10 +198,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_char shall not work for int fields
*/
public void testVFE10() {
@@ -216,10 +212,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_char shall not work for byte fields
*/
public void testVFE11() {
@@ -230,10 +226,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_char shall not work for boolean fields
*/
public void testVFE12() {
@@ -243,11 +239,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_char shall not work for double fields
*/
public void testVFE13() {
@@ -257,11 +253,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_char shall not work for long fields
*/
public void testVFE14() {
@@ -271,5 +267,5 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
+ }
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_12.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_12.java
index d01314b..f7affdf 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_char.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_char_12 {
+ public char run() {
+ return ' ';
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_13.java
index d01314b..b347b53 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sget_char_13 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_6.java
index d01314b..7fc0f38 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_char.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_char_6 {
+ public char run() {
+ return ' ';
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_7.java
index d01314b..616d9f1 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_char.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_char_7 {
+ public char run() {
+ return ' ';
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_8.java
index d01314b..78e63e9 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_char/d/T_sget_char_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_char.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_char_8 {
+ public char run() {
+ return ' ';
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sget_object/Test_sget_object.java b/tools/vm-tests/src/dot/junit/opcodes/sget_object/Test_sget_object.java
index 51d6c91..88aa4cb 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sget_object/Test_sget_object.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_object/Test_sget_object.java
@@ -20,11 +20,17 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.sget_object.d.T_sget_object_1;
import dot.junit.opcodes.sget_object.d.T_sget_object_11;
+import dot.junit.opcodes.sget_object.d.T_sget_object_12;
+import dot.junit.opcodes.sget_object.d.T_sget_object_13;
+import dot.junit.opcodes.sget_object.d.T_sget_object_21;
import dot.junit.opcodes.sget_object.d.T_sget_object_5;
+import dot.junit.opcodes.sget_object.d.T_sget_object_6;
+import dot.junit.opcodes.sget_object.d.T_sget_object_7;
+import dot.junit.opcodes.sget_object.d.T_sget_object_8;
import dot.junit.opcodes.sget_object.d.T_sget_object_9;
public class Test_sget_object extends DxTestCase {
-
+
/**
* @title get object from static field
*/
@@ -49,7 +55,7 @@
* @title attempt to access non-static field
*/
public void testE1() {
-
+
T_sget_object_5 t = new T_sget_object_5();
try {
t.run();
@@ -58,7 +64,7 @@
// expected
}
}
-
+
/**
* @title initialization of referenced class throws exception
*/
@@ -72,10 +78,10 @@
}
}
-
+
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -88,8 +94,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -100,84 +106,75 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B13
- * @title read object from long field - only field with same name but
+ *
+ * @constraint B13
+ * @title read object from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.sget_object.d.T_sget_object_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_object_13().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.sget_object.d.T_sget_object_6
//@uses dot.junit.opcodes.sget_object.TestStubs
try {
- Class.forName("dot.junit.opcodes.sget_object.d.T_sget_object_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_object_6().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sget_object.d.T_sget_object_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_object_7().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.sget_object.d.T_sget_object_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_object_8().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.sget_object.d.T_sget_object_12
//@uses dot.junit.opcodes.sget_object.d.T_sget_object_1
try {
- Class.forName("dot.junit.opcodes.sget_object.d.T_sget_object_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_object_12().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title sget_object shall not work for short fields
*/
public void testVFE8() {
@@ -188,10 +185,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_object shall not work for char fields
*/
public void testVFE9() {
@@ -202,10 +199,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_object shall not work for int fields
*/
public void testVFE10() {
@@ -216,10 +213,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_object shall not work for byte fields
*/
public void testVFE11() {
@@ -230,10 +227,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_object shall not work for boolean fields
*/
public void testVFE12() {
@@ -243,11 +240,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_object shall not work for double fields
*/
public void testVFE13() {
@@ -257,11 +254,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_object shall not work for long fields
*/
public void testVFE14() {
@@ -271,19 +268,18 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B13
+ *
+ * @constraint B13
* @title only field of different type exists)
*/
public void testVFE15() {
try {
- Class.forName("dot.junit.opcodes.sget_object.d.T_sget_object_21");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_object_21().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_12.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_12.java
index d01314b..0978a26 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_object.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_object_12 {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_13.java
index d01314b..7fe275e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sget_object_13 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_21.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_21.java
index d01314b..0343390 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_21.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_object.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_object_21 {
+ public String run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_6.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_6.java
index d01314b..84714b2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_object.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_object_6 {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_7.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_7.java
index d01314b..56fbd35 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_object.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_object_7 {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_8.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_8.java
index d01314b..87afe69 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_object/d/T_sget_object_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_object.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_object_8 {
+ public Object run() {
+ return null;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sget_short/Test_sget_short.java b/tools/vm-tests/src/dot/junit/opcodes/sget_short/Test_sget_short.java
index 33a3c06..b38ef29 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sget_short/Test_sget_short.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_short/Test_sget_short.java
@@ -20,11 +20,16 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.sget_short.d.T_sget_short_1;
import dot.junit.opcodes.sget_short.d.T_sget_short_11;
+import dot.junit.opcodes.sget_short.d.T_sget_short_12;
+import dot.junit.opcodes.sget_short.d.T_sget_short_13;
import dot.junit.opcodes.sget_short.d.T_sget_short_5;
+import dot.junit.opcodes.sget_short.d.T_sget_short_6;
+import dot.junit.opcodes.sget_short.d.T_sget_short_7;
+import dot.junit.opcodes.sget_short.d.T_sget_short_8;
import dot.junit.opcodes.sget_short.d.T_sget_short_9;
public class Test_sget_short extends DxTestCase {
-
+
/**
* @title get short from static field
*/
@@ -49,7 +54,7 @@
* @title attempt to access non-static field
*/
public void testE1() {
-
+
T_sget_short_5 t = new T_sget_short_5();
try {
t.run();
@@ -58,7 +63,7 @@
// expected
}
}
-
+
/**
* @title initialization of referenced class throws exception
*/
@@ -72,10 +77,10 @@
}
}
-
+
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -88,8 +93,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -100,84 +105,75 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B13
- * @title read short from long field - only field with same name but
+ *
+ * @constraint B13
+ * @title read short from long field - only field with same name but
* different type exists
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.sget_short.d.T_sget_short_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_short_13().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.sget_short.d.T_sget_short_6
//@uses dot.junit.opcodes.sget_short.TestStubs
try {
- Class.forName("dot.junit.opcodes.sget_short.d.T_sget_short_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_short_6().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sget_short.d.T_sget_short_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_short_7().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.sget_short.d.T_sget_short_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_short_8().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.sget_short.d.T_sget_short_12
//@uses dot.junit.opcodes.sget_short.d.T_sget_short_1
try {
- Class.forName("dot.junit.opcodes.sget_short.d.T_sget_short_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_short_12().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title sget_short shall not work for reference fields
*/
public void testVFE8() {
@@ -188,10 +184,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_short shall not work for char fields
*/
public void testVFE9() {
@@ -202,10 +198,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_short shall not work for int fields
*/
public void testVFE10() {
@@ -216,10 +212,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_short shall not work for byte fields
*/
public void testVFE11() {
@@ -230,10 +226,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_short shall not work for boolean fields
*/
public void testVFE12() {
@@ -243,11 +239,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_short shall not work for double fields
*/
public void testVFE13() {
@@ -257,11 +253,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget_short shall not work for long fields
*/
public void testVFE14() {
@@ -271,5 +267,5 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
+ }
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_12.java
similarity index 76%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_12.java
index d01314b..ea41518 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_short.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_short_12 {
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_13.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_13.java
index d01314b..4bc3105 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_short.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_short_13 {
+ public void run(){
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_6.java
index d01314b..1499a3c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_short.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_short_6 {
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_7.java
index d01314b..823e90d 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_short.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_short_7 {
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_8.java
index d01314b..2c3ec32 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_short/d/T_sget_short_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_short.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_short_8 {
+ public short run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sget_wide/Test_sget_wide.java b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/Test_sget_wide.java
index b107ea8..8ecbeb7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sget_wide/Test_sget_wide.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/Test_sget_wide.java
@@ -20,12 +20,17 @@
import dot.junit.DxUtil;
import dot.junit.opcodes.sget_wide.d.T_sget_wide_1;
import dot.junit.opcodes.sget_wide.d.T_sget_wide_11;
+import dot.junit.opcodes.sget_wide.d.T_sget_wide_12;
+import dot.junit.opcodes.sget_wide.d.T_sget_wide_13;
import dot.junit.opcodes.sget_wide.d.T_sget_wide_2;
import dot.junit.opcodes.sget_wide.d.T_sget_wide_5;
+import dot.junit.opcodes.sget_wide.d.T_sget_wide_6;
+import dot.junit.opcodes.sget_wide.d.T_sget_wide_7;
+import dot.junit.opcodes.sget_wide.d.T_sget_wide_8;
import dot.junit.opcodes.sget_wide.d.T_sget_wide_9;
public class Test_sget_wide extends DxTestCase {
-
+
/**
* @title type - long
*/
@@ -57,7 +62,7 @@
* @title attempt to access non-static field
*/
public void testE1() {
-
+
T_sget_wide_5 t = new T_sget_wide_5();
try {
t.run();
@@ -66,12 +71,12 @@
// expected
}
}
-
+
/**
* @title initialization of referenced class throws exception
*/
public void testE6() {
-
+
T_sget_wide_9 t = new T_sget_wide_9();
try {
t.run();
@@ -81,10 +86,10 @@
}
}
-
+
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -97,8 +102,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -109,84 +114,75 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B13
- * @title read long from integer field - only field with same name but
+ *
+ * @constraint B13
+ * @title read long from integer field - only field with same name but
* different type exists
*/
public void testVFE3() {
try {
- Class.forName("dot.junit.opcodes.sget_wide.d.T_sget_wide_13");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_wide_13().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read inaccessible field. Java throws IllegalAccessError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read inaccessible field.
*/
public void testVFE4() {
//@uses dot.junit.opcodes.sget_wide.d.T_sget_wide_6
//@uses dot.junit.opcodes.sget_wide.TestStubs
try {
- Class.forName("dot.junit.opcodes.sget_wide.d.T_sget_wide_6");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_wide_6().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read field of undefined class. Java throws NoClassDefFoundError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read field of undefined class.
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sget_wide.d.T_sget_wide_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_wide_7().run();
+ fail("expected NoClassDefFoundError");
+ } catch (NoClassDefFoundError t) {
}
}
/**
* @constraint n/a
- * @title Attempt to read undefined field. Java throws NoSuchFieldError
- * on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read undefined field.
*/
public void testVFE6() {
try {
- Class.forName("dot.junit.opcodes.sget_wide.d.T_sget_wide_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_wide_8().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
* @constraint n/a
- * @title Attempt to read superclass' private field from subclass. Java
- * throws IllegalAccessError on first access but Dalvik throws VerifyError on class loading.
+ * @title Attempt to read superclass' private field from subclass.
*/
public void testVFE7() {
//@uses dot.junit.opcodes.sget_wide.d.T_sget_wide_12
//@uses dot.junit.opcodes.sget_wide.d.T_sget_wide_1
try {
- Class.forName("dot.junit.opcodes.sget_wide.d.T_sget_wide_12");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sget_wide_12().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title sget-wide shall not work for reference fields
*/
public void testVFE8() {
@@ -197,10 +193,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget-wide shall not work for short fields
*/
public void testVFE9() {
@@ -211,10 +207,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget-wide shall not work for boolean fields
*/
public void testVFE10() {
@@ -225,10 +221,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget-wide shall not work for char fields
*/
public void testVFE11() {
@@ -239,10 +235,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget-wide shall not work for byte fields
*/
public void testVFE12() {
@@ -252,11 +248,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget-wide shall not work for float fields
*/
public void testVFE13() {
@@ -266,11 +262,11 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
-
+ }
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sget-wide shall not work for int fields
*/
public void testVFE14() {
@@ -280,5 +276,5 @@
} catch (Throwable t) {
DxUtil.checkVerifyException(t);
}
- }
+ }
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_12.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_12.java
index d01314b..9dc55c6 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_12.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_wide.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_wide_12 {
+ public long run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_13.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_13.java
index d01314b..21fc969 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_13.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sget_wide_13 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_6.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_6.java
index d01314b..f2744cf 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_6.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_wide.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_wide_6 {
+ public long run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_7.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_7.java
index d01314b..e97e416 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_wide.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_wide_7 {
+ public long run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_8.java
similarity index 77%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_8.java
index d01314b..95b2dbb 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sget_wide/d/T_sget_wide_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sget_wide.d;
-
-public class T_invoke_interface_17 {
-
- public void run() {
+public class T_sget_wide_8 {
+ public long run() {
+ return 0;
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput/Test_sput.java b/tools/vm-tests/src/dot/junit/opcodes/sput/Test_sput.java
index 7733001..8b73bb5 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sput/Test_sput.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput/Test_sput.java
@@ -19,12 +19,18 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.sput.d.T_sput_1;
+import dot.junit.opcodes.sput.d.T_sput_10;
import dot.junit.opcodes.sput.d.T_sput_11;
import dot.junit.opcodes.sput.d.T_sput_12;
import dot.junit.opcodes.sput.d.T_sput_13;
import dot.junit.opcodes.sput.d.T_sput_14;
+import dot.junit.opcodes.sput.d.T_sput_15;
+import dot.junit.opcodes.sput.d.T_sput_17;
import dot.junit.opcodes.sput.d.T_sput_19;
import dot.junit.opcodes.sput.d.T_sput_5;
+import dot.junit.opcodes.sput.d.T_sput_7;
+import dot.junit.opcodes.sput.d.T_sput_8;
+import dot.junit.opcodes.sput.d.T_sput_9;
public class Test_sput extends DxTestCase {
@@ -49,7 +55,7 @@
assertEquals(3.14f, T_sput_19.st_f1);
}
-
+
/**
* @title modification of final field
*/
@@ -73,8 +79,8 @@
}
/**
- * @title Trying to put float into integer field. Dalvik doens't distinguish 32-bits types
- * internally, so this operation makes no sense but shall not crash the VM.
+ * @title Trying to put float into integer field. Dalvik doens't distinguish 32-bits types
+ * internally, so this operation makes no sense but shall not crash the VM.
*/
public void testN6() {
T_sput_5 t = new T_sput_5();
@@ -84,7 +90,7 @@
}
}
-
+
/**
* @title initialization of referenced class throws exception
@@ -100,7 +106,7 @@
}
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -113,8 +119,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -128,24 +134,23 @@
/**
- *
- * @constraint B13
- * @title put integer into long field - only field with same name but
+ *
+ * @constraint B13
+ * @title put integer into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sput.d.T_sput_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
/**
- *
- * @constraint B13
- * @title type of field doesn't match opcode - attempt to modify double field
+ *
+ * @constraint B13
+ * @title type of field doesn't match opcode - attempt to modify double field
* with single-width register
*/
public void testVFE7() {
@@ -156,87 +161,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.d.T_sput_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_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.TestStubs
//@uses dot.junit.opcodes.sput.d.T_sput_8
try {
- Class.forName("dot.junit.opcodes.sput.d.T_sput_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_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.d.T_sput_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_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.d.T_sput_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_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.d.T_sput_1
//@uses dot.junit.opcodes.sput.d.T_sput_15
try {
- Class.forName("dot.junit.opcodes.sput.d.T_sput_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title sput shall not work for wide numbers
*/
public void testVFE13() {
@@ -247,10 +242,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput shall not work for reference fields
*/
public void testVFE14() {
@@ -261,10 +256,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput shall not work for short fields
*/
public void testVFE15() {
@@ -275,10 +270,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput shall not work for boolean fields
*/
public void testVFE16() {
@@ -289,10 +284,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput shall not work for char fields
*/
public void testVFE17() {
@@ -303,10 +298,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput shall not work for byte fields
*/
public void testVFE18() {
@@ -317,7 +312,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -326,11 +321,10 @@
//@uses dot.junit.opcodes.sput.TestStubs
//@uses dot.junit.opcodes.sput.d.T_sput_11
try {
- Class.forName("dot.junit.opcodes.sput.d.T_sput_11");
+ new T_sput_11().run();
fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ } catch (IllegalAccessError t) {
}
}
-
+
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_10.java
index d01314b..01a9d6b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_15.java
index d01314b..25944f3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_17.java
index d01314b..c96b5eb 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_7.java
index d01314b..8b22c00 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_8.java
index d01314b..5ccae38 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_9.java
index d01314b..b8f71e7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput/d/T_sput_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/Test_sput_boolean.java b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/Test_sput_boolean.java
index 61a3e54..f503ec6 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/Test_sput_boolean.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/Test_sput_boolean.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_1;
+import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_10;
import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_11;
import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_12;
import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_13;
import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_14;
+import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_15;
+import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_17;
+import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_7;
+import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_8;
+import dot.junit.opcodes.sput_boolean.d.T_sput_boolean_9;
public class Test_sput_boolean extends DxTestCase {
@@ -37,7 +43,7 @@
assertEquals(true, T_sput_boolean_1.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -59,7 +65,7 @@
t.run();
assertEquals(true, T_sput_boolean_14.getProtectedField());
}
-
+
/**
* @title initialization of referenced class throws exception
@@ -75,7 +81,7 @@
}
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -88,8 +94,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -103,23 +109,22 @@
/**
- *
- * @constraint B13
- * @title put boolean into long field - only field with same name but
+ *
+ * @constraint B13
+ * @title put boolean into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sput_boolean.d.T_sput_boolean_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_boolean_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
- *
- * @constraint B13
+ *
+ * @constraint B13
* @title put value '2' into boolean field
*/
public void testVFE6() {
@@ -132,9 +137,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() {
@@ -145,87 +150,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_boolean.d.T_sput_boolean_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_boolean_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_boolean.TestStubs
//@uses dot.junit.opcodes.sput_boolean.d.T_sput_boolean_8
try {
- Class.forName("dot.junit.opcodes.sput_boolean.d.T_sput_boolean_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_boolean_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_boolean.d.T_sput_boolean_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_boolean_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_boolean.d.T_sput_boolean_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_boolean_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_boolean.d.T_sput_boolean_1
//@uses dot.junit.opcodes.sput_boolean.d.T_sput_boolean_15
try {
- Class.forName("dot.junit.opcodes.sput_boolean.d.T_sput_boolean_15");
+ new T_sput_boolean_15().run();
fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title sput_boolean shall not work for wide numbers
*/
public void testVFE13() {
@@ -236,10 +231,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput_boolean shall not work for reference fields
*/
public void testVFE14() {
@@ -250,10 +245,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput_boolean shall not work for short fields
*/
public void testVFE15() {
@@ -264,10 +259,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput_boolean shall not work for int fields
*/
public void testVFE16() {
@@ -278,10 +273,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput_boolean shall not work for char fields
*/
public void testVFE17() {
@@ -292,10 +287,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput_boolean shall not work for byte fields
*/
public void testVFE18() {
@@ -306,19 +301,19 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title Modification of final field in other class.
*/
public void testVFE19() {
//@uses dot.junit.opcodes.sput_boolean.TestStubs
//@uses dot.junit.opcodes.sput_boolean.d.T_sput_boolean_11
-
+
try {
- Class.forName("dot.junit.opcodes.sput_boolean.d.T_sput_boolean_11");
- }catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_boolean_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_10.java
index d01314b..1bb1f7a 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_boolean_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_15.java
index d01314b..467fc55 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_boolean_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_17.java
index d01314b..5e126b5 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_boolean_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_7.java
index d01314b..7a97328 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_boolean_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_8.java
index d01314b..8d738ae 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_boolean_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_9.java
index d01314b..6028d28 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_boolean/d/T_sput_boolean_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_boolean.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_boolean_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_byte/Test_sput_byte.java b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/Test_sput_byte.java
index 4cb751b..c64f876 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sput_byte/Test_sput_byte.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/Test_sput_byte.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.sput_byte.d.T_sput_byte_1;
+import dot.junit.opcodes.sput_byte.d.T_sput_byte_10;
import dot.junit.opcodes.sput_byte.d.T_sput_byte_11;
import dot.junit.opcodes.sput_byte.d.T_sput_byte_12;
import dot.junit.opcodes.sput_byte.d.T_sput_byte_13;
import dot.junit.opcodes.sput_byte.d.T_sput_byte_14;
+import dot.junit.opcodes.sput_byte.d.T_sput_byte_15;
+import dot.junit.opcodes.sput_byte.d.T_sput_byte_17;
+import dot.junit.opcodes.sput_byte.d.T_sput_byte_7;
+import dot.junit.opcodes.sput_byte.d.T_sput_byte_8;
+import dot.junit.opcodes.sput_byte.d.T_sput_byte_9;
public class Test_sput_byte extends DxTestCase {
/**
@@ -35,7 +41,7 @@
assertEquals(77, T_sput_byte_1.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -57,7 +63,7 @@
t.run();
assertEquals(77, T_sput_byte_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,22 +107,21 @@
/**
- *
- * @constraint B13
- * @title put byte into long field - only field with same name but
+ *
+ * @constraint B13
+ * @title put byte into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sput_byte.d.T_sput_byte_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_byte_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
- *
+ *
* @constraint B13
* @title put value '256' into byte field
*/
@@ -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_byte.d.T_sput_byte_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_byte_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_byte.TestStubs
//@uses dot.junit.opcodes.sput_byte.d.T_sput_byte_8
try {
- Class.forName("dot.junit.opcodes.sput_byte.d.T_sput_byte_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_byte_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_byte.d.T_sput_byte_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_byte_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_byte.d.T_sput_byte_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_byte_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_byte.d.T_sput_byte_1
//@uses dot.junit.opcodes.sput_byte.d.T_sput_byte_15
try {
- Class.forName("dot.junit.opcodes.sput_byte.d.T_sput_byte_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_byte_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title sput-byte shall not work for wide numbers
*/
public void testVFE13() {
@@ -234,10 +229,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-byte shall not work for reference fields
*/
public void testVFE14() {
@@ -248,10 +243,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-byte shall not work for short fields
*/
public void testVFE15() {
@@ -262,10 +257,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-byte shall not work for int fields
*/
public void testVFE16() {
@@ -276,10 +271,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-byte shall not work for char fields
*/
public void testVFE17() {
@@ -290,9 +285,9 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- * @constraint B1
+ * @constraint B1
* @title sput-byte shall not work for boolean fields
*/
public void testVFE18() {
@@ -303,7 +298,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -312,10 +307,9 @@
//@uses dot.junit.opcodes.sput_byte.TestStubs
//@uses dot.junit.opcodes.sput_byte.d.T_sput_byte_11
try {
- Class.forName("dot.junit.opcodes.sput_byte.d.T_sput_byte_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_byte_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_10.java
index d01314b..0b49e2e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_byte_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_15.java
index d01314b..c797268 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_byte_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_17.java
index d01314b..4ee32fc 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_byte_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_7.java
index d01314b..8871136 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_byte_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_8.java
index d01314b..0e1605f 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_byte_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_9.java
index d01314b..0262d88 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_byte/d/T_sput_byte_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_byte.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_byte_9 {
public void run() {
}
}
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/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_10.java
index d01314b..10f88f3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_char_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_15.java
index d01314b..2b4d7d2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_char_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_17.java
index d01314b..349eaa2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_char_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_7.java
index d01314b..7a496f2 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_char_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_8.java
index d01314b..c4a3e38 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_char_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_9.java
index d01314b..c38e18c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_char/d/T_sput_char_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_char.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_char_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_object/Test_sput_object.java b/tools/vm-tests/src/dot/junit/opcodes/sput_object/Test_sput_object.java
index 0607225..cd070a7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sput_object/Test_sput_object.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_object/Test_sput_object.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.sput_object.d.T_sput_object_1;
+import dot.junit.opcodes.sput_object.d.T_sput_object_10;
import dot.junit.opcodes.sput_object.d.T_sput_object_11;
import dot.junit.opcodes.sput_object.d.T_sput_object_12;
import dot.junit.opcodes.sput_object.d.T_sput_object_13;
import dot.junit.opcodes.sput_object.d.T_sput_object_14;
+import dot.junit.opcodes.sput_object.d.T_sput_object_15;
+import dot.junit.opcodes.sput_object.d.T_sput_object_17;
+import dot.junit.opcodes.sput_object.d.T_sput_object_7;
+import dot.junit.opcodes.sput_object.d.T_sput_object_8;
+import dot.junit.opcodes.sput_object.d.T_sput_object_9;
public class Test_sput_object extends DxTestCase {
/**
@@ -35,7 +41,7 @@
assertEquals(t, T_sput_object_1.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -57,7 +63,7 @@
t.run();
assertEquals(t, T_sput_object_14.getProtectedField());
}
-
+
/**
* @title initialization of referenced class throws exception
@@ -86,8 +92,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -101,25 +107,24 @@
/**
- *
- * @constraint B13
- * @title put object into long field - only field with same name but
+ *
+ * @constraint B13
+ * @title put object into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sput_object.d.T_sput_object_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_object_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
+
/**
- *
- * @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() {
@@ -130,87 +135,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_object.d.T_sput_object_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_object_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_object.TestStubs
//@uses dot.junit.opcodes.sput_object.d.T_sput_object_8
try {
- Class.forName("dot.junit.opcodes.sput_object.d.T_sput_object_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_object_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_object.d.T_sput_object_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_object_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_object.d.T_sput_object_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_object_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_object.d.T_sput_object_1
//@uses dot.junit.opcodes.sput_object.d.T_sput_object_15
try {
- Class.forName("dot.junit.opcodes.sput_object.d.T_sput_object_15");
+ new T_sput_object_15().run();
fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title sput-object shall not work for wide numbers
*/
public void testVFE13() {
@@ -221,10 +216,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B13
+ *
+ * @constraint B13
* @title assignment incompatible references
*/
public void testVFE14() {
@@ -235,10 +230,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-object shall not work for char fields
*/
public void testVFE15() {
@@ -249,10 +244,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-object shall not work for int fields
*/
public void testVFE16() {
@@ -263,10 +258,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-object shall not work for byte fields
*/
public void testVFE17() {
@@ -277,10 +272,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-object shall not work for boolean fields
*/
public void testVFE18() {
@@ -293,8 +288,8 @@
}
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-object shall not work for short fields
*/
public void testVFE6() {
@@ -308,17 +303,16 @@
/**
- * @constraint B1
+ * @constraint B1
* @title Modification of final field in other class
*/
public void testVFE19() {
//@uses dot.junit.opcodes.sput_object.TestStubs
//@uses dot.junit.opcodes.sput_object.d.T_sput_object_11
try {
- Class.forName("dot.junit.opcodes.sput_object.d.T_sput_object_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_object_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_10.java
index d01314b..bbc15c5 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_object_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_15.java
index d01314b..676e4c3 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_object_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_17.java
index d01314b..6f7ad7c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_object_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_7.java
index d01314b..0e5f873 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_object_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_8.java
index d01314b..d3d7408 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_object_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_9.java
index d01314b..bef9d16 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_object/d/T_sput_object_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_object.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_object_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_short/Test_sput_short.java b/tools/vm-tests/src/dot/junit/opcodes/sput_short/Test_sput_short.java
index c566401..f14c4a7 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sput_short/Test_sput_short.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_short/Test_sput_short.java
@@ -19,10 +19,16 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.sput_short.d.T_sput_short_1;
+import dot.junit.opcodes.sput_short.d.T_sput_short_10;
import dot.junit.opcodes.sput_short.d.T_sput_short_11;
import dot.junit.opcodes.sput_short.d.T_sput_short_12;
import dot.junit.opcodes.sput_short.d.T_sput_short_13;
import dot.junit.opcodes.sput_short.d.T_sput_short_14;
+import dot.junit.opcodes.sput_short.d.T_sput_short_15;
+import dot.junit.opcodes.sput_short.d.T_sput_short_17;
+import dot.junit.opcodes.sput_short.d.T_sput_short_7;
+import dot.junit.opcodes.sput_short.d.T_sput_short_8;
+import dot.junit.opcodes.sput_short.d.T_sput_short_9;
public class Test_sput_short extends DxTestCase {
/**
@@ -35,7 +41,7 @@
assertEquals(77, T_sput_short_1.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -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 short into long field - only field with same name but
+ *
+ * @constraint B13
+ * @title put short into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sput_short.d.T_sput_short_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_short_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_short.d.T_sput_short_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_short_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_short.TestStubs
//@uses dot.junit.opcodes.sput_short.d.T_sput_short_8
try {
- Class.forName("dot.junit.opcodes.sput_short.d.T_sput_short_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_short_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_short.d.T_sput_short_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_short_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_short.d.T_sput_short_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_short_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_short.d.T_sput_short_1
//@uses dot.junit.opcodes.sput_short.d.T_sput_short_15
try {
- Class.forName("dot.junit.opcodes.sput_short.d.T_sput_short_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_short_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title sput-short shall not work for wide numbers
*/
public void testVFE13() {
@@ -234,10 +229,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-short shall not work for reference fields
*/
public void testVFE14() {
@@ -248,10 +243,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-short shall not work for char fields
*/
public void testVFE15() {
@@ -262,10 +257,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-short shall not work for int fields
*/
public void testVFE16() {
@@ -276,10 +271,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-short shall not work for byte fields
*/
public void testVFE17() {
@@ -290,10 +285,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-short shall not work for boolean fields
*/
public void testVFE18() {
@@ -313,10 +308,9 @@
//@uses dot.junit.opcodes.sput_short.TestStubs
//@uses dot.junit.opcodes.sput_short.d.T_sput_short_11
try {
- Class.forName("dot.junit.opcodes.sput_short.d.T_sput_short_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_short_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_10.java
index d01314b..3af3f04 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_short_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_15.java
index d01314b..04f6a7c 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_short_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_17.java
index d01314b..fa56416 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_short_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_7.java
index d01314b..cbecc44 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_short_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_8.java
index d01314b..852263e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_short_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_9.java
index d01314b..e950c1d 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_short/d/T_sput_short_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_short.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_short_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/sput_wide/Test_sput_wide.java b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/Test_sput_wide.java
index edca9d9..29ff21b 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/sput_wide/Test_sput_wide.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/Test_sput_wide.java
@@ -19,11 +19,17 @@
import dot.junit.DxTestCase;
import dot.junit.DxUtil;
import dot.junit.opcodes.sput_wide.d.T_sput_wide_1;
+import dot.junit.opcodes.sput_wide.d.T_sput_wide_10;
import dot.junit.opcodes.sput_wide.d.T_sput_wide_11;
import dot.junit.opcodes.sput_wide.d.T_sput_wide_12;
import dot.junit.opcodes.sput_wide.d.T_sput_wide_13;
import dot.junit.opcodes.sput_wide.d.T_sput_wide_14;
+import dot.junit.opcodes.sput_wide.d.T_sput_wide_15;
+import dot.junit.opcodes.sput_wide.d.T_sput_wide_17;
import dot.junit.opcodes.sput_wide.d.T_sput_wide_5;
+import dot.junit.opcodes.sput_wide.d.T_sput_wide_7;
+import dot.junit.opcodes.sput_wide.d.T_sput_wide_8;
+import dot.junit.opcodes.sput_wide.d.T_sput_wide_9;
public class Test_sput_wide extends DxTestCase {
/**
@@ -35,7 +41,7 @@
t.run();
assertEquals(778899112233l, T_sput_wide_1.st_i1);
}
-
+
/**
* @title put double into static field
*/
@@ -46,7 +52,7 @@
assertEquals(0.5d, T_sput_wide_5.st_i1);
}
-
+
/**
* @title modification of final field
*/
@@ -68,7 +74,7 @@
t.run();
assertEquals(77, T_sput_wide_14.getProtectedField());
}
-
+
/**
* @title initialization of referenced class throws exception
*/
@@ -83,7 +89,7 @@
}
/**
- * @constraint A12
+ * @constraint A12
* @title constant pool index
*/
public void testVFE1() {
@@ -96,8 +102,8 @@
}
/**
- *
- * @constraint A23
+ *
+ * @constraint A23
* @title number of registers
*/
public void testVFE2() {
@@ -111,26 +117,25 @@
/**
- *
- * @constraint B13
- * @title put int into long field - only field with same name but
+ *
+ * @constraint B13
+ * @title put int into long field - only field with same name but
* different type exists
*/
public void testVFE5() {
try {
- Class.forName("dot.junit.opcodes.sput_wide.d.T_sput_wide_17");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_wide_17().run();
+ fail("expected NoSuchFieldError");
+ } catch (NoSuchFieldError t) {
}
}
-
-
+
+
/**
- *
- * @constraint B13
- * @title type of field doesn't match opcode - attempt to modify float
+ *
+ * @constraint B13
+ * @title type of field doesn't match opcode - attempt to modify float
* field with double-width register
*/
public void testVFE7() {
@@ -141,87 +146,85 @@
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.Dalvik throws IncompatibleClassChangeError when
+ * executing the code.
*/
public void testVFE8() {
try {
- Class.forName("dot.junit.opcodes.sput_wide.d.T_sput_wide_7");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_wide_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. Dalvik throws IllegalAccessError when executing
+ * the code.
*/
public void testVFE9() {
//@uses dot.junit.opcodes.sput_wide.TestStubs
//@uses dot.junit.opcodes.sput_wide.d.T_sput_wide_8
try {
- Class.forName("dot.junit.opcodes.sput_wide.d.T_sput_wide_8");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_wide_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. Dalvik throws NoClassDefFoundError when
+ * executing the code.
*/
public void testVFE10() {
+ //@uses dot.junit.opcodes.sput_wide.d.T_sput_wide_9
try {
- Class.forName("dot.junit.opcodes.sput_wide.d.T_sput_wide_9");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_wide_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. Dalvik throws NoSuchFieldError when executing the
+ * code.
*/
public void testVFE11() {
+ //@uses dot.junit.opcodes.sput_wide.d.T_sput_wide_10
try {
- Class.forName("dot.junit.opcodes.sput_wide.d.T_sput_wide_10");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_wide_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. Dalvik throws
+ * IllegalAccessError when executing the code.
*/
public void testVFE12() {
//@uses dot.junit.opcodes.sput_wide.d.T_sput_wide_1
//@uses dot.junit.opcodes.sput_wide.d.T_sput_wide_15
try {
- Class.forName("dot.junit.opcodes.sput_wide.d.T_sput_wide_15");
- fail("expected a verification exception");
- } catch (Throwable t) {
+ new T_sput_wide_15().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
DxUtil.checkVerifyException(t);
}
}
-
-
+
+
/**
- * @constraint B1
+ * @constraint B1
* @title sput-wide shall not work for single-width numbers
*/
public void testVFE13() {
@@ -232,10 +235,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-wide shall not work for reference fields
*/
public void testVFE14() {
@@ -246,10 +249,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-wide shall not work for char fields
*/
public void testVFE15() {
@@ -260,10 +263,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-wide shall not work for int fields
*/
public void testVFE16() {
@@ -274,10 +277,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-wide shall not work for byte fields
*/
public void testVFE17() {
@@ -288,10 +291,10 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-wide shall not work for boolean fields
*/
public void testVFE18() {
@@ -304,8 +307,8 @@
}
/**
- *
- * @constraint B1
+ *
+ * @constraint B1
* @title sput-wide shall not work for short fields
*/
public void testVFE6() {
@@ -316,7 +319,7 @@
DxUtil.checkVerifyException(t);
}
}
-
+
/**
* @constraint n/a
* @title Modification of final field in other class
@@ -325,12 +328,11 @@
//@uses dot.junit.opcodes.sput_wide.TestStubs
//@uses dot.junit.opcodes.sput_wide.d.T_sput_wide_11
try {
- Class.forName("dot.junit.opcodes.sput_wide.d.T_sput_wide_11");
- fail("expected a verification exception");
- } catch (Throwable t) {
- DxUtil.checkVerifyException(t);
+ new T_sput_wide_11().run();
+ fail("expected IllegalAccessError");
+ } catch (IllegalAccessError t) {
}
}
-
+
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_10.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_10.java
index d01314b..b275744 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_10.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_wide_10 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_15.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_15.java
index d01314b..376cdd8 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_15.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_wide_15 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_17.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_17.java
index d01314b..244fa5e 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_17.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_wide_17 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_7.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_7.java
index d01314b..4608227 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_7.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_wide_7 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_8.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_8.java
index d01314b..17cf144 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_8.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_wide_8 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_9.java
similarity index 80%
copy from tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
copy to tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_9.java
index d01314b..00355dd 100644
--- a/tools/vm-tests/src/dot/junit/opcodes/invoke_interface/d/T_invoke_interface_17.java
+++ b/tools/vm-tests/src/dot/junit/opcodes/sput_wide/d/T_sput_wide_9.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,11 +14,9 @@
* limitations under the License.
*/
-package dot.junit.opcodes.invoke_interface.d;
+package dot.junit.opcodes.sput_wide.d;
-
-public class T_invoke_interface_17 {
-
+public class T_sput_wide_9 {
public void run() {
}
}
diff --git a/tools/vm-tests/src/util/build/BuildDalvikSuite.java b/tools/vm-tests/src/util/build/BuildDalvikSuite.java
index f28a71b..eda6382 100644
--- a/tools/vm-tests/src/util/build/BuildDalvikSuite.java
+++ b/tools/vm-tests/src/util/build/BuildDalvikSuite.java
@@ -64,7 +64,7 @@
// the folder for the generated junit-files for the cts host (which in turn
// execute the real vm tests using adb push/shell etc)
- private static String HOSTJUNIT_SRC_OUTPUT_FOLDER = "";
+ private static String HOSTJUNIT_SRC_OUTPUT_FOLDER = "";
private static String OUTPUT_FOLDER = "";
private static String COMPILED_CLASSES_FOLDER = "";
@@ -76,11 +76,12 @@
private static String restrictTo = null; // e.g. restrict to
// "opcodes.add_double"
-
+ private static final String TARGET_JAR_ROOT_PATH = "/data/local/tmp";
+
private int testClassCnt = 0;
private int testMethodsCnt = 0;
-
-
+
+
/*
* using a linked hashmap to keep the insertion order for iterators.
* the junit suite/tests adding order is used to generate the order of the
@@ -112,9 +113,9 @@
CLASSES_OUTPUT_FOLDER = MAIN_SRC_OUTPUT_FOLDER + "/classes";
COMPILED_CLASSES_FOLDER = args[4];
-
+
HOSTJUNIT_SRC_OUTPUT_FOLDER = args[5];
- HOSTJUNIT_CLASSES_OUTPUT_FOLDER = HOSTJUNIT_SRC_OUTPUT_FOLDER
+ HOSTJUNIT_CLASSES_OUTPUT_FOLDER = HOSTJUNIT_SRC_OUTPUT_FOLDER
+ "/classes";
if (args.length > 6) {
@@ -192,12 +193,14 @@
}
li.add(method);
}
-
+
private static final String ctsAllTestsB =
"package dot.junit;\n" +
"import junit.framework.Test;\n" +
"import junit.framework.TestSuite;\n" +
- "public class AllJunitHostTests {\n" +
+ "import com.android.hosttest.DeviceTestSuite;\n" +
+ "\n" +
+ "public class AllJunitHostTests extends DeviceTestSuite {\n" +
" public static final Test suite() {\n" +
" TestSuite suite = new TestSuite(\"CTS Host tests for all " +
" dalvik vm opcodes\");\n";
@@ -212,7 +215,7 @@
private String curAllTestsData = ctsAllTestsB;
private String curJunitFileName = null;
private String curJunitFileData = "";
-
+
private JavacBuildStep javacHostJunitBuildStep;
private void flushHostJunitFile() {
@@ -228,7 +231,7 @@
curJunitFileData = "";
}
}
-
+
private void ctsFinish() {
flushHostJunitFile();
curAllTestsData+="return suite;\n}\n}\n";
@@ -241,78 +244,77 @@
javacHostJunitBuildStep.addSourceFile(new File(
HOSTJUNIT_SRC_OUTPUT_FOLDER + "/dot/junit/DeviceUtil.java").
getAbsolutePath());
-
}
-
+
private void openCTSHostFileFor(String pName, String classOnlyName) {
String sourceName = "JUnit_"+classOnlyName;
// Add to AllTests.java
- String suiteline = "suite.addTestSuite("+pName+"." + sourceName +
+ String suiteline = "suite.addTestSuite("+pName+"." + sourceName +
".class);\n";
curAllTestsData += suiteline;
// flush previous JunitFile
flushHostJunitFile();
// prepare current testcase-file
- curJunitFileName = HOSTJUNIT_SRC_OUTPUT_FOLDER+"/"
+ curJunitFileName = HOSTJUNIT_SRC_OUTPUT_FOLDER+"/"
+ pName.replaceAll("\\.","/")+"/"+sourceName+".java";
curJunitFileData =
"package "+pName+";\n"+
"import java.io.IOException;\n"+
"import junit.framework.TestCase;\n"+
- "import dot.junit.DeviceUtil;\n"+
- "public class "+sourceName+" extends TestCase {\n";
+ "import com.android.hosttest.DeviceTestCase;\n"+
+ "import dot.junit.DeviceUtil;\n" +
+ "\n" +
+ "public class "+sourceName+" extends DeviceTestCase {\n";
}
private String getADBPushJavaLine(String source, String target) {
- return "DeviceUtil.adbPush(\"" + source + "\", \"" + target + "\");";
+ return "DeviceUtil.adbPush(getDevice(), \"" + source + "\", \"" + target + "\");";
}
private String getADBExecJavaLine(String classpath, String mainclass) {
- return "DeviceUtil.adbExec(\"" + classpath + "\", \"" +
+ return "DeviceUtil.adbExec(getDevice(), \"" + classpath + "\", \"" +
mainclass + "\");";
}
private void addCTSHostMethod(String pName, String method, MethodData md,
Set<String> dependentTestClassNames) {
+ final String targetCoreJarPath = String.format("%s/dexcore.jar", TARGET_JAR_ROOT_PATH);
curJunitFileData+="public void "+method+ "() throws Exception {\n";
curJunitFileData+= " "+getADBPushJavaLine("dot/junit/dexcore.jar",
- "/data/dexcore.jar");
+ targetCoreJarPath);
// push class with Main jar.
String mjar = "Main_"+method+".jar";
- String mainJar = "/data/"+mjar;
+ String mainJar = String.format("%s/%s", TARGET_JAR_ROOT_PATH, mjar);
String pPath = pName.replaceAll("\\.","/");
//System.out.println("adb push "+pPath+"/"+mjar +" "+mainJar);
curJunitFileData+= " "+getADBPushJavaLine(pPath+"/"+mjar, mainJar);
// for each dependency:
// adb push dot/junit/opcodes/add_double_2addr/Main_testN2.jar
- // /data/Main_testN2.jar
- String cp = "/data/dexcore.jar:"+mainJar;
+ // /data/local/tmp/Main_testN2.jar
+ String cp = String.format("%s:%s", targetCoreJarPath, mainJar);
for (String depFqcn : dependentTestClassNames) {
int lastDotPos = depFqcn.lastIndexOf('.');
- String targetName= "/data/"+depFqcn.substring(lastDotPos +1)+".jar";
+ String targetName= String.format("%s/%s.jar", TARGET_JAR_ROOT_PATH,
+ depFqcn.substring(lastDotPos +1));
String sourceName = depFqcn.replaceAll("\\.", "/")+".jar";
//System.out.println("adb push "+sourceName+" "+targetName);
curJunitFileData+= " "+getADBPushJavaLine(sourceName, targetName);
cp+= ":"+targetName;
- // dot.junit.opcodes.invoke_interface_range.ITest
+ // dot.junit.opcodes.invoke_interface_range.ITest
// -> dot/junit/opcodes/invoke_interface_range/ITest.jar
}
//"dot.junit.opcodes.add_double_2addr.Main_testN2";
String mainclass = pName + ".Main_" + method;
curJunitFileData+= " "+getADBExecJavaLine(cp, mainclass);
- curJunitFileData+= "}\n\n";
- }
-
-
-
-
-
+ curJunitFileData+= "}\n\n";
+ }
+
private void handleTests() throws IOException {
- System.out.println("collected "+testMethodsCnt+" test methods in " +
+ System.out.println("collected "+testMethodsCnt+" test methods in " +
testClassCnt+" junit test classes");
String datafileContent = "";
Set<BuildStep> targets = new TreeSet<BuildStep>();
@@ -361,9 +363,9 @@
Set<String> dependentTestClassNames = parseTestClassName(pName,
classOnlyName, methodContent);
-
+
addCTSHostMethod(pName, method, md, dependentTestClassNames);
-
+
if (dependentTestClassNames.isEmpty()) {
continue;
@@ -410,7 +412,7 @@
char ca = method.charAt("test".length()); // either N,B,E,
// or V (VFE)
- String comment;
+ String comment;
switch (ca) {
case 'N':
comment = "Normal #" + method.substring(5);
@@ -433,8 +435,8 @@
for (String className : dependentTestClassNames) {
line += className + " ";
}
-
-
+
+
// test description
String[] pparts = pName.split("\\.");
// detail e.g. add_double
@@ -461,25 +463,25 @@
// Unescape reserved words
detail = detail.replace("opc-", "");
-
+
description = detail;
} else if ("verify".equals(type)) {
description = "verifier";
} else {
description = type + " " + detail;
- }
+ }
String details = (md.title != null ? md.title : "");
if (md.constraint != null) {
details = " Constraint " + md.constraint + ", " + details;
}
if (details.length() != 0) {
- details = details.substring(0, 1).toUpperCase()
+ details = details.substring(0, 1).toUpperCase()
+ details.substring(1);
}
-
+
line += ";" + description + ";" + comment + ";" + details;
-
+
datafileContent += line + "\n";
generateBuildStepFor(pName, method, dependentTestClassNames,
targets);
@@ -487,10 +489,10 @@
}
-
+
// write latest HOSTJUNIT generated file and AllTests.java
ctsFinish();
-
+
File scriptDataDir = new File(OUTPUT_FOLDER + "/data/");
scriptDataDir.mkdirs();
writeToFile(new File(scriptDataDir, "scriptdata"), datafileContent);
@@ -498,13 +500,13 @@
if (!javacHostJunitBuildStep.build()) {
System.out.println("main javac cts-host-hostjunit-classes build " +
"step failed");
- System.exit(1);
+ System.exit(1);
}
-
+
if (javacBuildStep.build()) {
for (BuildStep buildStep : targets) {
if (!buildStep.build()) {
- System.out.println("building failed. buildStep: " +
+ System.out.println("building failed. buildStep: " +
buildStep.getClass().getName()+", "+buildStep);
System.exit(1);
}
@@ -530,7 +532,7 @@
File sourceFolder = new File(JAVASRC_FOLDER);
String fileName = dependentTestClassName.replace('.', '/').trim();
-
+
if (new File(sourceFolder, fileName + ".dfh").exists()) {
BuildStep.BuildFile inputFile = new BuildStep.BuildFile(
@@ -679,7 +681,6 @@
+ ".java";
File f = new File(absPath);
-
Scanner scanner;
try {
scanner = new Scanner(f);
@@ -730,6 +731,9 @@
}
}
}
+ if (reader != null) {
+ reader.close();
+ }
} catch (Exception e) {
throw new RuntimeException("failed to parse", e);
}
@@ -786,18 +790,24 @@
md.methodBody = builder.toString();
md.constraint = constraint;
md.title = title;
+ if (scanner != null) {
+ scanner.close();
+ }
+ if (scanner2 != null) {
+ scanner.close();
+ }
return md;
}
private void writeToFileMkdir(File file, String content) {
File parent = file.getParentFile();
if (!parent.exists() && !parent.mkdirs()) {
- throw new RuntimeException("failed to create directory: " +
+ throw new RuntimeException("failed to create directory: " +
parent.getAbsolutePath());
}
writeToFile(file, content);
- }
-
+ }
+
private void writeToFile(File file, String content) {
try {
if (file.length() == content.length()) {
diff --git a/tools/vm-tests/src/util/build/DeviceUtil.java.template b/tools/vm-tests/src/util/build/DeviceUtil.java.template
index ee2995c..4d634d1 100644
--- a/tools/vm-tests/src/util/build/DeviceUtil.java.template
+++ b/tools/vm-tests/src/util/build/DeviceUtil.java.template
@@ -1,10 +1,14 @@
package dot.junit;
+
+import com.android.ddmlib.IDevice;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
import java.util.Scanner;
public class DeviceUtil {
@@ -86,20 +90,19 @@
}
return f.getAbsolutePath();
}
-
- public static void adbPush(String source, String target)
+
+ public static void adbPush(IDevice device, String source, String target)
throws IOException {
- DeviceUtil.digestCommand(new String[] {"adb", "push",
+ DeviceUtil.digestCommand(new String[] {"adb", "-s", device.getSerialNumber(), "push",
DeviceUtil.createFilePath(source), target}, null);
}
- public static void adbExec(String classpath, String mainclass) {
- DeviceUtil.digestCommand(new String[] {"adb", "shell",
- "dalvikvm", "-Xint:portable", "-Xmx512M",
- "-Xss32K", "-Djava.io.tmpdir=/data/local/tmp",
- "-classpath", classpath, mainclass,
- "&&", "echo", "mk_dalvikvmok" }, "mk_dalvikvmok");
+ public static void adbExec(IDevice device, String classpath, String mainclass) {
+ DeviceUtil.digestCommand(new String[] {"adb", "-s", device.getSerialNumber(), "shell",
+ "mkdir", "/data/local/tmp/dalvik-cache"}, null);
+ DeviceUtil.digestCommand(new String[] {"adb", "-s", device.getSerialNumber(), "shell",
+ "ANDROID_DATA=/data/local/tmp", "dalvikvm", "-Xint:portable", "-Xmx512M", "-Xss32K",
+ "-Djava.io.tmpdir=/data/local/tmp", "-classpath", classpath, mainclass, "&&",
+ "echo", "mk_dalvikvmok" }, "mk_dalvikvmok");
}
-
-
-}
+ }