Package jadx.tests.integration.loops

Source Code of jadx.tests.integration.loops.TestNestedLoops2

package jadx.tests.integration.loops;

import jadx.core.dex.nodes.ClassNode;
import jadx.tests.api.IntegrationTest;

import java.util.List;

import org.junit.Test;

import static jadx.tests.api.utils.JadxMatchers.containsOne;
import static org.junit.Assert.assertThat;

public class TestNestedLoops2 extends IntegrationTest {

  public static class TestCls {

    private boolean test(List<String> list) {
      int j = 0;
      for (int i = 0; i < list.size(); i++) {
        String s = list.get(i);
        while (j < s.length()) {
          j++;
        }
      }
      return j > 10;
    }
  }

  @Test
  public void test() {
    ClassNode cls = getClassNode(TestCls.class);
    String code = cls.getCode().toString();

    assertThat(code, containsOne("for (int i = 0; i < list.size(); i++) {"));
    assertThat(code, containsOne("while (j < ((String) list.get(i)).length()) {"));
  }
}
TOP

Related Classes of jadx.tests.integration.loops.TestNestedLoops2

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.