am a241f99b: Add tests for decoding mono files
* commit 'a241f99b36f2e5431260c91fe6a2f2b6cded163b':
Add tests for decoding mono files
diff --git a/apps/CtsVerifier/include/colorchecker/vec2.h b/apps/CtsVerifier/include/colorchecker/vec2.h
index 9de614c..e58255d 100644
--- a/apps/CtsVerifier/include/colorchecker/vec2.h
+++ b/apps/CtsVerifier/include/colorchecker/vec2.h
@@ -41,12 +41,9 @@
}
inline Vec2<float> operator/ (const int param) const {
- Vec2<float> temp();
assert(param != 0);
- temp.set(static_cast<float>(mX) / static_cast<float>(param),
- static_cast<float>(mY) / static_cast<float>(param));
-
- return temp;
+ return Vec2<float>(static_cast<float>(mX) / static_cast<float>(param),
+ static_cast<float>(mY) / static_cast<float>(param));
}
template <class U>
diff --git a/tests/res/layout/textview_layout.xml b/tests/res/layout/textview_layout.xml
index 1437be9..512184f 100644
--- a/tests/res/layout/textview_layout.xml
+++ b/tests/res/layout/textview_layout.xml
@@ -33,6 +33,7 @@
android:textColorHint="@drawable/red"
android:textColorLink="@drawable/blue"
android:textScaleX="1.2"
+ android:typeface="normal"
android:textSize="20px"
android:textStyle="normal"
android:layout_width="wrap_content"
diff --git a/tests/tests/animation/src/android/animation/cts/ValueAnimatorTest.java b/tests/tests/animation/src/android/animation/cts/ValueAnimatorTest.java
index 3a28fe8..5451472 100644
--- a/tests/tests/animation/src/android/animation/cts/ValueAnimatorTest.java
+++ b/tests/tests/animation/src/android/animation/cts/ValueAnimatorTest.java
@@ -242,29 +242,29 @@
}
return values;
}
- private void startAnimation(final ValueAnimator mValueAnimator) throws Throwable {
- this.runTestOnUiThread(new Runnable(){
+
+ private void startAnimation(final ValueAnimator animator) throws Throwable {
+ this.runTestOnUiThread(new Runnable() {
public void run() {
- mActivity.startAnimation(mValueAnimator);
+ mActivity.startAnimation(animator);
}
});
}
- private void endAnimation(final ValueAnimator mValueAnimator) throws Throwable {
- Thread animationRunnable = new Thread() {
+
+ private void endAnimation(final ValueAnimator animator) throws Throwable {
+ this.runTestOnUiThread(new Runnable() {
public void run() {
- mValueAnimator.end();
+ animator.end();
}
- };
- this.runTestOnUiThread(animationRunnable);
+ });
}
- private void cancelAnimation(final ValueAnimator mValueAnimator) throws Throwable {
- Thread animationRunnable = new Thread() {
+ private void cancelAnimation(final ValueAnimator animator) throws Throwable {
+ this.runTestOnUiThread(new Runnable() {
public void run() {
- mValueAnimator.cancel();
+ animator.cancel();
}
- };
- this.runTestOnUiThread(animationRunnable);
+ });
}
private String errorMessage(float[] values) {
diff --git a/tests/tests/app/Android.mk b/tests/tests/app/Android.mk
index d61b87a6..8d5877d 100644
--- a/tests/tests/app/Android.mk
+++ b/tests/tests/app/Android.mk
@@ -21,7 +21,7 @@
# and when built explicitly put it in the data partition
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common
LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
diff --git a/tests/tests/app/src/android/app/cts/ApplicationTest.java b/tests/tests/app/src/android/app/cts/ApplicationTest.java
index d48d53a..99cc8ba 100644
--- a/tests/tests/app/src/android/app/cts/ApplicationTest.java
+++ b/tests/tests/app/src/android/app/cts/ApplicationTest.java
@@ -22,6 +22,7 @@
import android.app.Instrumentation;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.test.InstrumentationTestCase;
/**
@@ -41,6 +42,13 @@
assertTrue(mockApp.isConstructorCalled);
assertTrue(mockApp.isOnCreateCalled);
+ //skip if the device doesn't support both of portrait and landscape orientation screens.
+ final PackageManager pm = targetContext.getPackageManager();
+ if(!(pm.hasSystemFeature(PackageManager.FEATURE_SCREEN_LANDSCAPE)
+ && pm.hasSystemFeature(PackageManager.FEATURE_SCREEN_PORTRAIT))){
+ return;
+ }
+
runTestOnUiThread(new Runnable() {
public void run() {
OrientationTestUtils.toggleOrientation(activity);
diff --git a/tests/tests/app/src/android/app/cts/DialogTest.java b/tests/tests/app/src/android/app/cts/DialogTest.java
index 57ae218..1f6e2ab 100644
--- a/tests/tests/app/src/android/app/cts/DialogTest.java
+++ b/tests/tests/app/src/android/app/cts/DialogTest.java
@@ -25,6 +25,7 @@
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.DialogInterface.OnKeyListener;
+import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.cts.util.PollingCheck;
@@ -205,6 +206,13 @@
assertFalse(d.isOnSaveInstanceStateCalled);
assertFalse(TestDialog.isOnRestoreInstanceStateCalled);
+ //skip if the device doesn't support both of portrait and landscape orientation screens.
+ final PackageManager pm = mContext.getPackageManager();
+ if(!(pm.hasSystemFeature(PackageManager.FEATURE_SCREEN_LANDSCAPE)
+ && pm.hasSystemFeature(PackageManager.FEATURE_SCREEN_PORTRAIT))){
+ return;
+ }
+
OrientationTestUtils.toggleOrientationSync(mActivity, mInstrumentation);
assertTrue(d.isOnSaveInstanceStateCalled);
diff --git a/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutTest.java b/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutTest.java
index d4c3611..f0372e9 100644
--- a/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutTest.java
+++ b/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutTest.java
@@ -24,6 +24,7 @@
import android.test.ActivityInstrumentationTestCase2;
import android.util.DisplayMetrics;
import android.view.Display;
+import android.view.ViewConfiguration;
import android.view.WindowManager;
public class ConfigurationScreenLayoutTest
@@ -45,6 +46,9 @@
int expectedSize = expectedScreenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
int expectedLong = expectedScreenLayout & Configuration.SCREENLAYOUT_LONG_MASK;
+ // Check if the device has the navigation bar.
+ boolean navigationBar = hasNavigationBar();
+
// Check that all four orientations report the same configuration value.
for (int i = 0; i < ORIENTATIONS.length; i++) {
Activity activity = startOrientationActivity(ORIENTATIONS[i]);
@@ -52,6 +56,15 @@
int actualSize = mConfig.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
int actualLong = mConfig.screenLayout & Configuration.SCREENLAYOUT_LONG_MASK;
+ if (navigationBar) {
+ // Update screenLayout value if the device has the navigation bar.
+ expectedScreenLayout = reduceScreenLayout(activity,
+ Configuration.SCREENLAYOUT_SIZE_XLARGE
+ | Configuration.SCREENLAYOUT_LONG_YES);
+ expectedSize = expectedScreenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
+ expectedLong = expectedScreenLayout & Configuration.SCREENLAYOUT_LONG_MASK;
+ }
+
assertEquals("Expected screen size value of " + expectedSize + " but got " + actualSize
+ " for orientation " + ORIENTATIONS[i], expectedSize, actualSize);
assertEquals("Expected screen long value of " + expectedLong + " but got " + actualLong
@@ -80,6 +93,11 @@
return screenLayout;
}
+ private boolean hasNavigationBar() {
+ // Check if the device has a permanent menu key available.
+ return !ViewConfiguration.get(getActivity()).hasPermanentMenuKey();
+ }
+
private Activity startOrientationActivity(int orientation) {
Intent intent = new Intent();
intent.putExtra(OrientationActivity.EXTRA_ORIENTATION, orientation);
diff --git a/tests/tests/location/src/android/location/cts/LocationManagerTest.java b/tests/tests/location/src/android/location/cts/LocationManagerTest.java
index bee0671..46e777f 100755
--- a/tests/tests/location/src/android/location/cts/LocationManagerTest.java
+++ b/tests/tests/location/src/android/location/cts/LocationManagerTest.java
@@ -38,6 +38,7 @@
import java.lang.Thread;
import java.util.List;
+import java.lang.Thread;
/**
* Requires the permissions
diff --git a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
index 99d2e43..4fa69a8 100644
--- a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
+++ b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
@@ -120,9 +120,14 @@
invalidateFeature));
}
- // Should return failure(-1) because MMS is not supported on WIFI.
- assertEquals(failureCode, mCm.startUsingNetworkFeature(TYPE_WIFI, mmsFeature));
- assertEquals(failureCode, mCm.stopUsingNetworkFeature(TYPE_WIFI, mmsFeature));
+ ni = mCm.getNetworkInfo(TYPE_WIFI);
+ if (ni != null) {
+ // Should return failure(-1) because MMS is not supported on WIFI.
+ assertEquals(failureCode, mCm.startUsingNetworkFeature(TYPE_WIFI,
+ mmsFeature));
+ assertEquals(failureCode, mCm.stopUsingNetworkFeature(TYPE_WIFI,
+ mmsFeature));
+ }
}
public void testRequestRouteToHost() {
diff --git a/tests/tests/permission/Android.mk b/tests/tests/permission/Android.mk
index db67bf4..07f20d8 100644
--- a/tests/tests/permission/Android.mk
+++ b/tests/tests/permission/Android.mk
@@ -19,7 +19,7 @@
LOCAL_MODULE_TAGS := tests
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common
LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
diff --git a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
index 695e6e7..3b323f5 100644
--- a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
@@ -376,6 +376,7 @@
"/data/local/tmp",
"/data/local/tmp/com.nuance.android.vsuite.vsuiteapp",
"/data/log",
+ "/data/logger",
"/data/lost+found",
"/data/misc",
"/data/misc/bluetooth",
diff --git a/tests/tests/permission2/Android.mk b/tests/tests/permission2/Android.mk
index 8e3d8a1..86a8bc7 100755
--- a/tests/tests/permission2/Android.mk
+++ b/tests/tests/permission2/Android.mk
@@ -19,7 +19,7 @@
LOCAL_MODULE_TAGS := tests
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common mms-common
LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
diff --git a/tests/tests/provider/src/android/provider/cts/MediaStore_Audio_PlaylistsTest.java b/tests/tests/provider/src/android/provider/cts/MediaStore_Audio_PlaylistsTest.java
index 19fa2e1..0d36212 100644
--- a/tests/tests/provider/src/android/provider/cts/MediaStore_Audio_PlaylistsTest.java
+++ b/tests/tests/provider/src/android/provider/cts/MediaStore_Audio_PlaylistsTest.java
@@ -114,9 +114,16 @@
values.put(Playlists.DATE_ADDED, dateAdded);
long dateModified = System.currentTimeMillis();
values.put(Playlists.DATE_MODIFIED, dateModified);
+ // insert
Uri uri = mContentResolver.insert(Playlists.INTERNAL_CONTENT_URI, values);
assertNotNull(uri);
- assertTrue(Pattern.matches("content://media/internal/audio/playlists/\\d+",
- uri.toString()));
+
+ try {
+ assertTrue(Pattern.matches("content://media/internal/audio/playlists/\\d+",
+ uri.toString()));
+ } finally {
+ // delete the playlists
+ assertEquals(1, mContentResolver.delete(uri, null, null));
+ }
}
}
diff --git a/tests/tests/provider/src/android/provider/cts/MediaStore_Audio_Playlists_MembersTest.java b/tests/tests/provider/src/android/provider/cts/MediaStore_Audio_Playlists_MembersTest.java
index 9ae42ae..aa524aa 100644
--- a/tests/tests/provider/src/android/provider/cts/MediaStore_Audio_Playlists_MembersTest.java
+++ b/tests/tests/provider/src/android/provider/cts/MediaStore_Audio_Playlists_MembersTest.java
@@ -456,9 +456,16 @@
values.put(Playlists.DATE_ADDED, dateAdded);
long dateModified = System.currentTimeMillis();
values.put(Playlists.DATE_MODIFIED, dateModified);
+ // insert
Uri uri = mContentResolver.insert(Playlists.INTERNAL_CONTENT_URI, values);
assertNotNull(uri);
- assertTrue(Pattern.matches("content://media/internal/audio/playlists/\\d+",
- uri.toString()));
+
+ try {
+ assertTrue(Pattern.matches("content://media/internal/audio/playlists/\\d+",
+ uri.toString()));
+ } finally {
+ // delete the playlists
+ assertEquals(1, mContentResolver.delete(uri, null, null));
+ }
}
}
diff --git a/tests/tests/security/src/android/security/cts/CertificateData.java b/tests/tests/security/src/android/security/cts/CertificateData.java
index c3f1901..1714461 100644
--- a/tests/tests/security/src/android/security/cts/CertificateData.java
+++ b/tests/tests/security/src/android/security/cts/CertificateData.java
@@ -41,6 +41,7 @@
"43:F9:B1:10:D5:BA:FD:48:22:52:31:B0:D0:08:2B:37:2F:EF:9A:54",
"F4:8B:11:BF:DE:AB:BE:94:54:20:71:E6:41:DE:6B:BE:88:2B:40:B9",
"96:56:CD:7B:57:96:98:95:D0:E1:41:46:68:06:FB:B8:C6:11:06:87",
+ "55:A6:72:3E:CB:F2:EC:CD:C3:23:74:70:19:9D:2A:BE:11:E3:81:D1",
"D6:9B:56:11:48:F0:1C:77:C5:45:78:C1:09:26:DF:5B:85:69:76:AD",
"78:6A:74:AC:76:AB:14:7F:9C:6A:30:50:BA:9E:A8:7E:FE:9A:CE:3C",
"27:96:BA:E6:3F:18:01:E2:77:26:1B:A0:D7:77:70:02:8F:20:EE:E4",
diff --git a/tests/tests/security/src/android/security/cts/SqliteJournalLeakTest.java b/tests/tests/security/src/android/security/cts/SqliteJournalLeakTest.java
old mode 100644
new mode 100755
diff --git a/tests/tests/telephony/Android.mk b/tests/tests/telephony/Android.mk
index 519f44a..e7a3336 100644
--- a/tests/tests/telephony/Android.mk
+++ b/tests/tests/telephony/Android.mk
@@ -22,7 +22,7 @@
# and when built explicitly put it in the data partition
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common mms-common
LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
diff --git a/tests/tests/telephony/src/android/telephony/cts/SmsManagerTest.java b/tests/tests/telephony/src/android/telephony/cts/SmsManagerTest.java
index 4808bc0..3055e44 100755
--- a/tests/tests/telephony/src/android/telephony/cts/SmsManagerTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/SmsManagerTest.java
@@ -76,6 +76,8 @@
"44076", // KDDI
"311870", // Boost Mobile
"311220", // USCC
+ "311225", // USCC LTE
+ "311580", // USCC LTE
"302720", // Rogers
"30272", // Rogers
"302370", // Fido
@@ -85,6 +87,7 @@
"46003", // China Telecom
"311230", // C SPire Wireless + Celluar South
"310600", // Cellcom
+ "31000", // Republic Wireless US
// Verizon
"310004",
"310012",
diff --git a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
index 0055330..3223573 100644
--- a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
@@ -16,9 +16,9 @@
package android.telephony.cts;
-
import android.content.Context;
import android.content.pm.PackageManager;
+import android.net.ConnectivityManager;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
@@ -29,6 +29,8 @@
import android.telephony.TelephonyManager;
import android.test.AndroidTestCase;
+import com.android.internal.telephony.PhoneConstants;
+
import java.util.regex.Pattern;
public class TelephonyManagerTest extends AndroidTestCase {
@@ -38,12 +40,14 @@
private static final int TOLERANCE = 1000;
private Looper mLooper;
private PhoneStateListener mListener;
+ private static ConnectivityManager mCm;
@Override
protected void setUp() throws Exception {
super.setUp();
mTelephonyManager =
(TelephonyManager)getContext().getSystemService(Context.TELEPHONY_SERVICE);
+ mCm = (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
}
@Override
@@ -165,12 +169,23 @@
break;
case TelephonyManager.PHONE_TYPE_CDMA:
- assertCdmaDeviceId(deviceId);
+ // LTE device is using IMEI as device id
+ if (mTelephonyManager.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE) {
+ assertGsmDeviceId(deviceId);
+ } else {
+ assertCdmaDeviceId(deviceId);
+ }
break;
case TelephonyManager.PHONE_TYPE_NONE:
- assertSerialNumber();
- assertMacAddressReported();
+ boolean nwSupported = mCm.isNetworkSupported(mCm.TYPE_WIFI);
+ if (nwSupported) {
+ assertSerialNumber();
+ assertMacAddressReported();
+ } else {
+ nwSupported = mCm.isNetworkSupported(mCm.TYPE_ETHERNET);
+ assertTrue(nwSupported);
+ }
break;
default:
diff --git a/tests/tests/text/src/android/text/cts/AutoTextTest.java b/tests/tests/text/src/android/text/cts/AutoTextTest.java
index 1f2d1da..cbea4d9 100644
--- a/tests/tests/text/src/android/text/cts/AutoTextTest.java
+++ b/tests/tests/text/src/android/text/cts/AutoTextTest.java
@@ -20,6 +20,7 @@
import android.test.AndroidTestCase;
import android.text.AutoText;
import android.view.View;
+import android.content.res.Configuration;
public class AutoTextTest extends AndroidTestCase {
@@ -30,6 +31,11 @@
// set local as English.
Locale.setDefault(Locale.ENGLISH);
+ Configuration config = getContext().getResources().getConfiguration();
+ if (!config.locale.equals(Locale.getDefault())) {
+ config.locale = Locale.getDefault();
+ getContext().getResources().updateConfiguration(config, null);
+ }
// New a View instance.
View view = new View(getContext());
@@ -71,6 +77,11 @@
public void testGetSize() {
Locale.setDefault(Locale.ENGLISH);
+ Configuration config = getContext().getResources().getConfiguration();
+ if (!config.locale.equals(Locale.getDefault())) {
+ config.locale = Locale.getDefault();
+ getContext().getResources().updateConfiguration(config, null);
+ }
View view = new View(getContext());
// Returns the size of the auto text dictionary. Just make sure it is bigger than 0.
assertTrue(AutoText.getSize(view) > 0);
diff --git a/tests/tests/view/src/android/view/animation/cts/AnimationUtilsTest.java b/tests/tests/view/src/android/view/animation/cts/AnimationUtilsTest.java
index e2fe6f35..cddbfdf 100644
--- a/tests/tests/view/src/android/view/animation/cts/AnimationUtilsTest.java
+++ b/tests/tests/view/src/android/view/animation/cts/AnimationUtilsTest.java
@@ -91,6 +91,10 @@
long time2 = 0L;
for (int i = 0; i < 1000 && time1 >= time2; i++) {
time2 = AnimationUtils.currentAnimationTimeMillis();
+ try {
+ Thread.sleep(1);
+ } catch (java.lang.InterruptedException e) {
+ }
assertTrue(time2 > 0);
}
assertTrue(time2 > time1);
diff --git a/tests/tests/view/src/android/view/cts/KeyEventTest.java b/tests/tests/view/src/android/view/cts/KeyEventTest.java
old mode 100644
new mode 100755
index 7c1f1c7..61d7d92
--- a/tests/tests/view/src/android/view/cts/KeyEventTest.java
+++ b/tests/tests/view/src/android/view/cts/KeyEventTest.java
@@ -105,7 +105,6 @@
assertEquals(0, keyData.number);
assertEquals('z', keyData.meta[0]);
assertEquals('Z', keyData.meta[1]);
- assertEquals(0, keyData.meta[2]);
assertEquals(0, keyData.meta[3]);
}
diff --git a/tests/tests/widget/src/android/widget/cts/AbsListViewTest.java b/tests/tests/widget/src/android/widget/cts/AbsListViewTest.java
index 72150f2..7fa2d2f 100644
--- a/tests/tests/widget/src/android/widget/cts/AbsListViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/AbsListViewTest.java
@@ -57,6 +57,8 @@
"This", "is", "short", "!",
};
private final String[] mCountryList = new String[] {
+ "Argentina", "Australia", "China", "France", "Germany", "Italy", "Japan", "United States",
+ "Argentina", "Australia", "China", "France", "Germany", "Italy", "Japan", "United States",
"Argentina", "Australia", "China", "France", "Germany", "Italy", "Japan", "United States"
};
diff --git a/tests/tests/widget/src/android/widget/cts/TextViewTest.java b/tests/tests/widget/src/android/widget/cts/TextViewTest.java
index aba2293..e295c40 100755
--- a/tests/tests/widget/src/android/widget/cts/TextViewTest.java
+++ b/tests/tests/widget/src/android/widget/cts/TextViewTest.java
@@ -1797,7 +1797,7 @@
assertEquals(20f, mTextView.getTextSize(), 0.01f);
// getTypeface
- // getTypeface will be null if android:typeface is not set or is set to normal,
+ // getTypeface will be null if android:typeface is set to normal,
// and android:style is not set or is set to normal
assertNull(mTextView.getTypeface());
diff --git a/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java b/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java
index 2a2bb23..76193ac 100644
--- a/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java
+++ b/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java
@@ -76,7 +76,7 @@
private String getClassPath() {
List<String> classPath = new ArrayList<String>();
- classPath.add("./prebuilt/common/tradefed/tradefed-prebuilt.jar");
+ classPath.add("./prebuilts/misc/common/tradefed/tradefed-prebuilt.jar");
return join(classPath, ":");
}
diff --git a/tools/vm-tests-tf/Android.mk b/tools/vm-tests-tf/Android.mk
index 07a3cf8..44dac66 100644
--- a/tools/vm-tests-tf/Android.mk
+++ b/tools/vm-tests-tf/Android.mk
@@ -14,18 +14,13 @@
LOCAL_PATH := $(call my-dir)
-define all-src-files
-$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find src -name '*.java'))
-endef
-
# buildutil java library
# ============================================================
include $(CLEAR_VARS)
LOCAL_TEST_TYPE := vmHostTest
-LOCAL_JAR_PATH := android.core.vm-tests-tf.jar
-LOCAL_SRC_FILES := $(call all-src-files)
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_MODULE := cts-tf-dalvik-buildutil
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
@@ -36,76 +31,37 @@
include $(BUILD_HOST_JAVA_LIBRARY)
-$(LOCAL_BUILT_MODULE): PRIVATE_CLASS_INTERMEDIATES_DIR := $(intermediates)/classes
+# Buid android.core.vm-tests-tf.jar
+# ============================================================
+#
+intermediates := $(call intermediates-dir-for,JAVA_LIBRARIES,vm-tests-tf,HOST)
+vmteststf_jar := $(intermediates)/android.core.vm-tests-tf.jar
+vmteststf_dep_jars := $(addprefix $(HOST_OUT_JAVA_LIBRARIES)/, cts-tf-dalvik-buildutil.jar dasm.jar dx.jar cfassembler.jar junit.jar)
+$(vmteststf_jar): PRIVATE_SRC_FOLDER := $(LOCAL_PATH)/src
+$(vmteststf_jar): PRIVATE_LIB_FOLDER := $(LOCAL_PATH)/lib
+$(vmteststf_jar): PRIVATE_INTERMEDIATES_CLASSES := $(call intermediates-dir-for,JAVA_LIBRARIES,cts-tf-dalvik-buildutil,HOST)/classes
+$(vmteststf_jar): PRIVATE_INTERMEDIATES := $(intermediates)/tests
+$(vmteststf_jar): PRIVATE_INTERMEDIATES_DEXCORE_JAR := $(intermediates)/tests/dot/junit/dexcore.jar
+$(vmteststf_jar): PRIVATE_INTERMEDIATES_MAIN_FILES := $(intermediates)/main_files
+$(vmteststf_jar): PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES := $(intermediates)/hostjunit_files
+$(vmteststf_jar): PRIVATE_CLASS_PATH := $(subst $(space),:,$(vmteststf_dep_jars)):$(HOST_JDK_TOOLS_JAR)
+$(vmteststf_jar) : $(vmteststf_dep_jars) $(HOST_OUT_JAVA_LIBRARIES)/tradefed-prebuilt.jar
+ $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@)
+ $(hide) mkdir -p $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES)/dot/junit $(dir $(PRIVATE_INTERMEDIATES_DEXCORE_JAR))
+ # generated and compile the host side junit tests
+ @echo "Write generated Main_*.java files to $(PRIVATE_INTERMEDIATES_MAIN_FILES)"
+ $(hide) java -cp $(PRIVATE_CLASS_PATH) util.build.BuildDalvikSuite $(PRIVATE_SRC_FOLDER) $(PRIVATE_INTERMEDIATES) \
+ $(HOST_OUT_JAVA_LIBRARIES)/cts-tf-dalvik-buildutil.jar:$(PRIVATE_LIB_FOLDER)/junit.jar:$(HOST_OUT_JAVA_LIBRARIES)/tradefed-prebuilt.jar \
+ $(PRIVATE_INTERMEDIATES_MAIN_FILES) $(PRIVATE_INTERMEDIATES_CLASSES) $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES) $$RUN_VM_TESTS_RTO
+ @echo "Generate $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)"
+ $(hide) jar -cf $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).jar \
+ $(addprefix -C $(PRIVATE_INTERMEDIATES_CLASSES) , dot/junit/DxUtil.class dot/junit/DxAbstractMain.class)
+ $(hide) $(DX) -JXms16M -JXmx768M --dex --output=$(PRIVATE_INTERMEDIATES_DEXCORE_JAR) \
+ $(if $(NO_OPTIMIZE_DX), --no-optimize) $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).jar && rm -f $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).jar
+ $(hide) cd $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES)/classes && zip -q -r ../../android.core.vm-tests-tf.jar .
+ $(hide) cd $(dir $@) && zip -q -r android.core.vm-tests-tf.jar tests
-TF_BUILD_UTIL_INTERMEDIATES_CLASSES := $(intermediates)/classes
-
-include $(CLEAR_VARS)
-
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE := vm-tests-tf
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SYSTEM)/base_rules.mk
-
-GENERATED_FILES:=$(intermediates)/tests
-
-$(LOCAL_BUILT_MODULE): $(GENERATED_FILES)
-
-colon:= :
-empty:=
-space:= $(empty) $(empty)
-
-
-$(GENERATED_FILES): PRIVATE_SRC_FOLDER := $(LOCAL_PATH)/src
-$(GENERATED_FILES): PRIVATE_LIB_FOLDER := $(LOCAL_PATH)/lib
-$(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-tf-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)/junit.jar
-
- $(hide) mkdir -p $@
- $(hide) mkdir -p $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES)/dot/junit
-# 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:$(HOST_OUT_JAVA_LIBRARIES)/tradefed-prebuilt.jar $(PRIVATE_INTERMEDIATES_MAIN_FILES) $(TF_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_tf/timestamp
-
-$(LOCAL_BUILT_MODULE): $(INSTALLED_TESTS)
-
-$(INSTALLED_TESTS): PRIVATE_INTERMEDIATES := $(intermediates)/tests
-$(INSTALLED_TESTS): $(GENERATED_FILES) $(GENERATED_FILES)/dot/junit/dexcore.jar
- $(hide) mkdir -p $(dir $@)tests
- $(hide) $(ACP) -r $(PRIVATE_INTERMEDIATES)/dot $(dir $@)tests
- @touch $@
-
-$(intermediates)/android.core.vm-tests-tf.jar: PRIVATE_INTERMEDIATES := $(intermediates)
-$(intermediates)/android.core.vm-tests-tf.jar: $(INSTALLED_TESTS)
- $(hide) cd $(PRIVATE_INTERMEDIATES)/hostjunit_files/classes && \
- zip -q -r ../../android.core.vm-tests-tf.jar . && \
- cd -
- $(hide) cd $(PRIVATE_INTERMEDIATES) && \
- zip -q -r android.core.vm-tests-tf.jar tests && \
- cd -
-
-
-define get-class-path
- $(TF_BUILD_UTIL_INTERMEDIATES_CLASSES)/$(strip $(1))
-endef
-
-define dex-classes
- @mkdir -p $(dir $@)
- @jar -cf $(dir $@)/$(notdir $@).jar $(addprefix -C $(1) ,$(2))
- $(hide) $(DX) -JXms16M -JXmx768M \
- --dex --output=$@ \
- $(if $(NO_OPTIMIZE_DX), \
- --no-optimize) \
- $(dir $@)/$(notdir $@).jar
- @rm -f $(dir $@)/$(notdir $@).jar
-endef
-
-$(call get-class-path,dot/junit/DxUtil.class) $(call get-class-path,dot/junit/DxAbstractMain.class): $(HOST_OUT_JAVA_LIBRARIES)/cts-tf-dalvik-buildutil.jar $(DX)
-
-$(GENERATED_FILES)/dot/junit/dexcore.jar: $(call get-class-path,dot/junit/DxUtil.class) $(call get-class-path,dot/junit/DxAbstractMain.class)
- $(call dex-classes,$(TF_BUILD_UTIL_INTERMEDIATES_CLASSES),dot/junit/DxUtil.class dot/junit/DxAbstractMain.class)
+# Clean up temp vars
+intermediates :=
+vmteststf_jar :=
+vmteststf_dep_jars :=
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/Test_xor_int_lit8.java b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/Test_xor_int_lit8.java
index b2a3f69..a87103b 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/Test_xor_int_lit8.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/Test_xor_int_lit8.java
@@ -34,7 +34,7 @@
}
/**
- * @title Arguments = 0xfffffff8, 0xf1
+ * @title Arguments = 0xfffffff8, 0xf1 (will be sign extended)
*/
public void testN2() {
T_xor_int_lit8_2 t = new T_xor_int_lit8_2();
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_1.d b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_1.d
index cb4d830..70c51f1 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_1.d
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_1.d
@@ -28,7 +28,7 @@
.limit regs 3
const v1, 15
- xor-int/lit16 v1, v1, 8
+ xor-int/lit8 v1, v1, 8
return v1
.end method
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_2.d b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_2.d
index 8d23bf6..d471d75 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_2.d
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_2.d
@@ -28,7 +28,7 @@
.limit regs 3
const v2, -8
- xor-int/lit16 v1, v2, -15
+ xor-int/lit8 v1, v2, -15
return v1
.end method
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_3.d b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_3.d
index 5953574..f73909d 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_3.d
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_3.d
@@ -28,7 +28,7 @@
.limit regs 3
const v1, 0
- xor-int/lit16 v1, v1, -1
+ xor-int/lit8 v1, v1, -1
return v1
.end method
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_4.d b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_4.d
index c2270c4..6832299 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_4.d
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_4.d
@@ -28,7 +28,7 @@
.limit regs 3
const v1, 2147483647
- xor-int/lit16 v1, v1, -128
+ xor-int/lit8 v1, v1, -128
return v1
.end method
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_6.d b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_6.d
index b3ab7e4..b7bc40a 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_6.d
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_6.d
@@ -27,7 +27,7 @@
.method public run()I
.limit regs 3
- xor-int/lit16 v1, v2, 1
+ xor-int/lit8 v1, v2, 1
return v1
.end method
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_7.d b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_7.d
index 74bf7e5..23e9337 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_7.d
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_7.d
@@ -27,7 +27,7 @@
.method public run(F)I
.limit regs 3
- xor-int/lit16 v1, v2, 8
+ xor-int/lit8 v1, v2, 8
return v1
.end method
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_8.d b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_8.d
index 0857ea6..0fc33fc 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_8.d
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/xor_int_lit8/d/T_xor_int_lit8_8.d
@@ -27,7 +27,7 @@
.method public run(I)I
.limit regs 3
- xor-int/lit16 v1, v3, 8
+ xor-int/lit8 v1, v3, 8
return v1
.end method