Skip to content

Commit c4facd0

Browse files
committed
Add DecompilerFactory test
1 parent 1b561da commit c4facd0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/test/java/kaiju/ghihorn/GhiHornTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import kaiju.tools.ghihorn.answer.graph.GhiHornAnswerGraphVertex;
5757
import kaiju.tools.ghihorn.api.ApiEntry;
5858
import kaiju.tools.ghihorn.cmd.GhiHornCommand;
59+
import kaiju.tools.ghihorn.decompiler.DecompilerFactory;
5960
import kaiju.tools.ghihorn.hornifer.GhiHornifier;
6061
import kaiju.tools.ghihorn.hornifer.block.HornBlock;
6162
import kaiju.tools.ghihorn.hornifer.horn.GhiHornAnswer;
@@ -2686,6 +2687,22 @@ public void testSigArgsAndRetn() {
26862687
assertTrue(apiFunc1.getApiRetnValue().equals("HR1"));
26872688
}
26882689

2690+
// This test is here because the ghihorn tests don't actually test the
2691+
// DecompilerFactory, which is used in the GUI.
2692+
@Test
2693+
public void testDecompilerFactory() {
2694+
try {
2695+
Program program = testEnv.importTestProgram("msvc32b-fileopen-single.exe");
2696+
2697+
var tool = testEnv.getEnv().getTool();
2698+
2699+
var decompiler = new DecompilerFactory(program, tool).createDecompiler();
2700+
} catch (Exception e) {
2701+
e.printStackTrace();
2702+
fail("Failed to create decompiler: " + e.getMessage());
2703+
}
2704+
}
2705+
26892706
@Test
26902707
public void testApiAnalyzerSingleFunction() {
26912708

0 commit comments

Comments
 (0)