Skip to content

Commit 417cda4

Browse files
committed
refactoring
1 parent d06ef69 commit 417cda4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

jbbp/src/test/java/com/igormaznitsa/jbbp/mapper/JBBPMapperTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,20 +863,21 @@ class Parsed {
863863
}
864864

865865
@Test
866-
void testMap_IgnoreMarkedFieldForTransient() throws Exception {
866+
void testMap_ParsedMarkedTransientField() throws Exception {
867867
@Bin
868868
class Parsed {
869869
@Bin(path = "struct.a")
870870
byte num;
871871
@Bin(path = "struct.b", type = BinType.BYTE_ARRAY)
872872
String str;
873873
@Bin(path = "struct.c", type = BinType.BYTE_ARRAY)
874-
transient String ignored;
874+
transient String trans;
875875
}
876876

877-
final Parsed parsed = JBBPParser.prepare("int start; struct { byte a; byte [3] b; } int end;").parse(new byte[] {1, 2, 3, 4, 5, (byte) 'a', (byte) 'b', (byte) 'c', 6, 7, 8, 9}).mapTo(new Parsed());
877+
final Parsed parsed = JBBPParser.prepare("int start; struct { byte a; byte [3] b; byte [3] c; } byte end;").parse(new byte[] {1, 2, 3, 4, 5, (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f', 9}).mapTo(new Parsed());
878878
assertEquals(0x05, parsed.num);
879879
assertEquals("abc", parsed.str);
880+
assertEquals("def", parsed.trans);
880881
}
881882

882883
@Test

0 commit comments

Comments
 (0)