Package jadx.tests.integration.arrays

Source Code of jadx.tests.integration.arrays.TestArrays$TestCls

package jadx.tests.integration.arrays;

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

import org.junit.Test;

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

public class TestArrays extends IntegrationTest {
  public static class TestCls {

    public int test1(int i) {
      int[] a = new int[]{1, 2, 3, 5};
      return a[i];
    }

    public int test2(int i) {
      int[][] a = new int[i][i + 1];
      return a.length;
    }
  }

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

    assertThat(code, containsOne("return new int[]{1, 2, 3, 5}[i];"));
  }
}
TOP

Related Classes of jadx.tests.integration.arrays.TestArrays$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.