git.samba.org
/
socket_wrapper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96dbeb7
)
tests: Add test for TCP_NODELAY setsockopt()
author
Andreas Schneider
<asn@samba.org>
Thu, 8 Oct 2015 09:02:10 +0000
(11:02 +0200)
committer
Michael Adam
<obnox@samba.org>
Wed, 14 Oct 2015 08:27:54 +0000
(10:27 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
tests/test_echo_tcp_socket_options.c
patch
|
blob
|
history
diff --git
a/tests/test_echo_tcp_socket_options.c
b/tests/test_echo_tcp_socket_options.c
index 9be2bf0c28ed4af0b2af27b887269dc4ffc7fb2a..dfa46fe46439271ffba0bb9974b3fed714effc8c 100644
(file)
--- 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);
}