Updated license

This commit is contained in:
Ziver Koc 2016-02-09 13:12:44 +01:00
parent 7a8fd75ea0
commit 2e87aec3b4
15 changed files with 286 additions and 2 deletions

View file

@ -4,11 +4,10 @@ import org.junit.Test;
import zutil.parser.binary.BinaryStruct;
import zutil.parser.binary.BinaryStructParser;
import static junit.framework.Assert.assertEquals;
import static junit.framework.TestCase.*;
/**
* Created by ezivkoc on 2016-01-28.
* Created by Ziver on 2016-01-28.
*/
public class BinaryStructTest {
interface BinaryTestStruct extends BinaryStruct{
@ -68,6 +67,24 @@ public class BinaryStructTest {
@Test
public void nonLinedLength(){
BinaryTestStruct struct = new BinaryTestStruct() {
@BinaryField(index=1, length=12)
public int i1;
@BinaryField(index=2, length=12)
public int i2;
public void assertObj(){
assertEquals(1, i1);
assertEquals(2048, i2);
}
};
BinaryStructParser.parse(struct, new byte[]{0b0000_0000,0b0001_1000,0b0000_0000});
struct.assertObj();
}
@Test
public void nonLinedLength2(){
BinaryTestStruct struct = new BinaryTestStruct() {
@BinaryField(index=1, length=12)
public int i1;