Pseudocode: Translate instruction classes to Kotlin
This commit is contained in:
@@ -109,7 +109,7 @@ public abstract class AbstractControlFlowTest extends AbstractPseudocodeTest {
|
||||
//check edges directions
|
||||
Collection<Instruction> instructions = pseudocode.getAllInstructions();
|
||||
for (Instruction instruction : instructions) {
|
||||
if (!((InstructionImpl)instruction).isDead()) {
|
||||
if (!((InstructionImpl)instruction).getDead()) {
|
||||
for (Instruction nextInstruction : instruction.getNextInstructions()) {
|
||||
assertTrue("instruction '" + instruction + "' has '" + nextInstruction + "' among next instructions list, but not vice versa",
|
||||
nextInstruction.getPreviousInstructions().contains(instruction));
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class AbstractPseudoValueTest : AbstractPseudocodeTest() {
|
||||
fun elementText(element: JetElement): String = element.getText()!!.replaceAll("\\s+", " ")
|
||||
|
||||
fun valueDescription(element: JetElement, value: PseudoValue): String {
|
||||
return if (value.element != element) "COPY" else "NEW${value.createdAt.getInputValues().makeString(", ", "(", ")")}"
|
||||
return if (value.element != element) "COPY" else "NEW${value.createdAt.inputValues.makeString(", ", "(", ")")}"
|
||||
}
|
||||
|
||||
val elementToValues = getElementToValueMap(pseudocode)
|
||||
|
||||
@@ -135,7 +135,7 @@ public abstract class AbstractPseudocodeTest extends KotlinTestWithEnvironment {
|
||||
@NotNull Set<Instruction> remainedAfterPostProcessInstructions
|
||||
) {
|
||||
boolean isRemovedThroughPostProcess = !remainedAfterPostProcessInstructions.contains(instruction);
|
||||
assert isRemovedThroughPostProcess == ((InstructionImpl)instruction).isDead();
|
||||
assert isRemovedThroughPostProcess == ((InstructionImpl)instruction).getDead();
|
||||
return isRemovedThroughPostProcess ? "-" : " ";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user