use of org.robovm.compiler.util.generic.SootMethodType 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]);
}
}
use of org.robovm.compiler.util.generic.SootMethodType in project robovm by robovm.
the class ObjCBlockPluginTest method testResolveTargetMethodSignatureGenericWithUnresolvedIndirectTypeVariable.
@Test(expected = CompilerException.class)
public void testResolveTargetMethodSignatureGenericWithUnresolvedIndirectTypeVariable() throws Exception {
SootMethod target = toSootClass(F.class).getMethodByName("run");
SootMethod m = toSootClass(Runners.class).getMethodByName("runner7");
SootMethodType mType = new SootMethodType(m);
ObjCBlockPlugin.resolveTargetMethodSignature(m, target, mType.getGenericParameterTypes()[0]);
}
Aggregations