diff --git a/jadx-core/src/test/java/jadx/tests/integration/loops/TestNestedLoops4.java b/jadx-core/src/test/java/jadx/tests/integration/loops/TestNestedLoops4.java index f7c6ea7f4..33ee3324d 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/loops/TestNestedLoops4.java +++ b/jadx-core/src/test/java/jadx/tests/integration/loops/TestNestedLoops4.java @@ -16,7 +16,7 @@ public class TestNestedLoops4 extends IntegrationTest { for (int j = 0; j < 54; j += 4) { if (i < j) { for (int k = j; k < j + 4; k++) { - if (tmp> k) { + if (tmp > k) { return 0; } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/loops/TestNestedLoops5.java b/jadx-core/src/test/java/jadx/tests/integration/loops/TestNestedLoops5.java new file mode 100644 index 000000000..02c8ffd14 --- /dev/null +++ b/jadx-core/src/test/java/jadx/tests/integration/loops/TestNestedLoops5.java @@ -0,0 +1,46 @@ +package jadx.tests.integration.loops; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import jadx.NotYetImplemented; +import jadx.core.dex.nodes.ClassNode; +import jadx.tests.api.IntegrationTest; + +public class TestNestedLoops5 extends IntegrationTest { + + public static class TestCls { + + public int testFor() { + int tmp = 1; + for (int i = 5; i > -1; i--) { + if (i > tmp) { + for (int j = 1; j < 5; j++) { + if (tmp > j * 100) { + return 0; + } + } + } + tmp++; + } + return tmp; + } + + public void check() { + assertEquals(7, testFor()); + } + } + + @Test + @NotYetImplemented + public void test() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, not(containsString("continue;"))); + } +}