Merge change 3096 into donut
* changes:
Integrate unsubmitted cupcake change 149414: CTS: added missed test cases for package android.view
diff --git a/tests/tests/text/src/android/text/style/cts/RelativeSizeSpanTest.java b/tests/tests/text/src/android/text/style/cts/RelativeSizeSpanTest.java
index 575c796..5effa7f 100644
--- a/tests/tests/text/src/android/text/style/cts/RelativeSizeSpanTest.java
+++ b/tests/tests/text/src/android/text/style/cts/RelativeSizeSpanTest.java
@@ -16,32 +16,45 @@
package android.text.style.cts;
-import junit.framework.TestCase;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.TestTargets;
+import dalvik.annotation.ToBeFixed;
+
+import android.os.Parcel;
import android.text.TextPaint;
import android.text.style.RelativeSizeSpan;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.ToBeFixed;
+
+import junit.framework.TestCase;
@TestTargetClass(RelativeSizeSpan.class)
public class RelativeSizeSpanTest extends TestCase {
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- notes = "Test constructor(s) of RelativeSizeSpan.",
- method = "RelativeSizeSpan",
- args = {float.class}
- )
+ @TestTargets({
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "RelativeSizeSpan",
+ args = {float.class}
+ ),
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "RelativeSizeSpan",
+ args = {android.os.Parcel.class}
+ )
+ })
public void testConstructor() {
- new RelativeSizeSpan(1.0f);
+ RelativeSizeSpan relativeSizeSpan = new RelativeSizeSpan(1.0f);
+
+ Parcel p = Parcel.obtain();
+ relativeSizeSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new RelativeSizeSpan(p);
new RelativeSizeSpan(-1.0f);
}
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test getSizeChange().",
method = "getSizeChange",
args = {}
)
@@ -55,12 +68,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateMeasureState(TextPaint ds).",
method = "updateMeasureState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateMeasureState() {
float proportion = 3.0f;
RelativeSizeSpan relativeSizeSpan = new RelativeSizeSpan(proportion);
@@ -87,12 +98,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateDrawState(TextPaint ds).",
method = "updateDrawState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateDrawState() {
float proportion = 3.0f;
RelativeSizeSpan relativeSizeSpan = new RelativeSizeSpan(proportion);
@@ -116,4 +125,40 @@
// expected, test success.
}
}
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "describeContents",
+ args = {}
+ )
+ public void testDescribeContents() {
+ RelativeSizeSpan relativeSizeSpan = new RelativeSizeSpan(2.0f);
+ relativeSizeSpan.describeContents();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "getSpanTypeId",
+ args = {}
+ )
+ public void testGetSpanTypeId() {
+ RelativeSizeSpan relativeSizeSpan = new RelativeSizeSpan(2.0f);
+ relativeSizeSpan.getSpanTypeId();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "writeToParcel",
+ args = {Parcel.class, int.class}
+ )
+ public void testWriteToParcel() {
+ Parcel p = Parcel.obtain();
+ float proportion = 3.0f;
+ RelativeSizeSpan relativeSizeSpan = new RelativeSizeSpan(proportion);
+ relativeSizeSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ RelativeSizeSpan newSpan = new RelativeSizeSpan(p);
+ assertEquals(proportion, newSpan.getSizeChange());
+ p.recycle();
+ }
}
diff --git a/tests/tests/text/src/android/text/style/cts/ScaleXSpanTest.java b/tests/tests/text/src/android/text/style/cts/ScaleXSpanTest.java
index 885a44a..cf2a3f4 100644
--- a/tests/tests/text/src/android/text/style/cts/ScaleXSpanTest.java
+++ b/tests/tests/text/src/android/text/style/cts/ScaleXSpanTest.java
@@ -16,37 +16,49 @@
package android.text.style.cts;
-import junit.framework.TestCase;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.TestTargets;
+import dalvik.annotation.ToBeFixed;
+
+import android.os.Parcel;
import android.text.TextPaint;
import android.text.style.ScaleXSpan;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.ToBeFixed;
+
+import junit.framework.TestCase;
@TestTargetClass(ScaleXSpan.class)
public class ScaleXSpanTest extends TestCase {
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- notes = "Test constructor(s) of ScaleXSpan.",
- method = "ScaleXSpan",
- args = {float.class}
- )
+ @TestTargets({
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "ScaleXSpan",
+ args = {float.class}
+ ),
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "ScaleXSpan",
+ args = {android.os.Parcel.class}
+ )
+ })
public void testConstructor() {
- new ScaleXSpan(1.5f);
+ ScaleXSpan scaleXSpan = new ScaleXSpan(1.5f);
+
+ Parcel p = Parcel.obtain();
+ scaleXSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new ScaleXSpan(p);
new ScaleXSpan(-2.5f);
}
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateDrawState(TextPaint ds).",
method = "updateDrawState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateDrawState() {
float proportion = 3.0f;
ScaleXSpan scaleXSpan = new ScaleXSpan(proportion);
@@ -70,12 +82,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateMeasureState(TextPaint ds).",
method = "updateMeasureState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateMeasureState() {
float proportion = 3.0f;
ScaleXSpan scaleXSpan = new ScaleXSpan(proportion);
@@ -99,10 +109,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test getScaleX().",
method = "getScaleX",
args = {}
)
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testGetScaleX() {
ScaleXSpan scaleXSpan = new ScaleXSpan(5.0f);
assertEquals(5.0f, scaleXSpan.getScaleX());
@@ -110,4 +120,40 @@
scaleXSpan = new ScaleXSpan(-5.0f);
assertEquals(-5.0f, scaleXSpan.getScaleX());
}
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "describeContents",
+ args = {}
+ )
+ public void testDescribeContents() {
+ ScaleXSpan scaleXSpan = new ScaleXSpan(5.0f);
+ scaleXSpan.describeContents();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "getSpanTypeId",
+ args = {}
+ )
+ public void testGetSpanTypeId() {
+ ScaleXSpan scaleXSpan = new ScaleXSpan(5.0f);
+ scaleXSpan.getSpanTypeId();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "writeToParcel",
+ args = {Parcel.class, int.class}
+ )
+ public void testWriteToParcel() {
+ Parcel p = Parcel.obtain();
+ float proportion = 3.0f;
+ ScaleXSpan scaleXSpan = new ScaleXSpan(proportion);
+ scaleXSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ ScaleXSpan newSpan = new ScaleXSpan(p);
+ assertEquals(proportion, newSpan.getScaleX());
+ p.recycle();
+ }
}
diff --git a/tests/tests/text/src/android/text/style/cts/StrikethroughSpanTest.java b/tests/tests/text/src/android/text/style/cts/StrikethroughSpanTest.java
index e8f58cc..e5e29ea 100644
--- a/tests/tests/text/src/android/text/style/cts/StrikethroughSpanTest.java
+++ b/tests/tests/text/src/android/text/style/cts/StrikethroughSpanTest.java
@@ -16,25 +16,47 @@
package android.text.style.cts;
-import junit.framework.TestCase;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.TestTargets;
+import dalvik.annotation.ToBeFixed;
+
+import android.os.Parcel;
import android.text.TextPaint;
import android.text.style.StrikethroughSpan;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.ToBeFixed;
+
+import junit.framework.TestCase;
@TestTargetClass(StrikethroughSpan.class)
public class StrikethroughSpanTest extends TestCase {
+ @TestTargets({
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "StrikethroughSpan",
+ args = {}
+ ),
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "StrikethroughSpan",
+ args = {android.os.Parcel.class}
+ )
+ })
+ public void testConstructor() {
+ StrikethroughSpan strikethroughSpan = new StrikethroughSpan();
+
+ Parcel p = Parcel.obtain();
+ strikethroughSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new StrikethroughSpan(p);
+ }
+
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test {@link StrikethroughSpan#updateDrawState(TextPaint)}",
method = "updateDrawState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateDrawState() {
StrikethroughSpan strikethroughSpan = new StrikethroughSpan();
@@ -52,4 +74,38 @@
// expected, test success.
}
}
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "describeContents",
+ args = {}
+ )
+ public void testDescribeContents() {
+ StrikethroughSpan strikethroughSpan = new StrikethroughSpan();
+ strikethroughSpan.describeContents();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "getSpanTypeId",
+ args = {}
+ )
+ public void testGetSpanTypeId() {
+ StrikethroughSpan strikethroughSpan = new StrikethroughSpan();
+ strikethroughSpan.getSpanTypeId();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "writeToParcel",
+ args = {Parcel.class, int.class}
+ )
+ public void testWriteToParcel() {
+ Parcel p = Parcel.obtain();
+ StrikethroughSpan strikethroughSpan = new StrikethroughSpan();
+ strikethroughSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new StrikethroughSpan(p);
+ p.recycle();
+ }
}
diff --git a/tests/tests/text/src/android/text/style/cts/StyleSpanTest.java b/tests/tests/text/src/android/text/style/cts/StyleSpanTest.java
index 6511b2e..4723693 100644
--- a/tests/tests/text/src/android/text/style/cts/StyleSpanTest.java
+++ b/tests/tests/text/src/android/text/style/cts/StyleSpanTest.java
@@ -16,33 +16,46 @@
package android.text.style.cts;
-import junit.framework.TestCase;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.TestTargets;
+import dalvik.annotation.ToBeFixed;
+
import android.graphics.Typeface;
+import android.os.Parcel;
import android.text.TextPaint;
import android.text.style.StyleSpan;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.ToBeFixed;
+
+import junit.framework.TestCase;
@TestTargetClass(StyleSpan.class)
public class StyleSpanTest extends TestCase {
- @TestTargetNew(
- level = TestLevel.COMPLETE,
- notes = "Test constructor(s) of StyleSpan.",
- method = "StyleSpan",
- args = {int.class}
- )
+ @TestTargets({
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "StyleSpan",
+ args = {int.class}
+ ),
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "StyleSpan",
+ args = {android.os.Parcel.class}
+ )
+ })
public void testConstructor() {
- new StyleSpan(2);
+ StyleSpan styleSpan = new StyleSpan(2);
+
+ Parcel p = Parcel.obtain();
+ styleSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new StyleSpan(p);
new StyleSpan(-2);
}
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test getStyle().",
method = "getStyle",
args = {}
)
@@ -56,12 +69,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateMeasureState(TextPaint paint).",
method = "updateMeasureState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateMeasureState() {
StyleSpan styleSpan = new StyleSpan(Typeface.BOLD);
@@ -87,12 +98,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateDrawState(TextPaint ds).",
method = "updateDrawState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateDrawState() {
StyleSpan styleSpan = new StyleSpan(Typeface.BOLD);
@@ -115,4 +124,38 @@
// expected, test success.
}
}
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "describeContents",
+ args = {}
+ )
+ public void testDescribeContents() {
+ StyleSpan styleSpan = new StyleSpan(Typeface.BOLD);
+ styleSpan.describeContents();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "getSpanTypeId",
+ args = {}
+ )
+ public void testGetSpanTypeId() {
+ StyleSpan styleSpan = new StyleSpan(Typeface.BOLD);
+ styleSpan.getSpanTypeId();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "writeToParcel",
+ args = {Parcel.class, int.class}
+ )
+ public void testWriteToParcel() {
+ Parcel p = Parcel.obtain();
+ StyleSpan styleSpan = new StyleSpan(Typeface.BOLD);
+ styleSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ StyleSpan newSpan = new StyleSpan(p);
+ assertEquals(Typeface.BOLD, newSpan.getStyle());
+ p.recycle();
+ }
}
diff --git a/tests/tests/text/src/android/text/style/cts/SubscriptSpanTest.java b/tests/tests/text/src/android/text/style/cts/SubscriptSpanTest.java
index ae3644a..2b80184 100644
--- a/tests/tests/text/src/android/text/style/cts/SubscriptSpanTest.java
+++ b/tests/tests/text/src/android/text/style/cts/SubscriptSpanTest.java
@@ -16,25 +16,47 @@
package android.text.style.cts;
-import junit.framework.TestCase;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.TestTargets;
+import dalvik.annotation.ToBeFixed;
+
+import android.os.Parcel;
import android.text.TextPaint;
import android.text.style.SubscriptSpan;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.ToBeFixed;
+
+import junit.framework.TestCase;
@TestTargetClass(SubscriptSpan.class)
public class SubscriptSpanTest extends TestCase {
+ @TestTargets({
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "SubscriptSpan",
+ args = {}
+ ),
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "SubscriptSpan",
+ args = {android.os.Parcel.class}
+ )
+ })
+ public void testConstructor() {
+ SubscriptSpan subscriptSpan = new SubscriptSpan();
+
+ Parcel p = Parcel.obtain();
+ subscriptSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new SubscriptSpan(p);
+ }
+
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateMeasureState(TextPaint tp).",
method = "updateMeasureState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateMeasureState() {
// the expected result is: tp.baselineShift -= (int) (tp.ascent() / 2)
SubscriptSpan subscriptSpan = new SubscriptSpan();
@@ -57,12 +79,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateDrawState(TextPaint tp).",
method = "updateDrawState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateDrawState() {
// the expected result is: tp.baselineShift -= (int) (tp.ascent() / 2)
SubscriptSpan subscriptSpan = new SubscriptSpan();
@@ -82,4 +102,38 @@
// expected, test success.
}
}
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "describeContents",
+ args = {}
+ )
+ public void testDescribeContents() {
+ SubscriptSpan subscriptSpan = new SubscriptSpan();
+ subscriptSpan.describeContents();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "getSpanTypeId",
+ args = {}
+ )
+ public void testGetSpanTypeId() {
+ SubscriptSpan subscriptSpan = new SubscriptSpan();
+ subscriptSpan.getSpanTypeId();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "writeToParcel",
+ args = {Parcel.class, int.class}
+ )
+ public void testWriteToParcel() {
+ Parcel p = Parcel.obtain();
+ SubscriptSpan subscriptSpan = new SubscriptSpan();
+ subscriptSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new SubscriptSpan(p);
+ p.recycle();
+ }
}
diff --git a/tests/tests/text/src/android/text/style/cts/SuperscriptSpanTest.java b/tests/tests/text/src/android/text/style/cts/SuperscriptSpanTest.java
index 010743e..33ed6e6 100644
--- a/tests/tests/text/src/android/text/style/cts/SuperscriptSpanTest.java
+++ b/tests/tests/text/src/android/text/style/cts/SuperscriptSpanTest.java
@@ -16,25 +16,47 @@
package android.text.style.cts;
-import junit.framework.TestCase;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.TestTargets;
+import dalvik.annotation.ToBeFixed;
+
+import android.os.Parcel;
import android.text.TextPaint;
import android.text.style.SuperscriptSpan;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.ToBeFixed;
+
+import junit.framework.TestCase;
@TestTargetClass(SuperscriptSpan.class)
public class SuperscriptSpanTest extends TestCase {
+ @TestTargets({
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "SuperscriptSpan",
+ args = {}
+ ),
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "SuperscriptSpan",
+ args = {android.os.Parcel.class}
+ )
+ })
+ public void testConstructor() {
+ SuperscriptSpan superscriptSpan = new SuperscriptSpan();
+
+ Parcel p = Parcel.obtain();
+ superscriptSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new SuperscriptSpan(p);
+ }
+
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateMeasureState(TextPaint tp).",
method = "updateMeasureState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateMeasureState() {
// the expected result is: tp.baselineShift += (int) (tp.ascent() / 2)
SuperscriptSpan superscriptSpan = new SuperscriptSpan();
@@ -57,12 +79,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateDrawState(TextPaint tp).",
method = "updateDrawState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateDrawState() {
// the expected result is: tp.baselineShift += (int) (tp.ascent() / 2)
SuperscriptSpan superscriptSpan = new SuperscriptSpan();
@@ -82,4 +102,38 @@
// expected, test success.
}
}
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "describeContents",
+ args = {}
+ )
+ public void testDescribeContents() {
+ SuperscriptSpan superscriptSpan = new SuperscriptSpan();
+ superscriptSpan.describeContents();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "getSpanTypeId",
+ args = {}
+ )
+ public void testGetSpanTypeId() {
+ SuperscriptSpan superscriptSpan = new SuperscriptSpan();
+ superscriptSpan.getSpanTypeId();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "writeToParcel",
+ args = {Parcel.class, int.class}
+ )
+ public void testWriteToParcel() {
+ Parcel p = Parcel.obtain();
+ SuperscriptSpan superscriptSpan = new SuperscriptSpan();
+ superscriptSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new SuperscriptSpan(p);
+ p.recycle();
+ }
}
diff --git a/tests/tests/text/src/android/text/style/cts/TextAppearanceSpanTest.java b/tests/tests/text/src/android/text/style/cts/TextAppearanceSpanTest.java
index 83f721b..ef5ed04 100644
--- a/tests/tests/text/src/android/text/style/cts/TextAppearanceSpanTest.java
+++ b/tests/tests/text/src/android/text/style/cts/TextAppearanceSpanTest.java
@@ -16,56 +16,61 @@
package android.text.style.cts;
-import android.content.Context;
+import dalvik.annotation.TestLevel;
+import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.TestTargets;
+import dalvik.annotation.ToBeFixed;
+
import android.content.res.ColorStateList;
import android.graphics.Color;
+import android.os.Parcel;
import android.test.AndroidTestCase;
import android.text.TextPaint;
import android.text.style.TextAppearanceSpan;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.ToBeFixed;
@TestTargetClass(TextAppearanceSpan.class)
public class TextAppearanceSpanTest extends AndroidTestCase {
@TestTargets({
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test constructor(s) of TextAppearanceSpan.",
method = "TextAppearanceSpan",
args = {android.content.Context.class, int.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test constructor(s) of TextAppearanceSpan.",
method = "TextAppearanceSpan",
args = {android.content.Context.class, int.class, int.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test constructor(s) of TextAppearanceSpan.",
method = "TextAppearanceSpan",
- args = {java.lang.String.class, int.class, int.class,
- android.content.res.ColorStateList.class,
+ args = {java.lang.String.class, int.class, int.class,
+ android.content.res.ColorStateList.class,
android.content.res.ColorStateList.class}
+ ),
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "TextAppearanceSpan",
+ args = {android.os.Parcel.class}
)
})
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
+ @ToBeFixed(bug = "1695243", explanation = "should add @throws NullPointerException clause" +
" into javadoc when input Context is null")
public void testConstructor() {
new TextAppearanceSpan(mContext, 1);
-
new TextAppearanceSpan(mContext, 1, 1);
int[][] states = new int[][] { new int[0], new int[0] };
int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK };
ColorStateList csl = new ColorStateList(states, colors);
- new TextAppearanceSpan("sans", 1, 6, csl, csl);
+ TextAppearanceSpan textAppearanceSpan = new TextAppearanceSpan("sans", 1, 6, csl, csl);
+ Parcel p = Parcel.obtain();
+ textAppearanceSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ new TextAppearanceSpan(p);
- // test constructor using null
try {
new TextAppearanceSpan(null, -1);
fail("should throw NullPointerException.");
@@ -85,7 +90,6 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test getFamily().",
method = "getFamily",
args = {}
)
@@ -106,12 +110,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateMeasureState(TextPaint ds).",
method = "updateMeasureState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint is null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateMeasureState() {
int[][] states = new int[][] { new int[0], new int[0] };
int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK };
@@ -136,7 +138,6 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test getTextColor().",
method = "getTextColor",
args = {}
)
@@ -154,7 +155,6 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test getTextSize().",
method = "getTextSize",
args = {}
)
@@ -175,7 +175,6 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test getTextStyle().",
method = "getTextStyle",
args = {}
)
@@ -196,7 +195,6 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test getLinkTextColor().",
method = "getLinkTextColor",
args = {}
)
@@ -214,12 +212,10 @@
@TestTargetNew(
level = TestLevel.COMPLETE,
- notes = "Test updateDrawState(TextPaint ds).",
method = "updateDrawState",
args = {android.text.TextPaint.class}
)
- @ToBeFixed(bug = "1417734", explanation = "should add @throws NullPointerException clause" +
- " into javadoc when input TextPaint is null")
+ @ToBeFixed(bug="1695243", explanation="miss javadoc")
public void testUpdateDrawState() {
int[][] states = new int[][] { new int[0], new int[0] };
int[] colors = new int[] { Color.rgb(0, 0, 255), Color.BLACK };
@@ -244,4 +240,40 @@
// expected, test success
}
}
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "describeContents",
+ args = {}
+ )
+ public void testDescribeContents() {
+ TextAppearanceSpan textAppearanceSpan = new TextAppearanceSpan(mContext, 1);
+ textAppearanceSpan.describeContents();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "getSpanTypeId",
+ args = {}
+ )
+ public void testGetSpanTypeId() {
+ TextAppearanceSpan textAppearanceSpan = new TextAppearanceSpan(mContext, 1);
+ textAppearanceSpan.getSpanTypeId();
+ }
+
+ @TestTargetNew(
+ level = TestLevel.COMPLETE,
+ method = "writeToParcel",
+ args = {Parcel.class, int.class}
+ )
+ public void testWriteToParcel() {
+ Parcel p = Parcel.obtain();
+ String family = "sans";
+ TextAppearanceSpan textAppearanceSpan = new TextAppearanceSpan(family, 1, 6, null, null);
+ textAppearanceSpan.writeToParcel(p, 0);
+ p.setDataPosition(0);
+ TextAppearanceSpan newSpan = new TextAppearanceSpan(p);
+ assertEquals(family, newSpan.getFamily());
+ p.recycle();
+ }
}