Skip to content

Commit 0964989

Browse files
committed
added test for convertToSrc
1 parent f0e547a commit 0964989

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/test/java/com/igormaznitsa/jbbp/JBBPParserTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.igormaznitsa.jbbp.io.JBBPByteOrder;
2424
import com.igormaznitsa.jbbp.model.*;
2525
import com.igormaznitsa.jbbp.utils.JBBPIntCounter;
26+
import com.igormaznitsa.jbbp.utils.TargetSources;
2627
import org.junit.Test;
2728

2829
import java.io.ByteArrayInputStream;
@@ -436,7 +437,7 @@ public JBBPAbstractField readVarField(final JBBPBitInputStream inStream, final J
436437
return null;
437438
}
438439
}, null);
439-
440+
440441
assertNotNull(struct);
441442
}
442443

@@ -457,7 +458,7 @@ public JBBPAbstractField readVarField(final JBBPBitInputStream inStream, final J
457458
return new JBBPFieldArrayByte(fieldName, new byte[]{1, 2, 3});
458459
}
459460
}, null);
460-
461+
461462
assertNotNull(struct);
462463
}
463464

@@ -479,7 +480,7 @@ public JBBPAbstractField readVarField(final JBBPBitInputStream inStream, final J
479480
return new JBBPFieldByte(new JBBPNamedFieldInfo("jskdjhsd", "dlkjsf", 0), (byte) 1);
480481
}
481482
}, null);
482-
483+
483484
assertNotNull(struct);
484485
}
485486

@@ -1703,4 +1704,10 @@ public void testParse_NoErrorForIgnoreRemainingFieldsFlag() throws Exception {
17031704
assertEquals(0x01020304, ((JBBPFieldInt) result.findFieldForName("a")).getAsInt());
17041705
}
17051706

1707+
@Test
1708+
public void testConvertToSrc_Java16() throws Exception {
1709+
final JBBPParser parser = JBBPParser.prepare("byte a;");
1710+
assertTrue(parser.convertToSrc(TargetSources.JAVA_1_6, "someclass").length != 0);
1711+
}
1712+
17061713
}

0 commit comments

Comments
 (0)