Change zero-byte-file tests so they test the correct behavior.

* The empty test file needs to be STORED in the testapp, so put it on
  the initial doNotCompress list.
* It needs to have a file extension that matches the NO_COMPRESS_PATTERN.
* assertNotSame tests for object equality, which doesn't work for String
  comparisons.
This commit is contained in:
Peter Retzlaff 2020-04-21 10:18:22 +02:00 committed by Connor Tumbleson
parent 5db19b3329
commit 05f81f9dd0
6 changed files with 6 additions and 3 deletions

View File

@ -493,11 +493,11 @@ public class BuildAndDecodeTest extends BaseTest {
}
@Test
public void confirmZeroByteFileIsNotStored() throws BrutException {
public void confirmZeroByteFileExtensionIsNotStored() throws BrutException {
MetaInfo metaInfo = new Androlib().readMetaFile(sTestNewDir);
for (String item : metaInfo.doNotCompress) {
assertNotSame(item, "empty");
assertFalse(item.equals("jpg"));
}
}

View File

@ -80,7 +80,7 @@ public class BuildAndDecodeTest extends BaseTest {
}
@Test
public void confirmZeroByteFileIsNotStored() throws BrutException {
public void confirmZeroByteFileExtensionIsNotStored() throws BrutException {
MetaInfo metaInfo = new Androlib().readMetaFile(sTestNewDir);
assertNull(metaInfo.doNotCompress);
}

View File

@ -11,6 +11,7 @@ versionInfo:
versionName: '1.0'
compressionType: false
doNotCompress:
- assets/0byte_file.jpg
- arsc
- png
- mp3

View File

@ -10,4 +10,6 @@ versionInfo:
versionCode: '1'
versionName: '1.0'
compressionType: false
doNotCompress:
- assets/0byte_file.jpg
sparseResources: false