use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodClassMatchArray.
@Test
public void testFindMarshalerMethodClassMatchArray() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo4.class).getMethodByName("foo6");
assertEquals(toSootClass(M2.class).getMethodByName("stringArrayToObject"), lookup.findMarshalerMethod(new MarshalSite(method)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("stringArrayToNative"), lookup.findMarshalerMethod(new MarshalSite(method, 0)).getMethod());
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodUnsuccessfulSearchNoMarshalers.
@Test
public void testFindMarshalerMethodUnsuccessfulSearchNoMarshalers() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo1.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) {
}
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodClassMatchPointer.
@Test
public void testFindMarshalerMethodClassMatchPointer() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo4.class).getMethodByName("foo1");
assertEquals(toSootClass(M2.class).getMethodByName("stringToObject"), lookup.findMarshalerMethod(new MarshalSite(method)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("stringToNative"), lookup.findMarshalerMethod(new MarshalSite(method, 0)).getMethod());
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodUnsuccessfulSearchUnsupportedCallTypeStructMember.
@Test
public void testFindMarshalerMethodUnsuccessfulSearchUnsupportedCallTypeStructMember() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod getter = toSootClass(TestStruct.class).getMethodByName("getV1");
SootMethod setter = toSootClass(TestStruct.class).getMethodByName("setV1");
try {
lookup.findMarshalerMethod(new MarshalSite(getter)).getMethod();
fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
}
try {
lookup.findMarshalerMethod(new MarshalSite(setter, 0)).getMethod();
fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
}
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerStructMemberPrimitiveArray3D.
@Test
public void testFindMarshalerStructMemberPrimitiveArray3D() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod getter = toSootClass(TestStruct.class).getMethodByName("getV4");
SootMethod setter = toSootClass(TestStruct.class).getMethodByName("setV4");
assertEquals(toSootClass(M2.class).getMethodByName("byteArray3DToObject"), lookup.findMarshalerMethod(new MarshalSite(getter)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("byteArray3DToNative"), lookup.findMarshalerMethod(new MarshalSite(setter, 0)).getMethod());
}
Aggregations