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

Function check_equals

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

Source from the content-addressed store, hash-verified

1313
1314 #[test]
1315 fn check_equals() -> errors::Result<()> {
1316 let jvm = create_tests_jvm()?;
1317 let test_instance = jvm
1318 .create_instance("org.astonbitecode.j4rs.tests.MyTest", InvocationArg::empty())
1319 ?;
1320 let integer_instance = jvm.create_instance("java.lang.Integer", &[InvocationArg::try_from(3_i32)?.into_primitive()?])?;
1321 let ia1 = InvocationArg::try_from(3)?;
1322 assert!(jvm.check_equals(&integer_instance, &ia1)?);
1323
1324 let null_instance = jvm.invoke(&test_instance, "getNullInteger", InvocationArg::empty())?;
1325 assert!(jvm.check_equals(&null_instance, InvocationArg::try_from(Null::Integer)?)?);
1326 Ok(())
1327 }
1328
1329 #[test]
1330 fn instance_into_raw_object() -> errors::Result<()> {

Callers

nothing calls this directly

Calls 4

create_tests_jvmFunction · 0.85
create_instanceMethod · 0.80
into_primitiveMethod · 0.80
invokeMethod · 0.65

Tested by

no test coverage detected