diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_poll.rs | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/test/test_poll.rs b/test/test_poll.rs index 6cac3b77..aef40e47 100644 --- a/test/test_poll.rs +++ b/test/test_poll.rs @@ -1,5 +1,5 @@ use nix::poll::{PollFlags, poll, PollFd}; -use nix::unistd::{write, pipe, close}; +use nix::unistd::{write, pipe}; #[test] fn test_poll() { @@ -19,24 +19,6 @@ fn test_poll() { assert!(fds[0].revents().unwrap().contains(PollFlags::POLLIN)); } -#[test] -fn test_poll_debug() { - assert_eq!(format!("{:?}", PollFd::new(0, PollFlags::empty())), - "PollFd { fd: 0, events: (empty), revents: (empty) }"); - assert_eq!(format!("{:?}", PollFd::new(1, PollFlags::POLLIN)), - "PollFd { fd: 1, events: POLLIN, revents: (empty) }"); - - // Testing revents requires doing some I/O - let (r, w) = pipe().unwrap(); - let mut fds = [PollFd::new(r, PollFlags::POLLIN)]; - write(w, b" ").unwrap(); - close(w).unwrap(); - poll(&mut fds, -1).unwrap(); - assert_eq!(format!("{:?}", fds[0]), - format!("PollFd {{ fd: {}, events: POLLIN, revents: POLLIN | POLLHUP }}", r)); - close(r).unwrap(); -} - // ppoll(2) is the same as poll except for how it handles timeouts and signals. // Repeating the test for poll(2) should be sufficient to check that our // bindings are correct. |