提交 1bb90233 编写于 作者: S Skylot

test: NYI tests for #836 and #837

上级 49ce92f5
package jadx.tests.integration.types;
import org.junit.jupiter.api.Test;
import jadx.NotYetImplemented;
import jadx.tests.api.IntegrationTest;
public class TestTypeResolver11 extends IntegrationTest {
public static class TestCls {
public Void test(Object... objArr) {
int val = (Integer) objArr[0];
String str = (String) objArr[1];
call(str, str, val, val);
return null;
}
private void call(String a, String b, int... val) {
}
public void check() {
test(1, "str");
}
}
@NotYetImplemented("Missing cast")
@Test
public void test() {
getClassNode(TestCls.class);
}
@NotYetImplemented("Missing cast")
@Test
public void testNoDebug() {
noDebugInfo();
getClassNode(TestCls.class);
}
}
package jadx.tests.integration.types;
import java.lang.ref.WeakReference;
import org.junit.jupiter.api.Test;
import jadx.NotYetImplemented;
import jadx.tests.api.IntegrationTest;
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat;
public class TestTypeResolver12 extends IntegrationTest {
public abstract static class TestCls<T> {
private WeakReference<T> ref;
public void test(String str) {
T obj = this.ref.get();
if (obj != null) {
call(obj, str);
}
}
public abstract void call(T t, String str);
}
@Test
public void test() {
assertThat(getClassNode(TestCls.class))
.code()
.containsOne("T obj = this.ref.get();");
}
@NotYetImplemented("Generic type inference")
@Test
public void testNoDebug() {
noDebugInfo();
assertThat(getClassNode(TestCls.class))
.code()
.doesNotContain("Object obj")
.containsOne("T obj = this.ref.get();");
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册