Skip to content

Commit

Permalink
Demonstrate: test that will pass in real system
Browse files Browse the repository at this point in the history
  • Loading branch information
tiif committed Aug 16, 2024
1 parent e9f359a commit 7db8243
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/pass-dep/libc/libc-epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn test_epoll_socketpair() {

// Check result from epoll_wait.
// We expect to get a read, write, HUP notification from the close since closing an FD always unblocks reads and writes on its peer.
let expected_event = u32::try_from(libc::EPOLLRDHUP | libc::EPOLLIN | libc::EPOLLOUT).unwrap();
let expected_event = u32::try_from(libc::EPOLLRDHUP | libc::EPOLLIN | libc::EPOLLOUT | libc::EPOLLHUP).unwrap();
let expected_value = u64::try_from(fds[1]).unwrap();
assert!(check_epoll_wait::<8>(epfd, &[(expected_event, expected_value)]));
}
Expand Down Expand Up @@ -484,9 +484,9 @@ fn test_socketpair_read() {

// Notification will be provided.
// But in real system, no notification will be provided here.
let expected_event = u32::try_from(libc::EPOLLOUT).unwrap();
let expected_value = fds[1] as u64;
assert!(check_epoll_wait::<8>(epfd, &[(expected_event, expected_value)]));
//let expected_event = u32::try_from(libc::EPOLLOUT).unwrap();
//let expected_value = fds[1] as u64;
assert!(check_epoll_wait::<8>(epfd, &[]));

// Read until the buffer is empty.
let mut buf: [u8; 2] = [0; 2];
Expand Down

0 comments on commit 7db8243

Please sign in to comment.