ItzSomebody / radon

[Abandoned] Scuffed java bytecode obfuscator
GNU General Public License v3.0
361 stars 74 forks source link

Add unit tests for me.itzsomebody.radon.utils.ASMUtils #80

Closed JohnLBergqvist closed 5 years ago

JohnLBergqvist commented 5 years ago

I've analysed your codebase and noticed that me.itzsomebody.radon.utils.ASMUtils is not fully tested. I've written some tests for the methods in this class with the help of Diffblue Cover.

Hopefully, these tests will help you detect any regressions caused by future code changes. If you would find it useful to have additional tests written for this repository, I would be more than happy to look at other classes that you consider important.

Col-E commented 5 years ago

For the sake of clarity the opcode constants should probably reference ASM's Opcodes utility class instead of being magic numbers.

JohnLBergqvist commented 5 years ago

@Col-E I've addressed those changes

Col-E commented 5 years ago

There's some over-zealous usage now.

Cases like new InsnNode(Opcodes.NOP) are correct since the constructor parameter is the instruction's opcode.

Cases like new LdcInsnNode((float)Opcodes.NOP) are not correct since the constructor parameter is a value, not the instruction's opcode.

JohnLBergqvist commented 5 years ago

@Col-E Fixed.