use of soot.SootClass in project robovm by robovm.
the class VTableTest method testA.
@Test
public void testA() {
SootClass sc = getSootClass("org.robovm.compiler.a.A");
VTable.Cache cache = new VTable.Cache();
VTable vtable = cache.get(sc);
assertEquals(14, vtable.size());
Entry toStringEntry = vtable.findEntry("toString", "()Ljava/lang/String;");
assertEquals(sc.getName(), toStringEntry.getDeclaringClass());
Entry superToStringEntry = cache.get(getSootClass("java.lang.Object")).findEntry("toString", "()Ljava/lang/String;");
assertEquals(superToStringEntry.getIndex(), toStringEntry.getIndex());
assertNotSame(toStringEntry, superToStringEntry);
Entry equalsEntry = vtable.findEntry("equals", "(Ljava/lang/Object;)Z");
assertEquals(sc.getName(), equalsEntry.getDeclaringClass());
Entry superEqualsEntry = cache.get(getSootClass("java.lang.Object")).findEntry("equals", "(Ljava/lang/Object;)Z");
assertEquals(superEqualsEntry.getIndex(), equalsEntry.getIndex());
assertNotSame(superEqualsEntry, equalsEntry);
Entry cloneEntry = vtable.findEntry("clone", "()Ljava/lang/Object;");
assertEquals("java.lang.Object", cloneEntry.getDeclaringClass());
Entry superCloneEntry = cache.get(getSootClass("java.lang.Object")).findEntry("clone", "()Ljava/lang/Object;");
assertSame(superCloneEntry, cloneEntry);
assertNull(vtable.findEntry("foo", "()V"));
Entry fooEntry = vtable.findEntry("org.robovm.compiler.a", "foo", "()V");
assertEquals(sc.getName(), fooEntry.getDeclaringClass());
assertEquals(11, fooEntry.getIndex());
}
use of soot.SootClass in project robovm by robovm.
the class AnnotationsTest method testCopyParameterAnnotationsTwiceMultipleSubsetWithShift.
@Test
public void testCopyParameterAnnotationsTwiceMultipleSubsetWithShift() {
SootClass sc = toSootClass(getClass());
SootMethod src = sc.getMethodByName("src8");
SootMethod dest = sc.getMethodByName("dest8");
copyParameterAnnotations(src, dest, 0, 2, 0, Visibility.Any);
copyParameterAnnotations(src, dest, 2, 3, 1, Visibility.Any);
assertEquals("void dest8(@A @B @C int, @B @C @D int, int, @C @D @E int)", toString(dest));
}
use of soot.SootClass in project robovm by robovm.
the class AnnotationsTest method testCopyParameterAnnotationsSingleLastNoShift.
@Test
public void testCopyParameterAnnotationsSingleLastNoShift() {
SootClass sc = toSootClass(getClass());
SootMethod src = sc.getMethodByName("src5");
SootMethod dest = sc.getMethodByName("dest5");
copyParameterAnnotations(src, dest, 1, 2, 0, Visibility.Any);
assertEquals("void dest5(int, @B int)", toString(dest));
}
use of soot.SootClass in project robovm by robovm.
the class AnnotationsTest method testCopyParameterAnnotationsMultipleSubsetWithShift.
@Test
public void testCopyParameterAnnotationsMultipleSubsetWithShift() {
SootClass sc = toSootClass(getClass());
SootMethod src = sc.getMethodByName("src7");
SootMethod dest = sc.getMethodByName("dest7");
copyParameterAnnotations(src, dest, 0, 3, 1, Visibility.Any);
assertEquals("void dest7(int, @A @B @C int, @B @C @D int, @C @D @E int)", toString(dest));
}
use of soot.SootClass in project robovm by robovm.
the class AnnotationsTest method testCopyParameterAnnotationsSingleFirstNoShift.
@Test
public void testCopyParameterAnnotationsSingleFirstNoShift() {
SootClass sc = toSootClass(getClass());
SootMethod src = sc.getMethodByName("src4");
SootMethod dest = sc.getMethodByName("dest4");
copyParameterAnnotations(src, dest, 0, 1, 0, Visibility.Any);
assertEquals("void dest4(@A int, int)", toString(dest));
}
Aggregations