Search in sources :

Example 1 with Primitive

use of com.android.aapt.Resources.Primitive in project bundletool by google.

the class XmlProtoPrintUtilsTest method getPrimitiveValueAsString_colorArgb8.

@Test
public void getPrimitiveValueAsString_colorArgb8() {
    Primitive primitive = Primitive.newBuilder().setColorArgb4Value(0x12345678).build();
    assertThat(XmlProtoPrintUtils.getPrimitiveValueAsString(primitive)).isEqualTo("#12345678");
}
Also used : Primitive(com.android.aapt.Resources.Primitive) Test(org.junit.Test)

Example 2 with Primitive

use of com.android.aapt.Resources.Primitive in project bundletool by google.

the class XmlProtoPrintUtilsTest method getPrimitiveValueAsString_intHexadecimal.

@Test
public void getPrimitiveValueAsString_intHexadecimal() {
    Primitive primitive = Primitive.newBuilder().setIntHexadecimalValue(0x12345678).build();
    assertThat(XmlProtoPrintUtils.getPrimitiveValueAsString(primitive)).isEqualTo("0x12345678");
}
Also used : Primitive(com.android.aapt.Resources.Primitive) Test(org.junit.Test)

Example 3 with Primitive

use of com.android.aapt.Resources.Primitive in project bundletool by google.

the class XmlProtoPrintUtilsTest method getPrimitiveValueAsString_empty.

@Test
public void getPrimitiveValueAsString_empty() {
    Primitive primitive = Primitive.newBuilder().setEmptyValue(EmptyType.getDefaultInstance()).build();
    assertThat(XmlProtoPrintUtils.getPrimitiveValueAsString(primitive)).isEmpty();
}
Also used : Primitive(com.android.aapt.Resources.Primitive) Test(org.junit.Test)

Example 4 with Primitive

use of com.android.aapt.Resources.Primitive in project bundletool by google.

the class XmlProtoPrintUtilsTest method getPrimitiveValueAsString_null.

@Test
public void getPrimitiveValueAsString_null() {
    Primitive primitive = Primitive.newBuilder().setNullValue(NullType.getDefaultInstance()).build();
    assertThat(XmlProtoPrintUtils.getPrimitiveValueAsString(primitive)).isEmpty();
}
Also used : Primitive(com.android.aapt.Resources.Primitive) Test(org.junit.Test)

Example 5 with Primitive

use of com.android.aapt.Resources.Primitive in project bundletool by google.

the class XmlProtoPrintUtilsTest method getPrimitiveValueAsString_colorRgb8.

@Test
public void getPrimitiveValueAsString_colorRgb8() {
    Primitive primitive = Primitive.newBuilder().setColorRgb8Value(0xFF123456).build();
    assertThat(XmlProtoPrintUtils.getPrimitiveValueAsString(primitive)).isEqualTo("#123456");
}
Also used : Primitive(com.android.aapt.Resources.Primitive) Test(org.junit.Test)

Aggregations

Primitive (com.android.aapt.Resources.Primitive)7 Test (org.junit.Test)7