Fix for CharSequenceCreator test case

The test case testCharSequenceCreator() in TextUtilsTest fails
because the data position is not reset before calling
createFromParcel().

Change-Id: I6d5cc093ff65019ab0d2191bb0bd9c10ae49612b
This commit is contained in:
Mattias Petersson
2011-05-27 11:16:41 +02:00
committed by Johan Redestig
parent 59701b9ba5
commit fc2bd335d1

View File

@@ -353,6 +353,7 @@ public class TextUtilsTest extends TestCase {
assertNull("null CharSequence should generate null from parcel", text);
p = Parcel.obtain();
TextUtils.writeToParcel("test", p, 0);
p.setDataPosition(0);
text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(p);
assertEquals("conversion to/from parcel failed", "test", text);
}