diff options
Diffstat (limited to 'lint/cli')
6 files changed, 82 insertions, 0 deletions
diff --git a/lint/cli/src/test/java/com/android/tools/lint/checks/ApiDetectorTest.java b/lint/cli/src/test/java/com/android/tools/lint/checks/ApiDetectorTest.java index 1d8cdc8..43d3727 100644 --- a/lint/cli/src/test/java/com/android/tools/lint/checks/ApiDetectorTest.java +++ b/lint/cli/src/test/java/com/android/tools/lint/checks/ApiDetectorTest.java @@ -60,6 +60,19 @@ public class ApiDetectorTest extends AbstractCheckTest { )); } + public void testAttrWithoutSlash() throws Exception { + assertEquals("" + + "res/layout/divider.xml:7: Error: ?android:dividerHorizontal requires API level 11 (current min is 1) [NewApi]\n" + + " android:divider=\"?android:dividerHorizontal\"\n" + + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + + "1 errors, 0 warnings\n", + + lintProject( + "apicheck/minsdk1.xml=>AndroidManifest.xml", + "apicheck/divider.xml=>res/layout/divider.xml" + )); + } + public void testXmlApi14() throws Exception { assertEquals( "No warnings.", diff --git a/lint/cli/src/test/java/com/android/tools/lint/checks/TranslationDetectorTest.java b/lint/cli/src/test/java/com/android/tools/lint/checks/TranslationDetectorTest.java index f13cff1..ee1a2f2 100644 --- a/lint/cli/src/test/java/com/android/tools/lint/checks/TranslationDetectorTest.java +++ b/lint/cli/src/test/java/com/android/tools/lint/checks/TranslationDetectorTest.java @@ -209,4 +209,15 @@ public class TranslationDetectorTest extends AbstractCheckTest { "res/values-es/strings_locale.xml=>res/values/strings.xml", "res/values-es-rUS/strings.xml")); } + + public void testAnalytics() throws Exception { + // See http://code.google.com/p/android/issues/detail?id=43070 + assertEquals( + "No warnings.", + + lintProject( + "res/values/analytics.xml", + "res/values-es/donottranslate.xml" // to make app multilingual + )); + } } diff --git a/lint/cli/src/test/java/com/android/tools/lint/checks/ViewConstructorDetectorTest.java b/lint/cli/src/test/java/com/android/tools/lint/checks/ViewConstructorDetectorTest.java index 5517646..a84a74f 100644 --- a/lint/cli/src/test/java/com/android/tools/lint/checks/ViewConstructorDetectorTest.java +++ b/lint/cli/src/test/java/com/android/tools/lint/checks/ViewConstructorDetectorTest.java @@ -61,4 +61,16 @@ public class ViewConstructorDetectorTest extends AbstractCheckTest { "bin/classes/test/pkg/Intermediate$IntermediateCustomV.class" )); } + + public void testAbstract() throws Exception { + assertEquals( + "No warnings.", + + lintProject( + "bytecode/.classpath=>.classpath", + "bytecode/AndroidManifest.xml=>AndroidManifest.xml", + "bytecode/AbstractCustomView.java.txt=>src/test/bytecode/AbstractCustomView.java", + "bytecode/AbstractCustomView.class.data=>bin/classes/test/bytecode/AbstractCustomView.class" + )); + } } diff --git a/lint/cli/src/test/java/com/android/tools/lint/checks/data/apicheck/divider.xml b/lint/cli/src/test/java/com/android/tools/lint/checks/data/apicheck/divider.xml new file mode 100644 index 0000000..4244319 --- /dev/null +++ b/lint/cli/src/test/java/com/android/tools/lint/checks/data/apicheck/divider.xml @@ -0,0 +1,37 @@ +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:divider="?android:dividerHorizontal" + android:orientation="horizontal" + android:showDividers="middle" + tools:context=".ItemListActivity" > + + <!-- + This layout is a two-pane layout for the Items + master/detail flow. See res/values-large/refs.xml and + res/values-sw600dp/refs.xml for an example of layout aliases + that replace the single-pane version of the layout with + this two-pane version. + + For more on layout aliases, see: + http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters + --> + + <fragment + android:id="@+id/item_list" + android:name="com.example.master.ItemListFragment" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + tools:layout="@android:layout/list_content" /> + + <FrameLayout + android:id="@+id/item_detail_container" + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="3" /> + +</LinearLayout> diff --git a/lint/cli/src/test/java/com/android/tools/lint/checks/data/bytecode/AbstractCustomView.class.data b/lint/cli/src/test/java/com/android/tools/lint/checks/data/bytecode/AbstractCustomView.class.data Binary files differnew file mode 100644 index 0000000..8dc3dc6 --- /dev/null +++ b/lint/cli/src/test/java/com/android/tools/lint/checks/data/bytecode/AbstractCustomView.class.data diff --git a/lint/cli/src/test/java/com/android/tools/lint/checks/data/bytecode/AbstractCustomView.java.txt b/lint/cli/src/test/java/com/android/tools/lint/checks/data/bytecode/AbstractCustomView.java.txt new file mode 100644 index 0000000..aedbafd --- /dev/null +++ b/lint/cli/src/test/java/com/android/tools/lint/checks/data/bytecode/AbstractCustomView.java.txt @@ -0,0 +1,9 @@ +package test.pkg; + +import android.view.View; + +public abstract class AbstractCustomView extends View { + public AbstractCustomView() { + super(null); + } +} |