fix: bitwise or/and with non-boolean (#628) (PR #629)

This commit is contained in:
Ahmed Ashour
2019-04-24 18:31:49 +02:00
committed by skylot
parent 336d6ce189
commit 9645f33c7b
2 changed files with 47 additions and 9 deletions
@@ -0,0 +1,35 @@
package jadx.tests.integration.conditions;
import static jadx.tests.api.utils.JadxMatchers.containsOne;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.jupiter.api.Test;
import jadx.core.dex.nodes.ClassNode;
import jadx.tests.api.IntegrationTest;
public class TestConditions17 extends IntegrationTest {
public static class TestCls {
public static final int SOMETHING = 2;
public static void test(int a) {
if ((a & SOMETHING) != 0) {
print(1);
}
print(2);
}
public static void print(Object o) {
}
}
@Test
public void test() {
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsOne(" & "));
}
}