use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ParanoidAndroid.
the class TextUtilsTest method testCharSequenceCreator.
@SmallTest
public void testCharSequenceCreator() {
Parcel p = Parcel.obtain();
TextUtils.writeToParcel(null, p, 0);
CharSequence text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(p);
assertNull("null CharSequence should generate null from parcel", text);
p = Parcel.obtain();
TextUtils.writeToParcel("test", p, 0);
text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(p);
assertEquals("conversion to/from parcel failed", "test", text);
}
use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ParanoidAndroid.
the class TextUtilsTest method testCharSequenceCreatorString.
@SmallTest
public void testCharSequenceCreatorString() {
Parcel p;
CharSequence 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.toString());
}
use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ParanoidAndroid.
the class TextUtilsTest method testCharSequenceCreatorSpannable.
@SmallTest
public void testCharSequenceCreatorSpannable() {
Parcel p;
CharSequence text;
p = Parcel.obtain();
TextUtils.writeToParcel(new SpannableString("test"), p, 0);
p.setDataPosition(0);
text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(p);
assertEquals("conversion to/from parcel failed", "test", text.toString());
}
use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ParanoidAndroid.
the class TextUtilsTest method testCharSequenceCreatorNull.
@SmallTest
public void testCharSequenceCreatorNull() {
Parcel p;
CharSequence text;
p = Parcel.obtain();
TextUtils.writeToParcel(null, p, 0);
p.setDataPosition(0);
text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(p);
assertNull("null CharSequence should generate null from parcel", text);
}
use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ParanoidAndroid.
the class TextUtilsTest method testRfc822FindToken.
@SmallTest
public void testRfc822FindToken() {
Rfc822Tokenizer tokenizer = new Rfc822Tokenizer();
// 0 1 2 3 4
// 0 1234 56789012345678901234 5678 90123456789012345
String address = "\"Foo\" <foo@google.com>, \"Bar\" <bar@google.com>";
assertEquals(0, tokenizer.findTokenStart(address, 21));
assertEquals(22, tokenizer.findTokenEnd(address, 21));
assertEquals(24, tokenizer.findTokenStart(address, 25));
assertEquals(46, tokenizer.findTokenEnd(address, 25));
}
Aggregations