summaryrefslogtreecommitdiff
path: root/test/test_poll.rs
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2021-09-07 12:44:22 -0700
committerConrad Meyer <cem@FreeBSD.org>2021-09-19 17:14:30 -0700
commitb16e70eebf3b6c5c8f5e7e6860ff4b7b1ba3fa04 (patch)
treec0c94b2d4f52a11c9da3db92b933811a339f4ccc /test/test_poll.rs
parente94bf0e444f4e910d2837d6827809da32e8492c1 (diff)
downloadnix-b16e70eebf3b6c5c8f5e7e6860ff4b7b1ba3fa04.zip
Fix #411 - Provide accessors for 'events' in PollFd
Test: `cargo test --test test test_pollfd_events`
Diffstat (limited to 'test/test_poll.rs')
-rw-r--r--test/test_poll.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_poll.rs b/test/test_poll.rs
index ee89c4a0..e4b369f3 100644
--- a/test/test_poll.rs
+++ b/test/test_poll.rs
@@ -72,3 +72,11 @@ fn test_pollfd_fd() {
let pfd = PollFd::new(0x1234, PollFlags::empty());
assert_eq!(pfd.as_raw_fd(), 0x1234);
}
+
+#[test]
+fn test_pollfd_events() {
+ let mut pfd = PollFd::new(-1, PollFlags::POLLIN);
+ assert_eq!(pfd.events(), PollFlags::POLLIN);
+ pfd.set_events(PollFlags::POLLOUT);
+ assert_eq!(pfd.events(), PollFlags::POLLOUT);
+}