Skip to content

Commit

Permalink
Move ReadBufPool Send/Sync test to its own function
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw committed Jan 25, 2025
1 parent 98f61cf commit 60c6b51
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/async_fd/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ fn try_clone() {
assert_eq!(&buf.data, DATA);
}

#[test]
fn read_buf_pool_is_send_and_sync() {
is_send::<ReadBufPool>();
is_sync::<ReadBufPool>();
is_send::<ReadBuf>();
is_sync::<ReadBuf>();
}

#[test]
fn read_buf_pool_size_assertion() {
assert_eq!(std::mem::size_of::<ReadBufPool>(), 8);
Expand All @@ -58,11 +66,6 @@ fn read_read_buf_pool() {
let mut ring = Ring::new(2).expect("failed to create test ring");
let sq = ring.submission_queue().clone();

is_send::<ReadBufPool>();
is_sync::<ReadBufPool>();
is_send::<ReadBuf>();
is_sync::<ReadBuf>();

let test_file = &LOREM_IPSUM_50;
let buf_pool = ReadBufPool::new(sq.clone(), 2, BUF_SIZE as u32).unwrap();

Expand Down

0 comments on commit 60c6b51

Please sign in to comment.