use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodInterfaceMatchPointer.
@Test
public void testFindMarshalerMethodInterfaceMatchPointer() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo4.class).getMethodByName("foo3");
assertEquals(toSootClass(M2.class).getMethodByName("charSequenceToObject"), lookup.findMarshalerMethod(new MarshalSite(method)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("charSequenceToNative"), lookup.findMarshalerMethod(new MarshalSite(method, 0)).getMethod());
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerStructMemberPrimitiveArray2D.
@Test
public void testFindMarshalerStructMemberPrimitiveArray2D() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod getter = toSootClass(TestStruct.class).getMethodByName("getV3");
SootMethod setter = toSootClass(TestStruct.class).getMethodByName("setV3");
assertEquals(toSootClass(M2.class).getMethodByName("byteArray2DToObject"), lookup.findMarshalerMethod(new MarshalSite(getter)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("byteArray2DToNative"), lookup.findMarshalerMethod(new MarshalSite(setter, 0)).getMethod());
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodSuperclassMatchValue.
@Test
public void testFindMarshalerMethodSuperclassMatchValue() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo4.class).getMethodByName("foo4");
assertEquals(toSootClass(M2.class).getMethodByName("numberToObject"), lookup.findMarshalerMethod(new MarshalSite(method)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("numberToNative"), lookup.findMarshalerMethod(new MarshalSite(method, 0)).getMethod());
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodInterfaceDirectMatchPointer.
@Test
public void testFindMarshalerMethodInterfaceDirectMatchPointer() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo4.class).getMethodByName("foo9");
assertEquals(toSootClass(M2.class).getMethodByName("charSequenceToObject"), lookup.findMarshalerMethod(new MarshalSite(method)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("charSequenceToNative"), lookup.findMarshalerMethod(new MarshalSite(method, 0)).getMethod());
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodUnsuccessfulSearchNoMatchingMarshaler.
@Test
public void testFindMarshalerMethodUnsuccessfulSearchNoMatchingMarshaler() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo2.class).getMethodByName("foo");
try {
lookup.findMarshalerMethod(new MarshalSite(method));
fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
}
try {
lookup.findMarshalerMethod(new MarshalSite(method, 0));
fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
}
}
Aggregations