Commit 7186a4a2 authored by Ahmed Ashour's avatar Ahmed Ashour Committed by skylot

test: add two cases for switch-try-break combination (PR #575)

parent ab4721a8
package jadx.tests.integration.conditions;
import org.junit.jupiter.api.Test;
import jadx.NotYetImplemented;
import jadx.tests.api.IntegrationTest;
public class TestSwitchTryBreak extends IntegrationTest {
public static class TestCls {
public void test(int x) {
switch(x) {
case 0:
return;
case 1:
String res;
if ("android".equals(toString())) {
res = "hello";
} else {
try {
if (String.CASE_INSENSITIVE_ORDER != null) {
break;
}
res = "hi";
} catch (Exception e) {
break;
}
}
System.out.println(res);
}
System.out.println("returning");
}
}
@Test
@NotYetImplemented
public void test() {
getClassNode(TestCls.class);
}
}
package jadx.tests.integration.conditions;
import org.junit.jupiter.api.Test;
import jadx.NotYetImplemented;
import jadx.tests.api.IntegrationTest;
public class TestSwitchTryBreak2 extends IntegrationTest {
public static class TestCls {
public void test(int x) {
switch(x) {
case 0:
return;
case 1:
String res;
if ("android".equals(toString())) {
res = "hello";
} else {
try {
if (x == 5) {
break;
}
res = "hi";
} catch (Exception e) {
break;
}
}
System.out.println(res);
}
System.out.println("returning");
}
}
@Test
@NotYetImplemented
public void test() {
getClassNode(TestCls.class);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment