diff options
author | Anoop C S <anoopcs@redhat.com> | 2018-03-23 17:12:49 +0530 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2018-03-26 09:09:32 +0200 |
commit | 142024a641ca43f842584499b5694d26853dd3d9 (patch) | |
tree | 925f35f961e521f765fcc325c6d379cc56ecd8ba /tests/test_tcp_listen.c | |
parent | 33da03f478955daa04adca67fc012379bf0d2a39 (diff) | |
download | socket_wrapper-142024a641ca43f842584499b5694d26853dd3d9.tar.gz socket_wrapper-142024a641ca43f842584499b5694d26853dd3d9.tar.xz socket_wrapper-142024a641ca43f842584499b5694d26853dd3d9.zip |
tests: Remove extra test by moving getsockname() to another
test_echo_tcp_socket currently tests socket() and getsockname() network
calls. The test name was misleading as it does not require echo server
to be setup. Moreover it failed to create socket_wrapper directory which
is the pre-requisite for testing with libsocket_wrapper.
Therefore it is better to integrate getsockname() test into existing
test_tcp_listen test and remove useless test_echo_tcp_socket
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Diffstat (limited to 'tests/test_tcp_listen.c')
-rw-r--r-- | tests/test_tcp_listen.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_tcp_listen.c b/tests/test_tcp_listen.c index 5641c47..746620d 100644 --- a/tests/test_tcp_listen.c +++ b/tests/test_tcp_listen.c @@ -52,6 +52,7 @@ static void test_listen_unbound_ipv4(void **state) rc = getsockname(s1, &addr.sa.s, &addr.sa_socklen); assert_return_code(rc, errno); + assert_int_equal(addr.sa.in.sin_family, AF_INET); assert_int_equal(addr.sa_socklen, sizeof(struct sockaddr_in)); assert_in_range(ntohs(addr.sa.in.sin_port), 1024, 65535); @@ -85,6 +86,7 @@ static void test_listen_unbound_ipv6(void **state) rc = getsockname(s1, &addr.sa.s, &addr.sa_socklen); assert_return_code(rc, errno); + assert_int_equal(addr.sa.in6.sin6_family, AF_INET6); assert_int_equal(addr.sa_socklen, sizeof(struct sockaddr_in6)); assert_in_range(ntohs(addr.sa.in6.sin6_port), 1024, 65535); |