Package jadx.tests.integration.fallback

Source Code of jadx.tests.integration.fallback.TestFallbackMode$TestCls

package jadx.tests.integration.fallback;

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 TestFallbackMode extends IntegrationTest {

  public static class TestCls {

    public int test(int a) {
      while (a < 10) {
        a++;
      }
      return a;
    }
  }

  @Test
  public void test() {
    setFallback();
    disableCompilation();

    ClassNode cls = getClassNode(TestCls.class);
    String code = cls.getCode().toString();

    assertThat(code, containsString("public int test(int r2) {"));
    assertThat(code, containsString("r1_this = this;"));
    assertThat(code, containsString("L_0x0004:"));
    assertThat(code, not(containsString("throw new UnsupportedOperationException")));
  }
}
TOP

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