use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestIfTryInCatch method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, countString(2, "try {"));
assertThat(code, containsOne("if ("));
assertThat(code, countString(2, "return f();"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestSwitch2 method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
// assertThat(code, countString(4, "break;"));
// assertThat(code, countString(2, "return;"));
// TODO: remove redundant break and returns
assertThat(code, countString(5, "break;"));
assertThat(code, countString(4, "return;"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestBreakInComplexIf method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsOne("if (tile == null || tile.y != 100) {"));
assertThat(code, containsOne("break;"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestBreakInComplexIf2 method testNoDebug.
@Test
public void testNoDebug() {
noDebugInfo();
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, countString(2, "break;"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestBreakInLoop method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsOne("for (int i = 0; i < a.length; i++) {"));
// assertThat(code, containsOne("a[i]++;"));
assertThat(code, containsOne("if (i < b) {"));
assertThat(code, containsOne("break;"));
assertThat(code, containsOne("this.f++;"));
assertThat(code, countString(0, "else"));
}
Aggregations