use super::*; #[test] fn test_u8_transfer() { let other_core_id = prepare_on_fixed_core(); let receiver: Access>, Blocking> = Default::default(); let sender: Access>, Blocking> = Arc::clone(&receiver).into(); let handle = thread::spawn(move || { if_provided_set_core_affinity(other_core_id); let _: () = sender.publish(42u8); }); assert_eq!(receiver.await_result().unwrap().take(), Some(42u8)); assert!(!receiver.edit().unwrap().has()); await_completion(handle); } #[test] fn test_u8_retrieval() { let other_core_id = prepare_on_fixed_core(); let receiver: Access>, Blocking> = Default::default(); let sender: Access>, Instantly> = Arc::clone(&receiver).into(); let handle = thread::spawn(move || { if_provided_set_core_affinity(other_core_id); let _: () = sender.try_publish(22u8).unwrap(); }); assert_eq!(receiver.receive().unwrap(), 22u8); assert!(receiver.take().unwrap().is_none()); await_completion(handle); }