mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 12:20:11 +02:00
More proper unit test conditions.
This commit is contained in:
parent
180529840c
commit
46619d11bf
@ -75,8 +75,8 @@ public class PayloadAlignmentTest {
|
|||||||
|
|
||||||
int codeOffset = 0;
|
int codeOffset = 0;
|
||||||
for (Instruction instr: writeUtil.getInstructions()) {
|
for (Instruction instr: writeUtil.getInstructions()) {
|
||||||
if (codeOffset == 1) {
|
if (instr.getOpcode().equals(Opcode.ARRAY_PAYLOAD)) {
|
||||||
Assert.assertEquals("array payload was not aligned properly", instr.getOpcode(), Opcode.NOP);
|
Assert.assertEquals("array payload was not aligned properly", codeOffset%2, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
codeOffset += instr.getCodeUnits();
|
codeOffset += instr.getCodeUnits();
|
||||||
@ -97,8 +97,8 @@ public class PayloadAlignmentTest {
|
|||||||
|
|
||||||
int codeOffset = 0;
|
int codeOffset = 0;
|
||||||
for (Instruction instr: writeUtil.getInstructions()) {
|
for (Instruction instr: writeUtil.getInstructions()) {
|
||||||
if (codeOffset == 1) {
|
if (instr.getOpcode().equals(Opcode.PACKED_SWITCH_PAYLOAD)) {
|
||||||
Assert.assertEquals("packed switch payload was not aligned properly", instr.getOpcode(), Opcode.NOP);
|
Assert.assertEquals("packed switch payload was not aligned properly", codeOffset%2, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
codeOffset += instr.getCodeUnits();
|
codeOffset += instr.getCodeUnits();
|
||||||
@ -121,8 +121,8 @@ public class PayloadAlignmentTest {
|
|||||||
|
|
||||||
int codeOffset = 0;
|
int codeOffset = 0;
|
||||||
for (Instruction instr: writeUtil.getInstructions()) {
|
for (Instruction instr: writeUtil.getInstructions()) {
|
||||||
if (codeOffset == 1) {
|
if (instr.getOpcode().equals(Opcode.SPARSE_SWITCH_PAYLOAD)) {
|
||||||
Assert.assertEquals("packed switch payload was not aligned properly", instr.getOpcode(), Opcode.NOP);
|
Assert.assertEquals("packed switch payload was not aligned properly", codeOffset%2, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
codeOffset += instr.getCodeUnits();
|
codeOffset += instr.getCodeUnits();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user