Search in sources :

Example 66 with SmallTest

use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ResurrectionRemix.

the class ScanFilterTest method testsetServiceDataFilter.

@SmallTest
public void testsetServiceDataFilter() {
    byte[] setServiceData = new byte[] { 0x50, 0x64 };
    ParcelUuid serviceDataUuid = ParcelUuid.fromString("0000110B-0000-1000-8000-00805F9B34FB");
    ScanFilter filter = mFilterBuilder.setServiceData(serviceDataUuid, setServiceData).build();
    assertTrue("service data filter fails", filter.matches(mScanResult));
    byte[] emptyData = new byte[0];
    filter = mFilterBuilder.setServiceData(serviceDataUuid, emptyData).build();
    assertTrue("service data filter fails", filter.matches(mScanResult));
    byte[] prefixData = new byte[] { 0x50 };
    filter = mFilterBuilder.setServiceData(serviceDataUuid, prefixData).build();
    assertTrue("service data filter fails", filter.matches(mScanResult));
    byte[] nonMatchData = new byte[] { 0x51, 0x64 };
    byte[] mask = new byte[] { (byte) 0x00, (byte) 0xFF };
    filter = mFilterBuilder.setServiceData(serviceDataUuid, nonMatchData, mask).build();
    assertTrue("partial service data filter fails", filter.matches(mScanResult));
    filter = mFilterBuilder.setServiceData(serviceDataUuid, nonMatchData).build();
    assertFalse("service data filter fails", filter.matches(mScanResult));
}
Also used : ParcelUuid(android.os.ParcelUuid) ScanFilter(android.bluetooth.le.ScanFilter) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 67 with SmallTest

use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ResurrectionRemix.

the class ScanFilterTest method testDeviceFilter.

@SmallTest
public void testDeviceFilter() {
    ScanFilter filter = mFilterBuilder.setDeviceAddress(DEVICE_MAC).build();
    assertTrue("device filter fails", filter.matches(mScanResult));
    filter = mFilterBuilder.setDeviceAddress("11:22:33:44:55:66").build();
    assertFalse("device filter fails", filter.matches(mScanResult));
}
Also used : ScanFilter(android.bluetooth.le.ScanFilter) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 68 with SmallTest

use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ResurrectionRemix.

the class TimeTest method testParse0.

@SmallTest
public void testParse0() throws Exception {
    Time t = new Time(Time.TIMEZONE_UTC);
    t.parse("12345678T901234");
// System.out.println("t=" + t);
}
Also used : Time(android.text.format.Time) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 69 with SmallTest

use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ResurrectionRemix.

the class TimeTest method testGetActualMaximum0.

@SmallTest
public void testGetActualMaximum0() throws Exception {
    Time t = new Time(Time.TIMEZONE_UTC);
    int r = t.getActualMaximum(Time.SECOND);
// System.out.println("r=" + r);
}
Also used : Time(android.text.format.Time) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 70 with SmallTest

use of android.test.suitebuilder.annotation.SmallTest in project android_frameworks_base by ResurrectionRemix.

the class TimeTest method testMillis1.

@SmallTest
public void testMillis1() throws Exception {
    Time t = new Time(Time.TIMEZONE_UTC);
    t.set(1, 0, 0, 1, 0, 1970);
    long r = t.toMillis(true);
// System.out.println("r=" + r);
}
Also used : Time(android.text.format.Time) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

SmallTest (android.test.suitebuilder.annotation.SmallTest)2108 Test (org.junit.Test)235 Parcel (android.os.Parcel)153 ArrayList (java.util.ArrayList)104 Time (android.text.format.Time)97 Rect (android.graphics.Rect)94 TelephonyTest (com.android.internal.telephony.TelephonyTest)84 Bundle (android.os.Bundle)77 ByteBuffer (java.nio.ByteBuffer)71 Intent (android.content.Intent)69 LinkProperties (android.net.LinkProperties)68 SpannableString (android.text.SpannableString)61 FlakyTest (android.support.test.filters.FlakyTest)58 DhcpPacket (android.net.dhcp.DhcpPacket)52 Rational (android.util.Rational)50 NetworkRequest (android.net.NetworkRequest)48 File (java.io.File)47 RouteInfo (android.net.RouteInfo)45 BitwiseOutputStream (com.android.internal.util.BitwiseOutputStream)45 ParcelUuid (android.os.ParcelUuid)43