()
| 81 | |
| 82 | #[test] |
| 83 | fn test_waker_wake() { |
| 84 | test_utils::JVM_ENV.with(|env| { |
| 85 | let data = Arc::new(test_utils::TestWakerData::new()); |
| 86 | assert_eq!(Arc::strong_count(&data), 1); |
| 87 | assert_eq!(data.value(), false); |
| 88 | |
| 89 | let waker = test_utils::test_waker(&data); |
| 90 | assert_eq!(Arc::strong_count(&data), 2); |
| 91 | assert_eq!(data.value(), false); |
| 92 | |
| 93 | let jwaker = super::waker(env, waker).unwrap(); |
| 94 | assert_eq!(Arc::strong_count(&data), 2); |
| 95 | assert_eq!(data.value(), false); |
| 96 | |
| 97 | env.call_method(jwaker, "wake", "()V", &[]).unwrap(); |
| 98 | assert_eq!(Arc::strong_count(&data), 1); |
| 99 | assert_eq!(data.value(), true); |
| 100 | data.set_value(false); |
| 101 | |
| 102 | env.call_method(jwaker, "wake", "()V", &[]).unwrap(); |
| 103 | assert_eq!(Arc::strong_count(&data), 1); |
| 104 | assert_eq!(data.value(), false); |
| 105 | }); |
| 106 | } |
| 107 | |
| 108 | #[test] |
| 109 | fn test_waker_close_wake() { |
nothing calls this directly
no test coverage detected