MCPcopy Create free account
hub / github.com/astonbitecode/j4rs / to_rust_boxed

Function to_rust_boxed

rust/src/lib.rs:1264–1312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1262
1263 #[test]
1264 fn to_rust_boxed() -> errors::Result<()> {
1265 let jvm = create_tests_jvm()?;
1266 let test_instance = jvm
1267 .create_instance("org.astonbitecode.j4rs.tests.MyTest", InvocationArg::empty())
1268 ?;
1269
1270 let i = jvm
1271 .invoke(
1272 &test_instance,
1273 "echo",
1274 &[InvocationArg::try_from(true)?],
1275 )
1276 ?;
1277 let _: Box<bool> = jvm.to_rust_boxed(i)?;
1278 let i = jvm
1279 .invoke(
1280 &test_instance,
1281 "echo",
1282 &[InvocationArg::try_from(33_i8)?],
1283 )
1284 ?;
1285 let _: Box<i8> = jvm.to_rust_boxed(i)?;
1286 let i = jvm
1287 .invoke(
1288 &test_instance,
1289 "echo",
1290 &[InvocationArg::try_from(33_i16)?],
1291 )
1292 ?;
1293 let _: Box<i16> = jvm.to_rust_boxed(i)?;
1294 let i = jvm
1295 .invoke(
1296 &test_instance,
1297 "echo",
1298 &[InvocationArg::try_from(33_i32)?],
1299 )
1300 ?;
1301 let _: Box<i32> = jvm.to_rust_boxed(i)?;
1302 let i = jvm
1303 .invoke(
1304 &test_instance,
1305 "echo",
1306 &[InvocationArg::try_from(33_i64)?],
1307 )
1308 ?;
1309 let _: Box<i64> = jvm.to_rust_boxed(i)?;
1310
1311 Ok(())
1312 }
1313
1314 #[test]
1315 fn check_equals() -> errors::Result<()> {

Callers

nothing calls this directly

Calls 4

create_tests_jvmFunction · 0.85
create_instanceMethod · 0.80
invokeMethod · 0.65
to_rust_boxedMethod · 0.45

Tested by

no test coverage detected