jakarta-bcel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r550070 - /jakarta/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java
Date Sat, 23 Jun 2007 17:52:29 GMT
Author: dbrosius
Date: Sat Jun 23 10:52:29 2007
New Revision: 550070

URL: http://svn.apache.org/viewvc?view=rev&rev=550070
Log:
improve the test

Modified:
    jakarta/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java

Modified: jakarta/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java?view=diff&rev=550070&r1=550069&r2=550070
==============================================================================
--- jakarta/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java (original)
+++ jakarta/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java Sat Jun
23 10:52:29 2007
@@ -5,6 +5,7 @@
 import org.apache.bcel.AbstractTestCase;
 import org.apache.bcel.classfile.JavaClass;
 import org.apache.bcel.classfile.Method;
+import org.apache.bcel.generic.InstructionHandle;
 import org.apache.bcel.generic.InstructionList;
 import org.apache.bcel.util.InstructionFinder;
 import org.apache.bcel.util.InstructionFinder.CodeConstraint;
@@ -33,13 +34,13 @@
 		InstructionFinder finder = new InstructionFinder(il);
 		Iterator it = finder.search(".*", il.getStart(), null);
 		
-		int cnt = 0;
-		while (it.hasNext())
+		InstructionHandle[] ihs = (InstructionHandle[])it.next();
+		int size = 0;
+		for (InstructionHandle ih : ihs)
 		{
-			it.next();
-			cnt++;
+			size += ih.getInstruction().getLength();
 		}
+		assertEquals(bytes.length, size);
 		
-		assertEquals(1, cnt);
 	}
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Mime
View raw message