use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerStructMemberByteBuffer1D.
@Test
public void testFindMarshalerStructMemberByteBuffer1D() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod getter = toSootClass(TestStruct.class).getMethodByName("getV5");
SootMethod setter = toSootClass(TestStruct.class).getMethodByName("setV5");
assertEquals(toSootClass(M2.class).getMethodByName("byteBuffer1DToObject"), lookup.findMarshalerMethod(new MarshalSite(getter)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("byteBuffer1DToNative"), lookup.findMarshalerMethod(new MarshalSite(setter, 0)).getMethod());
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodUnsuccessfulWithMarshalerAnnotation.
@Test
public void testFindMarshalerMethodUnsuccessfulWithMarshalerAnnotation() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo3.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 testFindMarshalerMethodInterfaceMatchArray.
@Test
public void testFindMarshalerMethodInterfaceMatchArray() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo4.class).getMethodByName("foo8");
assertEquals(toSootClass(M2.class).getMethodByName("charSequenceArrayToObject"), lookup.findMarshalerMethod(new MarshalSite(method)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("charSequenceArrayToNative"), lookup.findMarshalerMethod(new MarshalSite(method, 0)).getMethod());
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodSuperclassMatchArray.
@Test
public void testFindMarshalerMethodSuperclassMatchArray() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo4.class).getMethodByName("foo7");
assertEquals(toSootClass(M2.class).getMethodByName("numberArrayToObject"), lookup.findMarshalerMethod(new MarshalSite(method)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("numberArrayToNative"), lookup.findMarshalerMethod(new MarshalSite(method, 0)).getMethod());
}
use of org.robovm.compiler.MarshalerLookup.MarshalSite in project robovm by robovm.
the class MarshalerLookupTest method testFindMarshalerMethodClassMatchValue.
@Test
public void testFindMarshalerMethodClassMatchValue() {
MarshalerLookup lookup = new MarshalerLookup(config).searchBuiltins(false);
SootMethod method = toSootClass(Foo4.class).getMethodByName("foo2");
assertEquals(toSootClass(M2.class).getMethodByName("integerToObject"), lookup.findMarshalerMethod(new MarshalSite(method)).getMethod());
assertEquals(toSootClass(M2.class).getMethodByName("integerToNative"), lookup.findMarshalerMethod(new MarshalSite(method, 0)).getMethod());
}
Aggregations