()
| 111 | |
| 112 | #[test] |
| 113 | fn write_and_read() { |
| 114 | let mut buf = AlignedBuf::new(4096).unwrap(); |
| 115 | let data = b"hello io_uring"; |
| 116 | unsafe { |
| 117 | std::ptr::copy_nonoverlapping(data.as_ptr(), buf.as_mut_ptr(), data.len()); |
| 118 | let slice = buf.as_slice(data.len()); |
| 119 | assert_eq!(slice, data); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | #[test] |
| 124 | fn to_vec_copies() { |
nothing calls this directly
no test coverage detected