use of com.android.aapt.Resources.Style in project bundletool by google.
the class ResourceTableMergerTest method stripSourceReferences_inRepeatedField_strips.
@Test
public void stripSourceReferences_inRepeatedField_strips() throws Exception {
Style withoutSource = Style.newBuilder().setParent(Reference.newBuilder().setName("dad")).addEntry(Style.Entry.newBuilder().setComment("comment")).build();
Style.Builder withSourceBuilder = withoutSource.toBuilder();
withSourceBuilder.getEntryBuilder(0).setSource(Source.newBuilder().setPathIdx(42));
Style withSource = withSourceBuilder.build();
assertThat(withSource).isNotEqualTo(withoutSource);
Style.Builder stripped = withSource.toBuilder();
ResourceTableMerger.stripSourceReferences(stripped);
assertThat(stripped.build()).isEqualTo(withoutSource);
}
use of com.android.aapt.Resources.Style in project bundletool by google.
the class ResourceTableMergerTest method stripSourceReferences_inTopLevelField_strips.
@Test
public void stripSourceReferences_inTopLevelField_strips() throws Exception {
Style withoutSource = Style.newBuilder().setParent(Reference.newBuilder().setName("dad")).build();
Style withSource = withoutSource.toBuilder().setParentSource(Source.newBuilder().setPathIdx(42)).build();
assertThat(withSource).isNotEqualTo(withoutSource);
Style.Builder stripped = withSource.toBuilder();
ResourceTableMerger.stripSourceReferences(stripped);
assertThat(stripped.build()).isEqualTo(withoutSource);
}