Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#![cfg(feature = "invocation")]
mod util;
use util::{attach_current_thread, call_java_abs, detach_current_thread, jvm};
#[test]
pub fn explicit_detach_detaches_thread_attached_locally() {
assert_eq!(jvm().threads_attached(), 0);
let mut guard = attach_current_thread();
let val = call_java_abs(&mut guard, -1);
assert_eq!(val, 1);
assert_eq!(jvm().threads_attached(), 1);
// # Safety
// we won't be trying to use a pre-existing (invalid) `JNIEnv` after detaching
unsafe {
detach_current_thread();
}
assert_eq!(jvm().threads_attached(), 0);
assert!(jvm().get_env().is_err());
}