Constant parameter test, kind of slow though, 46s.

This commit is contained in:
Adam
2016-03-24 17:25:16 -04:00
parent cbdf406434
commit b16fbd712e
2 changed files with 43 additions and 0 deletions

View File

@@ -490,6 +490,9 @@ public class ConstantParameter implements Deobfuscator
// move things that jump here to instead jump to 'to'
for (Instruction i : instructions.getInstructions())
i.replace(ins, to);
for (net.runelite.asm.attributes.code.Exception e : instructions.getCode().getExceptions().getExceptions())
e.replace(ins, to);
instructions.remove(ins);

View File

@@ -0,0 +1,40 @@
package net.runelite.deob.deobfuscators;
import java.io.File;
import java.io.IOException;
import net.runelite.asm.ClassGroup;
import net.runelite.deob.util.JarUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
public class ConstantParameterTest
{
private static final File GAMEPACK = new File(RenameUniqueTest.class.getResource("/gamepack_v16.jar").getFile());
@Rule
public TemporaryFolder folder = new TemporaryFolder();
private ClassGroup group;
@Before
public void before() throws IOException
{
group = JarUtil.loadJar(GAMEPACK);
}
@After
public void after() throws IOException
{
JarUtil.saveJar(group, folder.newFile());
}
@Test
public void testRun()
{
ConstantParameter cp = new ConstantParameter();
cp.run(group);
}
}