-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
232 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
jadx-core/src/test/java/jadx/tests/integration/conditions/TestBitwiseAnd.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package jadx.tests.integration.conditions; | ||
|
||
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 TestBitwiseAnd extends IntegrationTest { | ||
|
||
public static class TestCls { | ||
private boolean a; | ||
private boolean b; | ||
|
||
public void test() { | ||
if ((a & b) != false) { | ||
test(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test() { | ||
noDebugInfo(); | ||
ClassNode cls = getClassNode(TestCls.class); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("if (this.a && this.b) {")); | ||
} | ||
|
||
public static class TestCls2 { | ||
private boolean a; | ||
private boolean b; | ||
|
||
public void test() { | ||
if ((a & b) != true) { | ||
test(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test2() { | ||
noDebugInfo(); | ||
ClassNode cls = getClassNode(TestCls2.class); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("if (!this.a || !this.b) {")); | ||
} | ||
|
||
public static class TestCls3 { | ||
private boolean a; | ||
private boolean b; | ||
|
||
public void test() { | ||
if ((a & b) == false) { | ||
test(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test3() { | ||
noDebugInfo(); | ||
ClassNode cls = getClassNode(TestCls3.class); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("if (!this.a || !this.b) {")); | ||
} | ||
|
||
public static class TestCls4 { | ||
private boolean a; | ||
private boolean b; | ||
|
||
public void test() { | ||
if ((a & b) == true) { | ||
test(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test4() { | ||
noDebugInfo(); | ||
ClassNode cls = getClassNode(TestCls4.class); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("if (this.a && this.b) {")); | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
jadx-core/src/test/java/jadx/tests/integration/conditions/TestBitwiseOr.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package jadx.tests.integration.conditions; | ||
|
||
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 TestBitwiseOr extends IntegrationTest { | ||
|
||
public static class TestCls { | ||
private boolean a; | ||
private boolean b; | ||
|
||
public void test() { | ||
if ((a | b) != false) { | ||
test(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test() { | ||
noDebugInfo(); | ||
ClassNode cls = getClassNode(TestCls.class); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("if (this.a || this.b) {")); | ||
} | ||
|
||
public static class TestCls2 { | ||
private boolean a; | ||
private boolean b; | ||
|
||
public void test() { | ||
if ((a | b) != true) { | ||
test(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test2() { | ||
noDebugInfo(); | ||
ClassNode cls = getClassNode(TestCls2.class); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("if (!this.a && !this.b) {")); | ||
} | ||
|
||
public static class TestCls3 { | ||
private boolean a; | ||
private boolean b; | ||
|
||
public void test() { | ||
if ((a | b) == false) { | ||
test(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test3() { | ||
noDebugInfo(); | ||
ClassNode cls = getClassNode(TestCls3.class); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("if (!this.a && !this.b) {")); | ||
} | ||
|
||
public static class TestCls4 { | ||
private boolean a; | ||
private boolean b; | ||
|
||
public void test() { | ||
if ((a | b) == true) { | ||
test(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test4() { | ||
noDebugInfo(); | ||
ClassNode cls = getClassNode(TestCls4.class); | ||
String code = cls.getCode().toString(); | ||
|
||
assertThat(code, containsOne("if (this.a || this.b) {")); | ||
} | ||
} |
33 changes: 0 additions & 33 deletions
33
jadx-core/src/test/java/jadx/tests/integration/conditions/TestConditions17.java
This file was deleted.
Oops, something went wrong.