use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testAsBytes_ConstructedTag.
@SmallTest
@Test(expected = IllegalStateException.class)
public void testAsBytes_ConstructedTag() throws InvalidAsn1DataException {
Asn1Node node = Asn1Node.newBuilder(0xBF37).build();
node.asBytes();
}
use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testAsLong_ConstructedTag.
@SmallTest
@Test(expected = IllegalStateException.class)
public void testAsLong_ConstructedTag() throws InvalidAsn1DataException {
Asn1Node node = Asn1Node.newBuilder(0xBF37).build();
node.asRawLong();
}
use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testAsString_ConstructedTag.
@SmallTest
@Test(expected = IllegalStateException.class)
public void testAsString_ConstructedTag() throws InvalidAsn1DataException {
Asn1Node node = Asn1Node.newBuilder(0xBF37).build();
node.asString();
}
use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testWriteToBytes.
@SmallTest
@Test
public void testWriteToBytes() throws InvalidAsn1DataException {
final String nodeHex = "3031110312D687120F54686973206973206120746573742E310B13040422C4F0" + "1403FF00FF1501FF13040422C4F01403FF00FF";
Asn1Node node = new Asn1Decoder(nodeHex).nextNode();
// Writes the bytes before children accessed.
assertEquals(nodeHex, node.toHex());
// Writes the bytes after children accessed.
node.getChildren();
assertEquals(nodeHex, node.toHex());
}
use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.
the class Asn1NodeTest method testCreateConstructedNodeWithShortTag.
@SmallTest
@Test
public void testCreateConstructedNodeWithShortTag() {
Asn1Node node = Asn1Node.newBuilder(0x65).build();
assertEquals(0x65, node.getTag());
assertTrue(node.isConstructed());
assertEquals(2, node.getEncodedLength());
assertEquals(0, node.getDataLength());
assertArrayEquals(new byte[] { 0x65, 0x00 }, node.toBytes());
}
Aggregations