diff --git a/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java b/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java index c77756f2335..2169111c5ae 100644 --- a/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java +++ b/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java @@ -100,4 +100,22 @@ public abstract class AbstractControlFlowTest extends AbstractPseudocodeTest { } return Collections.singleton(natural).equals(new HashSet(actual)); } + + @Override + protected void checkPseudocode(PseudocodeImpl pseudocode) { + //check edges directions + Collection instructions = pseudocode.getAllInstructions(); + for (Instruction instruction : instructions) { + if (!((InstructionImpl)instruction).isDead()) { + for (Instruction nextInstruction : instruction.getNextInstructions()) { + assertTrue("instruction '" + instruction + "' has '" + nextInstruction + "' among next instructions list, but not vice versa", + nextInstruction.getPreviousInstructions().contains(instruction)); + } + for (Instruction prevInstruction : instruction.getPreviousInstructions()) { + assertTrue("instruction '" + instruction + "' has '" + prevInstruction + "' among previous instructions list, but not vice versa", + prevInstruction.getNextInstructions().contains(instruction)); + } + } + } + } } diff --git a/compiler/tests/org/jetbrains/jet/cfg/AbstractPseudocodeTest.java b/compiler/tests/org/jetbrains/jet/cfg/AbstractPseudocodeTest.java index 37177ef5307..9905d3a05e5 100644 --- a/compiler/tests/org/jetbrains/jet/cfg/AbstractPseudocodeTest.java +++ b/compiler/tests/org/jetbrains/jet/cfg/AbstractPseudocodeTest.java @@ -122,21 +122,7 @@ public abstract class AbstractPseudocodeTest extends KotlinTestWithEnvironment { JetTestUtils.assertEqualsToFile(expectedInstructionsFile, instructionDump.toString()); } - private void checkPseudocode(PseudocodeImpl pseudocode) { - //check edges directions - Collection instructions = pseudocode.getAllInstructions(); - for (Instruction instruction : instructions) { - if (!((InstructionImpl)instruction).isDead()) { - for (Instruction nextInstruction : instruction.getNextInstructions()) { - assertTrue("instruction '" + instruction + "' has '" + nextInstruction + "' among next instructions list, but not vice versa", - nextInstruction.getPreviousInstructions().contains(instruction)); - } - for (Instruction prevInstruction : instruction.getPreviousInstructions()) { - assertTrue("instruction '" + instruction + "' has '" + prevInstruction + "' among previous instructions list, but not vice versa", - prevInstruction.getNextInstructions().contains(instruction)); - } - } - } + protected void checkPseudocode(PseudocodeImpl pseudocode) { } private static String formatInstruction(Instruction instruction, int maxLength, Set remainedAfterPostProcessInstructions) {