diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_echo_tcp_socket_options.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_echo_tcp_socket_options.c b/tests/test_echo_tcp_socket_options.c index 9be2bf0..dfa46fe 100644 --- a/tests/test_echo_tcp_socket_options.c +++ b/tests/test_echo_tcp_socket_options.c @@ -325,6 +325,17 @@ static void test_sockopt_tcp(void **state) assert_return_code(rc, errno); assert_int_equal(opt, 0); + opt = 1; /* Turn on TCP_NODELAY */ + optlen = sizeof(int); + rc = setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, optlen); + assert_return_code(rc, errno); + + opt = -1; + optlen = sizeof(int); + rc = getsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, &optlen); + assert_return_code(rc, errno); + assert_int_equal(opt, 1); + close(s); } |
