Search in sources :

Example 21 with SmallTest

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);
}
Also used : Parcel(android.os.Parcel) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 22 with SmallTest

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());
}
Also used : Parcel(android.os.Parcel) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 23 with SmallTest

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());
}
Also used : Parcel(android.os.Parcel) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 24 with SmallTest

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);
}
Also used : Parcel(android.os.Parcel) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 25 with SmallTest

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));
}
Also used : Rfc822Tokenizer(android.text.util.Rfc822Tokenizer) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

SmallTest (android.test.suitebuilder.annotation.SmallTest)1764 Parcel (android.os.Parcel)143 Time (android.text.format.Time)97 Rect (android.graphics.Rect)94 ByteBuffer (java.nio.ByteBuffer)71 Bundle (android.os.Bundle)68 LinkProperties (android.net.LinkProperties)66 ArrayList (java.util.ArrayList)63 SpannableString (android.text.SpannableString)60 DhcpPacket (android.net.dhcp.DhcpPacket)52 Rational (android.util.Rational)50 File (java.io.File)47 RouteInfo (android.net.RouteInfo)45 NetworkRequest (android.net.NetworkRequest)44 ParcelUuid (android.os.ParcelUuid)43 MenuItem (android.view.MenuItem)42 BitwiseInputStream (com.android.internal.util.BitwiseInputStream)42 BitwiseOutputStream (com.android.internal.util.BitwiseOutputStream)42 CaptureRequest (android.hardware.camera2.CaptureRequest)40 IpPrefix (android.net.IpPrefix)40