use of org.jf.smalidea.psi.impl.SmaliRegisterReference in project smali by JesusFreke.
the class SmaliRegisterTest method testRegisterReference.
public void testRegisterReference() {
String text = ".class public Lmy/pkg/blah; .super Ljava/lang/Object;\n" + ".method blah()V\n" + " .registers 123\n" + " const <ref>v10, 123\n" + " return-void\n" + ".end method";
SmaliFile file = (SmaliFile) myFixture.addFileToProject("my/pkg/blah.smali", text.replace("<ref>", ""));
PsiElement leafElement = file.findElementAt(text.indexOf("<ref>"));
Assert.assertNotNull(leafElement);
SmaliRegisterReference registerReference = (SmaliRegisterReference) leafElement.getParent();
Assert.assertNotNull(registerReference);
Assert.assertEquals(10, registerReference.getRegisterNumber());
// TODO: test parameter register
}
Aggregations