Skip to content

Commit 8cb611c

Browse files
committed
Merge branch 'dev/register-multi' into dev/polling2
2 parents ed20c44 + 047c3db commit 8cb611c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/driver.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,22 @@ fn timeout() {
3737
.unwrap_err();
3838
assert_eq!(err.kind(), io::ErrorKind::TimedOut);
3939
}
40+
41+
#[test]
42+
fn register_multiple() {
43+
const TASK_LEN: usize = 5;
44+
45+
let mut driver = Proactor::new().unwrap();
46+
47+
let file = File::open("Cargo.toml").unwrap();
48+
driver.attach(file.as_raw_fd()).unwrap();
49+
50+
for _i in 0..TASK_LEN {
51+
driver.push(ReadAt::new(file.as_raw_fd(), 0, Vec::with_capacity(1024)));
52+
}
53+
54+
let mut entries = ArrayVec::<Entry, TASK_LEN>::new();
55+
while entries.len() < TASK_LEN {
56+
driver.poll(None, &mut entries).unwrap();
57+
}
58+
}

0 commit comments

Comments
 (0)