summaryrefslogtreecommitdiff
path: root/test/test_poll.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_poll.rs')
-rw-r--r--test/test_poll.rs10
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));
}