use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestLoopCondition2 method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsOne("int i = 0;"));
assertThat(code, containsOne("while (a && i < 10) {"));
assertThat(code, containsOne("i++;"));
assertThat(code, containsOne("return i;"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestLoopCondition3 method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsOne("while (a < 12) {"));
assertThat(code, containsOne("if (b + a < 9 && b < 8) {"));
assertThat(code, containsOne("if (b >= 2 && a > -1 && b < 6) {"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestLoopCondition4 method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsOne("int n = -1;"));
assertThat(code, containsOne("while (n < 0) {"));
assertThat(code, containsOne("n += 12;"));
assertThat(code, containsOne("while (n > 11) {"));
assertThat(code, containsOne("n -= 12;"));
assertThat(code, containsOne("System.out.println(n);"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestLoopConditionInvoke method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsOne("do {"));
assertThat(code, containsOne("if (ch == '\\u0000') {"));
assertThat(code, containsOne("this.pos = startPos;"));
assertThat(code, containsOne("return false;"));
assertThat(code, containsOne("} while (ch != lastChar);"));
assertThat(code, containsOne("return true;"));
}
use of jadx.core.dex.nodes.ClassNode in project jadx by skylot.
the class TestLoopDetection2 method test.
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsOne("int c = a + b;"));
assertThat(code, containsOne("for (int i = a; i < b; i++) {"));
assertThat(code, not(containsString("c_2")));
}
Aggregations