Add tests to ensure empty, uncompressed files are put on the doNotCompress list.

Also, fix a bug where ext would retain its value from a previous
iteration of the loop, since we don't always overwrite it now.
This commit is contained in:
Peter Retzlaff
2020-04-21 10:37:54 +02:00
committed by Connor Tumbleson
parent 05f81f9dd0
commit 408050ffde
3 changed files with 14 additions and 2 deletions

View File

@ -501,6 +501,12 @@ public class BuildAndDecodeTest extends BaseTest {
}
}
@Test
public void confirmZeroByteFileIsStored() throws BrutException {
MetaInfo metaInfo = new Androlib().readMetaFile(sTestNewDir);
assertTrue(metaInfo.doNotCompress.contains("assets/0byte_file.jpg"));
}
@Test
public void drawableXxhdpiTest() throws BrutException, IOException {
compareResFolder("drawable-xxhdpi");

View File

@ -82,7 +82,13 @@ public class BuildAndDecodeTest extends BaseTest {
@Test
public void confirmZeroByteFileExtensionIsNotStored() throws BrutException {
MetaInfo metaInfo = new Androlib().readMetaFile(sTestNewDir);
assertNull(metaInfo.doNotCompress);
assertFalse(metaInfo.doNotCompress.contains("jpg"));
}
@Test
public void confirmZeroByteFileIsStored() throws BrutException {
MetaInfo metaInfo = new Androlib().readMetaFile(sTestNewDir);
assertTrue(metaInfo.doNotCompress.contains("assets/0byte_file.jpg"));
}
@Test