summaryrefslogtreecommitdiff
path: root/test/test_poll.rs
diff options
context:
space:
mode:
authorPhilipp Matthias Schaefer <philipp.matthias.schaefer@posteo.de>2016-08-11 21:25:09 +0200
committerPhilipp Matthias Schaefer <philipp.matthias.schaefer@posteo.de>2016-08-31 20:17:55 +0200
commit93dc2387bd336d843c3d39f0a44b906b637ec2f8 (patch)
treea0838f7c7cec6500a65c11eaffde71b83aa3668e /test/test_poll.rs
parent07039357d8d519ab1fe3591b9f9b05fd49ab4195 (diff)
downloadnix-93dc2387bd336d843c3d39f0a44b906b637ec2f8.zip
Use libc in poll.rs
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));
}