From d3dbdb24af026246adeebfed1c1e0fceae191ed3 Mon Sep 17 00:00:00 2001 From: Ahmed Ashour Date: Sat, 23 Mar 2019 08:26:44 +0100 Subject: [PATCH] test: use @NYI instead of commented TODO (PR #499) --- .../integration/TestStaticFieldsInit.java | 3 +- .../arith/TestFieldIncrement2.java | 22 ++++++++---- .../integration/arrays/TestArrayFill2.java | 36 ++++++++++++------- .../conditions/TestConditions3.java | 3 +- .../integration/conditions/TestNestedIf2.java | 1 - .../integration/conditions/TestTernary2.java | 20 ++++++++--- .../debuginfo/TestReturnSourceLine.java | 25 ++++++++----- .../inner/TestAnonymousClass5.java | 3 +- .../invoke/TestCastInOverloadedInvoke.java | 21 +++++------ .../integration/loops/TestLoopDetection3.java | 14 ++++++-- .../loops/TestSynchronizedInEndlessLoop.java | 15 ++++---- .../integration/others/TestIssue13a.java | 10 +++--- .../synchronize/TestSynchronized2.java | 15 ++++++-- .../integration/trycatch/TestFinally2.java | 13 +++++-- .../integration/trycatch/TestTryCatch5.java | 15 ++++++-- .../trycatch/TestTryCatchFinally2.java | 19 +++++++--- .../trycatch/TestTryCatchFinally5.java | 12 +++++-- .../trycatch/TryAfterDeclaration.java | 3 -- .../integration/types/TestTypeResolver3.java | 11 +++++- 19 files changed, 175 insertions(+), 86 deletions(-) diff --git a/jadx-core/src/test/java/jadx/tests/integration/TestStaticFieldsInit.java b/jadx-core/src/test/java/jadx/tests/integration/TestStaticFieldsInit.java index bdcb18a15..670b0a7ee 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/TestStaticFieldsInit.java +++ b/jadx-core/src/test/java/jadx/tests/integration/TestStaticFieldsInit.java @@ -34,7 +34,6 @@ public class TestStaticFieldsInit extends IntegrationTest { String code = cls.getCode().toString(); assertThat(code, not(containsString("public static final String s2 = null;"))); - // TODO: - // assertThat(code, containsString("public static final String s3 = null;")); + assertThat(code, containsString("public static final String s3 = null;")); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/arith/TestFieldIncrement2.java b/jadx-core/src/test/java/jadx/tests/integration/arith/TestFieldIncrement2.java index 88ef906c8..95d865eda 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/arith/TestFieldIncrement2.java +++ b/jadx-core/src/test/java/jadx/tests/integration/arith/TestFieldIncrement2.java @@ -1,13 +1,14 @@ package jadx.tests.integration.arith; -import org.junit.jupiter.api.Test; - -import jadx.core.dex.nodes.ClassNode; -import jadx.tests.api.IntegrationTest; - import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.jupiter.api.Test; + +import jadx.NotYetImplemented; +import jadx.core.dex.nodes.ClassNode; +import jadx.tests.api.IntegrationTest; + public class TestFieldIncrement2 extends IntegrationTest { public static class TestCls { @@ -33,7 +34,14 @@ public class TestFieldIncrement2 extends IntegrationTest { assertThat(code, containsString("this.a.f += n;")); assertThat(code, containsString("a.f *= n;")); - // TODO - // assertThat(code, containsString("this.a.f *= n;")); + } + + @Test + @NotYetImplemented + public void test2() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, containsString("this.a.f *= n;")); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/arrays/TestArrayFill2.java b/jadx-core/src/test/java/jadx/tests/integration/arrays/TestArrayFill2.java index f04fd1b0b..70a75cba3 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/arrays/TestArrayFill2.java +++ b/jadx-core/src/test/java/jadx/tests/integration/arrays/TestArrayFill2.java @@ -1,13 +1,14 @@ package jadx.tests.integration.arrays; -import org.junit.jupiter.api.Test; - -import jadx.core.dex.nodes.ClassNode; -import jadx.tests.api.IntegrationTest; - import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.jupiter.api.Test; + +import jadx.NotYetImplemented; +import jadx.core.dex.nodes.ClassNode; +import jadx.tests.api.IntegrationTest; + public class TestArrayFill2 extends IntegrationTest { public static class TestCls { @@ -15,11 +16,6 @@ public class TestArrayFill2 extends IntegrationTest { public int[] test(int a) { return new int[]{1, a + 1, 2}; } - - // TODO -// public int[] test2(int a) { -// return new int[]{1, a++, a * 2}; -// } } @Test @@ -28,8 +24,22 @@ public class TestArrayFill2 extends IntegrationTest { String code = cls.getCode().toString(); assertThat(code, containsString("return new int[]{1, a + 1, 2};")); - - // TODO - // assertThat(code, containsString("return new int[]{1, a++, a * 2};")); } + + public static class TestCls2 { + + public int[] test2(int a) { + return new int[]{1, a++, a * 2}; + } + } + + @Test + @NotYetImplemented + public void test2() { + ClassNode cls = getClassNode(TestCls2.class); + String code = cls.getCode().toString(); + + assertThat(code, containsString("return new int[]{1, a++, a * 2};")); + } + } diff --git a/jadx-core/src/test/java/jadx/tests/integration/conditions/TestConditions3.java b/jadx-core/src/test/java/jadx/tests/integration/conditions/TestConditions3.java index 08d0e5e90..71f589188 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/conditions/TestConditions3.java +++ b/jadx-core/src/test/java/jadx/tests/integration/conditions/TestConditions3.java @@ -65,7 +65,6 @@ public class TestConditions3 extends IntegrationTest { assertThat(code, containsString("return null;")); assertThat(code, not(containsString("else"))); - // TODO: fix constant inline -// assertThat(code, not(containsString("AnonymousClass_1"))); + assertThat(code, not(containsString("AnonymousClass_1"))); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/conditions/TestNestedIf2.java b/jadx-core/src/test/java/jadx/tests/integration/conditions/TestNestedIf2.java index edc42d899..51c232e14 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/conditions/TestNestedIf2.java +++ b/jadx-core/src/test/java/jadx/tests/integration/conditions/TestNestedIf2.java @@ -52,6 +52,5 @@ public class TestNestedIf2 extends IntegrationTest { assertThat(code, containsOne("if (executedCount != repeatCount && isRun(delta, object)) {")); assertThat(code, containsOne("if (finished) {")); assertThat(code, not(containsString("else"))); - } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/conditions/TestTernary2.java b/jadx-core/src/test/java/jadx/tests/integration/conditions/TestTernary2.java index 6cb781474..3382284a7 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/conditions/TestTernary2.java +++ b/jadx-core/src/test/java/jadx/tests/integration/conditions/TestTernary2.java @@ -1,13 +1,16 @@ package jadx.tests.integration.conditions; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import org.junit.jupiter.api.Test; +import jadx.NotYetImplemented; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - public class TestTernary2 extends IntegrationTest { public static class TestCls { @@ -28,7 +31,14 @@ public class TestTernary2 extends IntegrationTest { assertEquals(1, count(code, "assertTrue")); assertEquals(1, count(code, "f(1, 0)")); - // TODO: -// assertThat(code, containsString("assertTrue(f(1, 0) == 0);")); + } + + @Test + @NotYetImplemented + public void test2() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, containsString("assertTrue(f(1, 0) == 0);")); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/debuginfo/TestReturnSourceLine.java b/jadx-core/src/test/java/jadx/tests/integration/debuginfo/TestReturnSourceLine.java index 7ac43cdb3..82dfb7d4e 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/debuginfo/TestReturnSourceLine.java +++ b/jadx-core/src/test/java/jadx/tests/integration/debuginfo/TestReturnSourceLine.java @@ -1,18 +1,19 @@ package jadx.tests.integration.debuginfo; +import static jadx.tests.api.utils.JadxMatchers.containsOne; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import org.junit.jupiter.api.Test; +import jadx.NotYetImplemented; import jadx.core.codegen.CodeWriter; import jadx.core.dex.attributes.nodes.LineAttrNode; import jadx.core.dex.nodes.ClassNode; import jadx.core.dex.nodes.MethodNode; import jadx.tests.api.IntegrationTest; -import static jadx.tests.api.utils.JadxMatchers.containsOne; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.hamcrest.MatcherAssert.assertThat; - public class TestReturnSourceLine extends IntegrationTest { public static class TestCls { @@ -59,10 +60,18 @@ public class TestReturnSourceLine extends IntegrationTest { MethodNode test2 = cls.searchMethodByName("test2(I)I"); checkLine(lines, codeWriter, test2, 3, "return v - 1;"); + } -// TODO: -// MethodNode test3 = cls.searchMethodByName("test3(I)I"); -// checkLine(lines, codeWriter, test3, 3, "return v;"); + @Test + @NotYetImplemented + public void test2() { + ClassNode cls = getClassNode(TestCls.class); + CodeWriter codeWriter = cls.getCode(); + String code = codeWriter.toString(); + String[] lines = code.split(CodeWriter.NL); + + MethodNode test3 = cls.searchMethodByName("test3(I)I"); + checkLine(lines, codeWriter, test3, 3, "return v;"); } private static void checkLine(String[] lines, CodeWriter cw, LineAttrNode node, int offset, String str) { diff --git a/jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass5.java b/jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass5.java index 0efbb4e96..3027c4d9a 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass5.java +++ b/jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass5.java @@ -79,7 +79,6 @@ public class TestAnonymousClass5 extends IntegrationTest { assertThat(code, containsOne("map.get(name);")); assertThat(code, not(containsString("access$008"))); - // TODO -// assertThat(code, not(containsString("synthetic"))); + assertThat(code, not(containsString("synthetic"))); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/invoke/TestCastInOverloadedInvoke.java b/jadx-core/src/test/java/jadx/tests/integration/invoke/TestCastInOverloadedInvoke.java index 30ccc3572..40097f8ae 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/invoke/TestCastInOverloadedInvoke.java +++ b/jadx-core/src/test/java/jadx/tests/integration/invoke/TestCastInOverloadedInvoke.java @@ -1,21 +1,18 @@ package jadx.tests.integration.invoke; -import java.util.ArrayList; -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; - -import jadx.NotYetImplemented; -import jadx.NotYetImplementedExtension; -import jadx.core.dex.nodes.ClassNode; -import jadx.tests.api.IntegrationTest; - import static jadx.tests.api.utils.JadxMatchers.containsOne; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -@ExtendWith(NotYetImplementedExtension.class) +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.Test; + +import jadx.NotYetImplemented; +import jadx.core.dex.nodes.ClassNode; +import jadx.tests.api.IntegrationTest; + public class TestCastInOverloadedInvoke extends IntegrationTest { public static class TestCls { diff --git a/jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopDetection3.java b/jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopDetection3.java index 72b755485..a789ef3ea 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopDetection3.java +++ b/jadx-core/src/test/java/jadx/tests/integration/loops/TestLoopDetection3.java @@ -1,7 +1,10 @@ package jadx.tests.integration.loops; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import jadx.NotYetImplemented; +import jadx.NotYetImplementedExtension; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; @@ -37,7 +40,14 @@ public class TestLoopDetection3 extends IntegrationTest { String code = cls.getCode().toString(); assertThat(code, containsString("while")); - // TODO - // assertThat(code, containsString("while (--pos >= 0) {")); + } + + @Test + @NotYetImplemented + public void test2() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, containsString("while (--pos >= 0) {")); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/loops/TestSynchronizedInEndlessLoop.java b/jadx-core/src/test/java/jadx/tests/integration/loops/TestSynchronizedInEndlessLoop.java index 4edb7bd37..a5392267f 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/loops/TestSynchronizedInEndlessLoop.java +++ b/jadx-core/src/test/java/jadx/tests/integration/loops/TestSynchronizedInEndlessLoop.java @@ -1,17 +1,14 @@ package jadx.tests.integration.loops; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; - -import jadx.NotYetImplemented; -import jadx.NotYetImplementedExtension; -import jadx.core.dex.nodes.ClassNode; -import jadx.tests.api.IntegrationTest; - import static jadx.tests.api.utils.JadxMatchers.containsOne; import static org.hamcrest.MatcherAssert.assertThat; -@ExtendWith(NotYetImplementedExtension.class) +import org.junit.jupiter.api.Test; + +import jadx.NotYetImplemented; +import jadx.core.dex.nodes.ClassNode; +import jadx.tests.api.IntegrationTest; + public class TestSynchronizedInEndlessLoop extends IntegrationTest { public static class TestCls { diff --git a/jadx-core/src/test/java/jadx/tests/integration/others/TestIssue13a.java b/jadx-core/src/test/java/jadx/tests/integration/others/TestIssue13a.java index f0c6fa682..186261f2b 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/others/TestIssue13a.java +++ b/jadx-core/src/test/java/jadx/tests/integration/others/TestIssue13a.java @@ -1,5 +1,10 @@ package jadx.tests.integration.others; +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; + import java.lang.reflect.Field; import java.util.HashMap; @@ -8,9 +13,6 @@ import org.junit.jupiter.api.Test; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; -import static jadx.tests.api.utils.JadxMatchers.containsOne; -import static org.hamcrest.MatcherAssert.assertThat; - public class TestIssue13a extends IntegrationTest { public static class TestCls { @@ -97,6 +99,6 @@ public class TestIssue13a extends IntegrationTest { } // TODO: add additional checks -// assertThat(code, not(containsString("Throwable"))); + assertThat(code, not(containsString("Throwable"))); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/synchronize/TestSynchronized2.java b/jadx-core/src/test/java/jadx/tests/integration/synchronize/TestSynchronized2.java index 9371e02cb..a90aabd47 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/synchronize/TestSynchronized2.java +++ b/jadx-core/src/test/java/jadx/tests/integration/synchronize/TestSynchronized2.java @@ -2,10 +2,12 @@ package jadx.tests.integration.synchronize; import org.junit.jupiter.api.Test; +import jadx.NotYetImplemented; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; public class TestSynchronized2 extends IntegrationTest { @@ -23,8 +25,15 @@ public class TestSynchronized2 extends IntegrationTest { assertThat(code, containsString("private static synchronized boolean test(Object obj) {")); assertThat(code, containsString("obj.toString() != null;")); - // TODO -// assertThat(code, containsString("return obj.toString() != null;")); -// assertThat(code, not(containsString("synchronized ("))); + } + + @Test + @NotYetImplemented + public void test2() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, containsString("return obj.toString() != null;")); + assertThat(code, not(containsString("synchronized ("))); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestFinally2.java b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestFinally2.java index efeb6d4ca..22daaf9ad 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestFinally2.java +++ b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestFinally2.java @@ -6,10 +6,12 @@ import java.io.InputStream; import org.junit.jupiter.api.Test; +import jadx.NotYetImplemented; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; import static jadx.tests.api.utils.JadxMatchers.containsOne; +import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; public class TestFinally2 extends IntegrationTest { @@ -57,7 +59,14 @@ public class TestFinally2 extends IntegrationTest { String code = cls.getCode().toString(); assertThat(code, containsOne("decode(inputStream);")); - // TODO - // assertThat(code, not(containsOne("result ="))); + } + + @Test + @NotYetImplemented + public void test2() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, not(containsOne("result ="))); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatch5.java b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatch5.java index f4702709a..7e1170f4d 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatch5.java +++ b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatch5.java @@ -6,6 +6,7 @@ import java.io.IOException; import org.junit.jupiter.api.Test; +import jadx.NotYetImplemented; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; @@ -48,9 +49,17 @@ public class TestTryCatch5 extends IntegrationTest { String code = cls.getCode().toString(); assertThat(code, containsString("try {")); - // TODO: -// assertThat(code, containsString("output = new FileOutputStream(file);")); -// assertThat(code, containsString("} catch (IOException e) {")); assertThat(code, containsString("file.delete();")); } + + @Test + @NotYetImplemented + public void test2() { + disableCompilation(); + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, containsString("output = new FileOutputStream(file);")); + assertThat(code, containsString("} catch (IOException e) {")); + } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally2.java b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally2.java index c6f6ea0e5..301333190 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally2.java +++ b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally2.java @@ -1,18 +1,20 @@ package jadx.tests.integration.trycatch; +import static jadx.tests.api.utils.JadxMatchers.containsOne; +import static jadx.tests.api.utils.JadxMatchers.countString; +import static org.hamcrest.MatcherAssert.assertThat; + import java.io.DataOutputStream; import java.io.IOException; import java.io.OutputStream; import org.junit.jupiter.api.Test; +import jadx.NotYetImplemented; import jadx.core.clsp.NClass; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; -import static jadx.tests.api.utils.JadxMatchers.containsOne; -import static org.hamcrest.MatcherAssert.assertThat; - public class TestTryCatchFinally2 extends IntegrationTest { public static class TestCls { @@ -52,9 +54,16 @@ public class TestTryCatchFinally2 extends IntegrationTest { assertThat(code, containsOne("for (NClass parent : parents) {")); - // TODO -// assertThat(code, countString(2, "for (NClass cls : classes) {")); assertThat(code, containsOne("for (NClass cls : this.classes) {")); assertThat(code, containsOne("for (NClass cls2 : this.classes) {")); } + + @Test + @NotYetImplemented + public void test2() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, countString(2, "for (NClass cls : classes) {")); + } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally5.java b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally5.java index 4cd415264..613aa092c 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally5.java +++ b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally5.java @@ -5,6 +5,7 @@ import java.util.List; import org.junit.jupiter.api.Test; +import jadx.NotYetImplemented; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; @@ -65,7 +66,14 @@ public class TestTryCatchFinally5 extends IntegrationTest { String code = cls.getCode().toString(); assertThat(code, containsOne("} finally {")); - // TODO: remove duplicates on multiple paths -// assertThat(code, containsOne("d.close();")); + } + + @Test + @NotYetImplemented + public void test2() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, containsOne("d.close();")); } } diff --git a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TryAfterDeclaration.java b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TryAfterDeclaration.java index 264d6c144..a43a91659 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/trycatch/TryAfterDeclaration.java +++ b/jadx-core/src/test/java/jadx/tests/integration/trycatch/TryAfterDeclaration.java @@ -8,14 +8,11 @@ import java.io.IOException; import java.io.InputStream; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import jadx.NotYetImplemented; -import jadx.NotYetImplementedExtension; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; -@ExtendWith(NotYetImplementedExtension.class) public class TryAfterDeclaration extends IntegrationTest { /** diff --git a/jadx-core/src/test/java/jadx/tests/integration/types/TestTypeResolver3.java b/jadx-core/src/test/java/jadx/tests/integration/types/TestTypeResolver3.java index 6150ee0bf..7a6773f97 100644 --- a/jadx-core/src/test/java/jadx/tests/integration/types/TestTypeResolver3.java +++ b/jadx-core/src/test/java/jadx/tests/integration/types/TestTypeResolver3.java @@ -2,6 +2,7 @@ package jadx.tests.integration.types; import org.junit.jupiter.api.Test; +import jadx.NotYetImplemented; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.IntegrationTest; @@ -26,10 +27,18 @@ public class TestTypeResolver3 extends IntegrationTest { ClassNode cls = getClassNode(TestCls.class); String code = cls.getCode().toString(); - // TODO inline into return assertThat(code, containsOne("s1.length() == s2.length() ? 0 : s1.length() < s2.length() ? -1 : 1;")); } + @Test + @NotYetImplemented + public void test3() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, containsOne("return s1.length() == s2.length() ? 0 : s1.length() < s2.length() ? -1 : 1;")); + } + @Test public void test2() { noDebugInfo();