diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-01-30 03:51:49 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-01-30 03:51:54 +0100 |
commit | 3d6ab4dd7031b6c96f8549c9095b8935194e5f32 (patch) | |
tree | 668ebb92ba2dd9f44f9024f964f2d11d5a4ae9d4 | |
parent | 470dc9e807b93546d3f1c05426e6f1b8746d94ff (diff) |
Add failing test.
The kernel expects a packed (no holes) epoll_event struct but Rust doesn't
support packed types yet.
Depends on mozilla/rust#1704.
-rw-r--r-- | epoll.rs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -102,10 +102,13 @@ fn test_epoll_wait() { let magic = 42u64; assert epoll_ctl(epfd, EPOLL_CTL_ADD, 1, {events:EPOLLOUT, data:magic}) == 0; + assert epoll_ctl(epfd, EPOLL_CTL_ADD, 2, {events:EPOLLOUT, data:magic}) == 0; + + let events: [mutable epoll_event] = [ + mutable {events:0i32, data:0u64}, {events:0i32, data:0u64}]; - let events: [mutable epoll_event] = [mutable {events:0i32, data:0u64}]; let n = epoll_wait(epfd, events, 50); - assert n == 1; + assert n == 2; assert events[0].data == magic; assert events[0].events & EPOLLOUT == EPOLLOUT; } |