forked from openrs2/openrs2
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
821 B
31 lines
821 B
package dev.openrs2.deob.ir.translation
|
|
|
|
import dev.openrs2.deob.ir.translation.fixture.Fixture
|
|
import dev.openrs2.deob.ir.translation.fixture.FixtureMethod
|
|
import org.junit.jupiter.api.Test
|
|
|
|
class BytecodeToIrTranlatorTests {
|
|
|
|
@Test
|
|
fun `Creates entry basic block`() {
|
|
class CfgSample() : Fixture {
|
|
val a = true
|
|
val b = false
|
|
|
|
override fun test() {
|
|
if (a) {
|
|
println("a")
|
|
} else if (b) {
|
|
println("b")
|
|
}
|
|
}
|
|
}
|
|
|
|
val fixture = FixtureMethod.from(CfgSample::class)
|
|
val decompiler = BytecodeToIrTranlator()
|
|
val irMethod = decompiler.decompile(fixture.owner, fixture.method)
|
|
|
|
// @TODO - some way of asserting on the output cfg?
|
|
}
|
|
}
|
|
|
|
|