Skip to content

Commit 38903a1

Browse files
committed
improved test
1 parent 894d945 commit 38903a1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

jbbp/src/test/java/com/igormaznitsa/jbbp/compiler/conversion/JBBPToJava6ConverterReadWriteTest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void testReadWrite_ExtendsSuperClassAndUseItsFields() throws Exception {
128128
final Object instance = ReflectUtils.newInstance(classLoader.loadClass(fullClassName));
129129
assertTrue(instance instanceof TestSuperclass);
130130

131-
callRead(instance, new byte[] {
131+
final byte [] etalon = new byte[] {
132132
0,
133133
2, 49, 50, 1, 51,
134134
1, 2, 3, 4,
@@ -138,7 +138,9 @@ public void testReadWrite_ExtendsSuperClassAndUseItsFields() throws Exception {
138138
2,
139139
1,2,
140140
3,4,5
141-
});
141+
};
142+
143+
callRead(instance, etalon);
142144

143145
final TestSuperclass parsed = (TestSuperclass) instance;
144146

@@ -148,6 +150,14 @@ public void testReadWrite_ExtendsSuperClassAndUseItsFields() throws Exception {
148150
assertArrayEquals(new float[] {6.301941E-36f, 1.661634E-33f}, parsed.fltarr);
149151
assertEquals(8.20788039913184E-304d, parsed.dbl);
150152
assertArrayEquals(new double[] {4.0383818836028145E-265d, 1.9074368412237584E-226d}, parsed.dblarr);
153+
154+
assertEquals(1, parsed.ins.length);
155+
assertArrayEquals(new byte[]{1,2}, parsed.ins[0].a);
156+
assertEquals(3, parsed.ins[0].b);
157+
assertEquals(4, parsed.ins[0].c);
158+
assertEquals(5, parsed.ins[0].insins.a);
159+
160+
assertArrayEquals(etalon, callWrite(instance));
151161
}
152162

153163
@Test

0 commit comments

Comments
 (0)