diff options
author | Philipp Keller <philipp.keller@gmail.com> | 2016-09-16 07:14:29 +0200 |
---|---|---|
committer | Philipp Keller <philipp.keller@gmail.com> | 2016-09-16 07:14:29 +0200 |
commit | 631a27a545906f739e50393509e71fb847740c3a (patch) | |
tree | 1d3279093084c3f2b650bb3ff8b88c2df9c2d69c /test/test_poll.rs | |
parent | 23a7ea64938cc73d476e42b80a243fefbe7111b2 (diff) | |
parent | 7c0570d3ad3c8e5fdd45c7de745771a6be054c3c (diff) | |
download | nix-631a27a545906f739e50393509e71fb847740c3a.zip |
made it running with rust 1.2, added documentation to mkstemp
Diffstat (limited to 'test/test_poll.rs')
-rw-r--r-- | test/test_poll.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/test/test_poll.rs b/test/test_poll.rs index 54fd4029..13a95d2c 100644 --- a/test/test_poll.rs +++ b/test/test_poll.rs @@ -4,19 +4,15 @@ use nix::unistd::{write, pipe}; #[test] fn test_poll() { let (r, w) = pipe().unwrap(); - let mut fds = [PollFd { - fd: r, - events: POLLIN, - revents: EventFlags::empty() - }]; + let mut fds = [PollFd::new(r, POLLIN, EventFlags::empty())]; let nfds = poll(&mut fds, 100).unwrap(); assert_eq!(nfds, 0); - assert!(!fds[0].revents.contains(POLLIN)); + assert!(!fds[0].revents().unwrap().contains(POLLIN)); write(w, b".").unwrap(); let nfds = poll(&mut fds, 100).unwrap(); assert_eq!(nfds, 1); - assert!(fds[0].revents.contains(POLLIN)); + assert!(fds[0].revents().unwrap().contains(POLLIN)); } |