use lol_io::kernel::threading::pool::io::{CompletionPort, Wait}; use lol_io::windows_sys::Win32::System::IO::OVERLAPPED_ENTRY; #[test] fn lol_test_io_is_send_sync() { fn is_send_sync() {} is_send_sync::(); } #[test] fn lol_test_io_get_many() { let c = CompletionPort::new(1).unwrap(); c.post(lol_io::construct!(OVERLAPPED_ENTRY { dwNumberOfBytesTransferred: 1, lpCompletionKey: 2, lpOverlapped: 3 as *mut _ })) .unwrap(); c.post(lol_io::construct!(OVERLAPPED_ENTRY { dwNumberOfBytesTransferred: 4, lpCompletionKey: 5, lpOverlapped: 6 as *mut _ })) .unwrap(); let mut s = lol_io::zeroed!([OVERLAPPED_ENTRY; 4]); { let s = c.get_many(&mut s, Wait::NonAlertable).unwrap(); assert_eq!(s.len(), 2); assert_eq!(s[0].dwNumberOfBytesTransferred, 1); assert_eq!(s[0].lpCompletionKey, 2); assert_eq!(s[0].lpOverlapped, 3 as *mut _); assert_eq!(s[1].dwNumberOfBytesTransferred, 4); assert_eq!(s[1].lpCompletionKey, 5); assert_eq!(s[1].lpOverlapped, 6 as *mut _); } assert_eq!(s[2].dwNumberOfBytesTransferred, 0); assert_eq!(s[2].lpCompletionKey, 0); assert_eq!(s[2].lpOverlapped, 0 as *mut _); }