use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testWriteToBytes_IndexOutOfBounds.
@SmallTest
@Test(expected = IndexOutOfBoundsException.class)
public void testWriteToBytes_IndexOutOfBounds() throws TagNotFoundException, InvalidAsn1DataException {
Asn1Node node = Asn1Node.newBuilder(0xBF37).addChildAsString(1, "1").build();
byte[] bytes = new byte[1];
node.writeToBytes(bytes, 0);
}
use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testAsBoolean_ConstructedTag.
@SmallTest
@Test(expected = IllegalStateException.class)
public void testAsBoolean_ConstructedTag() throws InvalidAsn1DataException {
Asn1Node node = Asn1Node.newBuilder(0xBF37).build();
node.asBoolean();
}
use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testAsBits_ConstructedTag.
@SmallTest
@Test(expected = IllegalStateException.class)
public void testAsBits_ConstructedTag() throws InvalidAsn1DataException {
Asn1Node node = Asn1Node.newBuilder(0xBF37).build();
node.asBits();
}
use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testCreateConstructedNodeWithLongTag.
@SmallTest
@Test
public void testCreateConstructedNodeWithLongTag() {
Asn1Node node = Asn1Node.newBuilder(0x3F34).build();
assertEquals(0x3F34, node.getTag());
assertTrue(node.isConstructed());
assertEquals(3, node.getEncodedLength());
assertEquals(0, node.getDataLength());
assertArrayEquals(new byte[] { 0x3F, 0x34, 0x00 }, node.toBytes());
}
use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testAsInteger_ConstructedTag.
@SmallTest
@Test(expected = IllegalStateException.class)
public void testAsInteger_ConstructedTag() throws InvalidAsn1DataException {
Asn1Node node = Asn1Node.newBuilder(0xBF37).build();
node.asInteger();
}
Aggregations