From 5f18830c3f10a7ac1b30cfab48eb78cd680a36c8 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Mon, 29 Apr 2013 20:34:08 -0700 Subject: [PATCH] changes to adjust for lack of null instruction at index 0 --- .../src/com/ibm/wala/cast/java/test/JavaIRTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/com.ibm.wala.cast.java.test/src/com/ibm/wala/cast/java/test/JavaIRTests.java b/com.ibm.wala.cast.java.test/src/com/ibm/wala/cast/java/test/JavaIRTests.java index c94ec2ae7..48a4f8596 100644 --- a/com.ibm.wala.cast.java.test/src/com/ibm/wala/cast/java/test/JavaIRTests.java +++ b/com.ibm.wala.cast.java.test/src/com/ibm/wala/cast/java/test/JavaIRTests.java @@ -220,7 +220,7 @@ public abstract class JavaIRTests extends IRTests { MethodReference mref = descriptorToMethodRef("Source#ArrayLiteral1#main#([Ljava/lang/String;)V", cg.getClassHierarchy()); CGNode node = cg.getNodes(mref).iterator().next(); - SSAInstruction s = node.getIR().getInstructions()[3]; + SSAInstruction s = node.getIR().getInstructions()[2]; Assert.assertTrue("Did not find new array instruction.", s instanceof SSANewInstruction); Assert.assertTrue("", ((SSANewInstruction) s).getNewSite().getDeclaredType().isArrayType()); } @@ -245,7 +245,7 @@ public abstract class JavaIRTests extends IRTests { final SSAInstruction[] instructions = node.getIR().getInstructions(); // test 1 { - SSAInstruction s1 = instructions[3]; + SSAInstruction s1 = instructions[2]; if (s1 instanceof SSANewInstruction) { Assert.assertTrue("", ((SSANewInstruction) s1).getNewSite().getDeclaredType().isArrayType()); } else { @@ -254,7 +254,7 @@ public abstract class JavaIRTests extends IRTests { } // test 2 { - SSAInstruction s2 = instructions[4]; + SSAInstruction s2 = instructions[3]; if (s2 instanceof SSANewInstruction) { Assert.assertTrue("", ((SSANewInstruction) s2).getNewSite().getDeclaredType().isArrayType()); } else { @@ -264,7 +264,7 @@ public abstract class JavaIRTests extends IRTests { // test 3: the last 4 instructions are of the form y[i] = i+1; { final SymbolTable symbolTable = node.getIR().getSymbolTable(); - for (int i = 5; i <= 8; i++) { + for (int i = 4; i <= 7; i++) { Assert.assertTrue("Expected only array stores.", instructions[i] instanceof SSAArrayStoreInstruction); SSAArrayStoreInstruction as = (SSAArrayStoreInstruction) instructions[i]; @@ -302,7 +302,7 @@ public abstract class JavaIRTests extends IRTests { MethodReference mref = descriptorToMethodRef("Source#QualifiedStatic#main#([Ljava/lang/String;)V", cg.getClassHierarchy()); CGNode node = cg.getNodes(mref).iterator().next(); - SSAInstruction s = node.getIR().getInstructions()[5]; + SSAInstruction s = node.getIR().getInstructions()[4]; Assert.assertTrue("Did not find a getstatic instruction.", s instanceof SSAGetInstruction && ((SSAGetInstruction) s).isStatic());