From 36ee994eb826f9eb9ba7635592380a884c86f500 Mon Sep 17 00:00:00 2001 From: Ahmed Ashour Date: Mon, 25 Mar 2019 17:53:59 +0100 Subject: [PATCH] test: add test case for "xor with boolean" (#409) (PR #514) --- .../tests/integration/conditions/TestXor.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 jadx-core/src/test/java/jadx/tests/integration/conditions/TestXor.java diff --git a/jadx-core/src/test/java/jadx/tests/integration/conditions/TestXor.java b/jadx-core/src/test/java/jadx/tests/integration/conditions/TestXor.java new file mode 100644 index 000000000..bb40184f7 --- /dev/null +++ b/jadx-core/src/test/java/jadx/tests/integration/conditions/TestXor.java @@ -0,0 +1,34 @@ +package jadx.tests.integration.conditions; + +import static jadx.tests.api.utils.JadxMatchers.containsOne; +import static org.hamcrest.CoreMatchers.not; +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 TestXor extends IntegrationTest { + + public static class TestCls { + public boolean test() { + return test2() ^ true; + } + + public boolean test2() { + return true; + } + } + + @Test + @NotYetImplemented + public void test409() { + ClassNode cls = getClassNode(TestCls.class); + String code = cls.getCode().toString(); + + assertThat(code, not(containsOne("1"))); + } + +}