Search in sources :

Example 11 with Type

use of org.robovm.compiler.util.generic.Type in project robovm by robovm.

the class ObjCBlockPluginTest method testResolveTargetMethodSignature.

private void testResolveTargetMethodSignature(String runnerMethodName, Type expectedReturnType, Type... expectedParamTypes) {
    SootMethod m = toSootClass(Runners.class).getMethodByName(runnerMethodName);
    SootMethodType mType = new SootMethodType(m);
    SootMethod target = ObjCBlockPlugin.getBlockTargetMethod(m, 0);
    Type[] types = ObjCBlockPlugin.resolveTargetMethodSignature(m, target, mType.getGenericParameterTypes()[0]);
    assertEquals(target.getParameterCount() + 1, types.length);
    assertEquals(expectedReturnType, types[0]);
    for (int i = 0; i < types.length - 1; i++) {
        assertEquals(expectedParamTypes[i], types[i + 1]);
    }
}
Also used : SootTypeType(org.robovm.compiler.util.generic.SootTypeType) SootMethodType(org.robovm.compiler.util.generic.SootMethodType) SootClassType(org.robovm.compiler.util.generic.SootClassType) VoidType(soot.VoidType) Type(org.robovm.compiler.util.generic.Type) BooleanType(soot.BooleanType) SootMethodType(org.robovm.compiler.util.generic.SootMethodType) SootMethod(soot.SootMethod)

Aggregations

SootClassType (org.robovm.compiler.util.generic.SootClassType)11 SootMethodType (org.robovm.compiler.util.generic.SootMethodType)11 SootTypeType (org.robovm.compiler.util.generic.SootTypeType)11 Type (org.robovm.compiler.util.generic.Type)11 BooleanType (soot.BooleanType)11 VoidType (soot.VoidType)11 GenericArrayType (org.robovm.compiler.util.generic.GenericArrayType)10 ImplForType (org.robovm.compiler.util.generic.ImplForType)10 ParameterizedType (org.robovm.compiler.util.generic.ParameterizedType)10 WildcardType (org.robovm.compiler.util.generic.WildcardType)10 ByteType (soot.ByteType)10 CharType (soot.CharType)10 DoubleType (soot.DoubleType)10 FloatType (soot.FloatType)10 IntType (soot.IntType)10 LongType (soot.LongType)10 PrimType (soot.PrimType)10 RefType (soot.RefType)10 ShortType (soot.ShortType)10 MethodVisitor (org.objectweb.asm.MethodVisitor)4