Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauma109 committed May 17, 2023
1 parent 32d5c0a commit 769d41b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/java/org/jd/core/v1/util/ByteCodeUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public void testCleanUpByteCode15() {
byte[] code = {ALOAD_2, (byte) INVOKEVIRTUAL, 0, (byte) F2L, LDC, (byte) L2D, (byte) INVOKEVIRTUAL, 0, (byte) D2L, (byte) CHECKCAST, 0, (byte) D2F, ASTORE, 4, ALOAD_2, (byte) INVOKEVIRTUAL, 0, (byte) F2L, LDC, (byte) D2I, (byte) INVOKEVIRTUAL, 0, (byte) D2L, (byte) CHECKCAST, 0, (byte) D2F, ASTORE, 5, ALOAD_0, (byte) INVOKEVIRTUAL, 0, (byte) I2B, (byte) INVOKEVIRTUAL, 0, (byte) I2C, ASTORE, 6, ALOAD_1, (byte) INVOKEVIRTUAL, 0, DUP_X2, (byte) CHECKCAST, 0, DUP2, ASTORE, 7, 1, ASTORE, 8, ALOAD, 7, (byte) INVOKEVIRTUAL, 0, (byte) I2S, ASTORE, 9, ALOAD, 7, (byte) INVOKEVIRTUAL, 0, (byte) LCMP, ASTORE, 10, ALOAD, 7, (byte) INVOKEVIRTUAL, 0, (byte) FCMPL, ASTORE, 11, ALOAD, 11, (byte) IFNULL, 0, 10, ALOAD, 11, (byte) INVOKEVIRTUAL, 0, (byte) FCMPG, ASTORE, 8, ALOAD, 6, (byte) IFNULL, 0, FLOAD_1, ALOAD, 4, (byte) INVOKESTATIC, 0, (byte) DCMPL, (byte) IFNE, 0, ILOAD_1, ALOAD, 6, ALOAD, 4, (byte) INVOKESTATIC, 0, (byte) DCMPG, (byte) INVOKEVIRTUAL, 0, (byte) IFEQ, ASTORE, 9, (byte) GETSTATIC, 0, (byte) IFNE, ALOAD, 9, ALOAD, 8, (byte) INVOKEVIRTUAL, 0, (byte) IFLT, ASTORE, 9, ALOAD, 9, (byte) IFNULL, 0, FLOAD_1, ALOAD, 5, (byte) INVOKESTATIC, 0, (byte) DCMPL, (byte) IFNE, 0, ILOAD_1, ALOAD, 9, ALOAD, 5, (byte) INVOKESTATIC, 0, (byte) DCMPG, (byte) INVOKEVIRTUAL, 0, (byte) IFEQ, ASTORE, 10, (byte) GETSTATIC, 0, (byte) IFNE, ALOAD, 10, ALOAD, 8, (byte) INVOKEVIRTUAL, 0, (byte) IFLT, ASTORE, 10, ALOAD, 7, ALOAD, 9, (byte) INVOKEVIRTUAL, 0, (byte) IFGE, ALOAD, 7, ALOAD, 10, (byte) INVOKEVIRTUAL, 0, 0, ALOAD_1, LDC, (byte) L2D, (byte) INVOKEVIRTUAL, 0, (byte) IFLE, ALOAD_1, LDC, (byte) D2I, (byte) INVOKEVIRTUAL, 0, (byte) IFLE, (byte) RETURN};
byte[] expected = {ALOAD_2, (byte) INVOKEVIRTUAL, 0, (byte) F2L, LDC, (byte) L2D, (byte) INVOKEVIRTUAL, 0, (byte) D2L, (byte) CHECKCAST, 0, (byte) D2F, ASTORE, 4, ALOAD_2, (byte) INVOKEVIRTUAL, 0, (byte) F2L, LDC, (byte) D2I, (byte) INVOKEVIRTUAL, 0, (byte) D2L, (byte) CHECKCAST, 0, (byte) D2F, ASTORE, 5, ALOAD_0, (byte) INVOKEVIRTUAL, 0, (byte) I2B, (byte) INVOKEVIRTUAL, 0, (byte) I2C, ASTORE, 6, ALOAD_1, (byte) INVOKEVIRTUAL, 0, DUP_X2, (byte) CHECKCAST, 0, DUP2, ASTORE, 7, 1, ASTORE, 8, ALOAD, 7, (byte) INVOKEVIRTUAL, 0, (byte) I2S, ASTORE, 9, ALOAD, 7, (byte) INVOKEVIRTUAL, 0, (byte) LCMP, ASTORE, 10, ALOAD, 7, (byte) INVOKEVIRTUAL, 0, (byte) FCMPL, ASTORE, 11, ALOAD, 11, (byte) IFNULL, 0, 10, ALOAD, 11, (byte) INVOKEVIRTUAL, 0, (byte) FCMPG, ASTORE, 8, ALOAD, 6, (byte) IFNULL, 0, FLOAD_1, ALOAD, 4, (byte) INVOKESTATIC, 0, (byte) DCMPL, (byte) IFNE, 0, ILOAD_1, ALOAD, 6, ALOAD, 4, (byte) INVOKESTATIC, 0, (byte) DCMPG, (byte) INVOKEVIRTUAL, 0, (byte) IFEQ, ASTORE, 9, (byte) GETSTATIC, 0, (byte) IFNE, ALOAD, 9, ALOAD, 8, (byte) INVOKEVIRTUAL, 0, (byte) IFLT, ASTORE, 9, ALOAD, 9, (byte) IFNULL, 0, FLOAD_1, ALOAD, 5, (byte) INVOKESTATIC, 0, (byte) DCMPL, (byte) IFNE, 0, ILOAD_1, ALOAD, 9, ALOAD, 5, (byte) INVOKESTATIC, 0, (byte) DCMPG, (byte) INVOKEVIRTUAL, 0, (byte) IFEQ, ASTORE, 10, (byte) GETSTATIC, 0, (byte) IFNE, ALOAD, 10, ALOAD, 8, (byte) INVOKEVIRTUAL, 0, (byte) IFLT, ASTORE, 10, ALOAD, 7, ALOAD, 9, (byte) INVOKEVIRTUAL, 0, (byte) IFGE, ALOAD, 7, ALOAD, 10, (byte) INVOKEVIRTUAL, 0, 0, ALOAD_1, LDC, (byte) L2D, (byte) INVOKEVIRTUAL, 0, (byte) IFLE, ALOAD_1, LDC, (byte) D2I, (byte) INVOKEVIRTUAL, 0, (byte) IFLE, (byte) RETURN};
assertArrayEquals(expected, ByteCodeUtil.cleanUpByteCode(code));
assertArrayEquals(ArrayUtils.subarray(expected, 0, ASTORE), ByteCodeUtil.cleanUpByteCode(ArrayUtils.subarray(code, 0, ASTORE)));
assertArrayEquals(ArrayUtils.subarray(expected, 0, 58), ByteCodeUtil.cleanUpByteCode(ArrayUtils.subarray(code, 0, 58)));
}

}

0 comments on commit 769d41b

Please sign in to comment.