diff options
author | Bryant Mairs <bryant@mai.rs> | 2019-03-10 18:30:09 -0700 |
---|---|---|
committer | Bryant Mairs <bryant@mai.rs> | 2019-06-09 11:31:46 -0700 |
commit | b5c04adbd7df7f58fdecf8967d112632eac256b3 (patch) | |
tree | 1c4e5f1412f42026bd5630ddf7c26ea2b8ee01d4 /test | |
parent | c50e987b4e169e2d7dc7089c91407e1e55c550f1 (diff) | |
download | nix-b5c04adbd7df7f58fdecf8967d112632eac256b3.zip |
Remove test of impl Debug for PollFd
As this is now derived, having a test is unnecessary
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. |