summaryrefslogtreecommitdiffstats
path: root/third_party/rust/mio/test/test_poll.rs
blob: e259d89e241375851b9c8ecccafe70a82b3cbd1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use mio::*;
use std::time::Duration;

#[test]
fn test_poll_closes_fd() {
    for _ in 0..2000 {
        let poll = Poll::new().unwrap();
        let mut events = Events::with_capacity(4);
        let (registration, set_readiness) = Registration::new2();

        poll.register(&registration, Token(0), Ready::readable(), PollOpt::edge()).unwrap();
        poll.poll(&mut events, Some(Duration::from_millis(0))).unwrap();

        drop(poll);
        drop(set_readiness);
        drop(registration);
    }
}