Skip to content

Commit

Permalink
Add a test for get_socket_nosigpipe. (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Oct 10, 2023
1 parent 1a9d129 commit 5e5c046
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/net/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ fn test_sockopts_socket(s: &OwnedFd) {
sockopt::set_socket_incoming_cpu(&s, 3).unwrap();
assert_eq!(sockopt::get_socket_incoming_cpu(&s).unwrap(), 3);
}

// Check the initial value of SO_NOSIGPIPE, set it, and check it.
#[cfg(any(apple, freebsdlike, target_os = "netbsd"))]
{
assert_eq!(sockopt::get_socket_nosigpipe(&s).unwrap(), false);
sockopt::set_socket_nosigpipe(&s, true).unwrap();
assert_eq!(sockopt::get_socket_nosigpipe(&s).unwrap(), true);
}
}

// Test `tcp` socket options.
Expand Down

0 comments on commit 5e5c046

Please sign in to comment.