Skip to content

Commit 217e005

Browse files
committed
PackageBlock Test for #90
1 parent 317c714 commit 217e005

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.reandroid.arsc.chunk;
2+
3+
import org.junit.Assert;
4+
import org.junit.Test;
5+
6+
public class PackageBlockTest {
7+
8+
@Test
9+
public void testIsResourceId() {
10+
Assert.assertFalse(PackageBlock.isResourceId(0x7f00ffff));
11+
Assert.assertFalse(PackageBlock.isResourceId(0x00ff0000));
12+
Assert.assertFalse(PackageBlock.isResourceId(0x00ffffff));
13+
Assert.assertFalse(PackageBlock.isResourceId(0x0000ffff));
14+
Assert.assertFalse(PackageBlock.isResourceId(0xff000000));
15+
Assert.assertFalse(PackageBlock.isResourceId(0x0));
16+
Assert.assertTrue(PackageBlock.isResourceId(0x0101ffff));
17+
Assert.assertTrue(PackageBlock.isResourceId(0x01010000));
18+
}
19+
20+
@Test
21+
public void testIsPackageId() {
22+
Assert.assertFalse(PackageBlock.isPackageId(0x00));
23+
Assert.assertFalse(PackageBlock.isPackageId(0xfff));
24+
Assert.assertFalse(PackageBlock.isPackageId(0xffff));
25+
Assert.assertFalse(PackageBlock.isPackageId(0xfffff));
26+
Assert.assertFalse(PackageBlock.isPackageId(0xffffff));
27+
Assert.assertFalse(PackageBlock.isPackageId(0xffffffff));
28+
Assert.assertTrue(PackageBlock.isPackageId(0x01));
29+
Assert.assertTrue(PackageBlock.isPackageId(0x11));
30+
Assert.assertTrue(PackageBlock.isPackageId(0xff));
31+
}
32+
33+
}

0 commit comments

Comments
 (0)