chore: resolve deprecations in tests
This commit is contained in:
@@ -42,11 +42,6 @@ public abstract class SmaliTest extends IntegrationTest {
|
||||
return getClassNodeFromSmali(getTestPkg() + File.separatorChar + getTestName(), fullClsName);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected ClassNode getClassNodeFromSmali(String clsName) {
|
||||
return getClassNodeFromSmali(clsName, clsName);
|
||||
}
|
||||
|
||||
protected ClassNode getClassNodeFromSmaliWithPath(String path, String clsName) {
|
||||
return getClassNodeFromSmali(path + File.separatorChar + clsName, clsName);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package jadx.tests.integration.loops;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import jadx.NotYetImplemented;
|
||||
import jadx.tests.api.IntegrationTest;
|
||||
|
||||
@@ -53,7 +51,7 @@ public class TestBreakInLoop3 extends IntegrationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
@NotYetImplemented
|
||||
public void test43() throws Exception {
|
||||
getClassNode(TestCls.class);
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import jadx.tests.api.SmaliTest;
|
||||
|
||||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat;
|
||||
|
||||
public class TestConstructor extends SmaliTest {
|
||||
// @formatter:off
|
||||
/*
|
||||
private SomeObject test(double r23, double r25, SomeObject r27) {
|
||||
SomeObject r17 = new SomeObject
|
||||
r0 = r17
|
||||
r1 = r27
|
||||
r0.<init>(r1)
|
||||
return r17
|
||||
}
|
||||
*/
|
||||
// @formatter:on
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
disableCompilation();
|
||||
assertThat(getClassNodeFromSmali())
|
||||
.code()
|
||||
.containsOne("new SomeObject(arg3);")
|
||||
.doesNotContain("= someObject");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import jadx.tests.api.SmaliTest;
|
||||
|
||||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat;
|
||||
|
||||
public class TestInlineVarArg extends SmaliTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
noDebugInfo();
|
||||
assertThat(getClassNodeFromSmali())
|
||||
.code()
|
||||
.containsOne("f(\"a\", \"b\", \"c\");");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import jadx.tests.api.SmaliTest;
|
||||
|
||||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat;
|
||||
|
||||
public class TestN21 extends SmaliTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
assertThat(getClassNodeFromSmali())
|
||||
.code()
|
||||
.countString(2, "while (");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package jadx.tests.integration;
|
||||
package jadx.tests.integration.others;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package jadx.tests.smali;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import jadx.core.dex.nodes.ClassNode;
|
||||
import jadx.tests.api.SmaliTest;
|
||||
|
||||
import static jadx.tests.api.utils.JadxMatchers.containsOne;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.CoreMatchers.not;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
public class TestConstructor extends SmaliTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
disableCompilation();
|
||||
ClassNode cls = getClassNodeFromSmali("TestConstructor");
|
||||
String code = cls.getCode().toString();
|
||||
|
||||
assertThat(code, containsOne("new SomeObject(arg3);"));
|
||||
assertThat(code, not(containsString("= someObject")));
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package jadx.tests.smali;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import jadx.core.dex.nodes.ClassNode;
|
||||
import jadx.tests.api.SmaliTest;
|
||||
|
||||
import static jadx.tests.api.utils.JadxMatchers.containsOne;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
public class TestInlineVarArg extends SmaliTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
noDebugInfo();
|
||||
ClassNode cls = getClassNodeFromSmali("TestInlineVarArg");
|
||||
String code = cls.getCode().toString();
|
||||
|
||||
assertThat(code, containsOne("f(\"a\", \"b\", \"c\");"));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package jadx.tests.smali;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import jadx.core.dex.nodes.ClassNode;
|
||||
import jadx.tests.api.SmaliTest;
|
||||
|
||||
public class TestN21 extends SmaliTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
ClassNode cls = getClassNodeFromSmali("TestN21");
|
||||
String code = cls.getCode().toString();
|
||||
System.out.println(code);
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
.class public LTestConstructor;
|
||||
.class public Lothers/TestConstructor;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
.method private test(DDLSomeObject;)LSomeObject;
|
||||
@@ -20,4 +20,6 @@
|
||||
|
||||
.line 59
|
||||
.local v17, "localSomeObject":LSomeObject;
|
||||
|
||||
return-object v17
|
||||
.end method
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
.class public LTestInlineVarArg;
|
||||
.class public Lothers/TestInlineVarArg;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
.method public static varargs f([Ljava/lang/String;)V
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
move-object v1, v0
|
||||
|
||||
invoke-static {v1}, LTestInlineVarArg;->f([Ljava/lang/String;)V
|
||||
invoke-static {v1}, Lothers/TestInlineVarArg;->f([Ljava/lang/String;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
.class public LTestN21;
|
||||
.class public Lothers/TestN21;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
.method private static test([BI)I
|
||||
Reference in New Issue
Block a user