Package jadx.tests.integration.loops

Source Code of jadx.tests.integration.loops.TestArrayForEachNegative$TestCls

package jadx.tests.integration.loops;

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

import org.junit.Test;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;

public class TestArrayForEachNegative extends IntegrationTest {

  public static class TestCls {

    private int test(int[] a, int[] b) {
      int sum = 0;
      for (int i = 0; i < a.length; i += 2) {
        sum += a[i];
      }
      for (int i = 1; i < a.length; i++) {
        sum += a[i];
      }
      for (int i = 0; i < a.length; i--) {
        sum += a[i];
      }
      for (int i = 0; i <= a.length; i++) {
        sum += a[i];
      }
      for (int i = 0; i + 1 < a.length; i++) {
        sum += a[i];
      }
      for (int i = 0; i < a.length; i++) {
        sum += a[i - 1];
      }
      for (int i = 0; i < b.length; i++) {
        sum += a[i];
      }
      int j = 0;
      for (int i = 0; i < a.length; j++) {
        sum += a[j];
      }
      return sum;
    }
  }

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

    assertThat(code, not(containsString(":")));
  }
}
TOP

Related Classes of jadx.tests.integration.loops.TestArrayForEachNegative$TestCls

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.