tests fixed

This commit is contained in:
svtk
2011-10-24 13:01:46 +04:00
parent 23278d1427
commit f074366694
4 changed files with 12 additions and 8 deletions
@@ -107,11 +107,15 @@ public class JetControlFlowTest extends JetTestCaseBase {
//check edges directions
Collection<Instruction> instructions = pseudocode.getInstructions();
for (Instruction instruction : instructions) {
for (Instruction nextInstruction : instruction.getNextInstructions()) {
assertTrue("instruction: " + instruction + " next: " + nextInstruction, nextInstruction.getPreviousInstructions().contains(instruction));
}
for (Instruction prevInstruction : instruction.getPreviousInstructions()) {
assertTrue("instruction: " + instruction + " prev: " + prevInstruction, prevInstruction.getNextInstructions().contains(instruction));
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));
}
}
}
}