use of org.jf.smalidea.debugging.SmaliPositionManager in project smali by JesusFreke.
the class SmaliPositionManagerTest method testGetAllClasses.
public void testGetAllClasses() throws NoDataException {
myFixture.addFileToProject("my/pkg/blah.smali", testClass);
SmaliPositionManager positionManager = new SmaliPositionManager(new MockDebugProcess());
List<ReferenceType> classes = positionManager.getAllClasses(positionManager.getSourcePosition("my.pkg.blah", "getRandomParentType", "(I)I", 0));
Assert.assertEquals(1, classes.size());
Assert.assertEquals("my.pkg.blah", classes.get(0).name());
}
use of org.jf.smalidea.debugging.SmaliPositionManager in project smali by JesusFreke.
the class SmaliPositionManagerTest method testGetSourcePosition.
public void testGetSourcePosition() throws NoDataException {
myFixture.addFileToProject("my/pkg/blah.smali", testClass);
SmaliPositionManager positionManager = new SmaliPositionManager(new MockDebugProcess());
SourcePosition sourcePosition = positionManager.getSourcePosition("my.pkg.blah", "getRandomParentType", "(I)I", 0);
Assert.assertEquals(Opcode.CONST_4, ((SmaliInstruction) sourcePosition.getElementAt()).getOpcode());
Assert.assertEquals(0, ((SmaliInstruction) sourcePosition.getElementAt()).getOffset());
sourcePosition = positionManager.getSourcePosition("my.pkg.blah", "getRandomParentType", "(I)I", 10);
Assert.assertEquals(Opcode.INVOKE_VIRTUAL, ((SmaliInstruction) sourcePosition.getElementAt()).getOpcode());
Assert.assertEquals(20, ((SmaliInstruction) sourcePosition.getElementAt()).getOffset());
}
Aggregations