The branch, master has been updated
       via  23b4fa4 tests: Fix conflicting variable name on Solaris.
       via  52eabf4 tests: Fix building without bindresvport().
      from  9e91b00 tests: add new test test_bind_ipv4_addr_in_use()

http://gitweb.samba.org/?p=socket_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 23b4fa4519a128773cd99d85e3aa7288f08bbbd3
Author: Andreas Schneider <a...@samba.org>
Date:   Mon Jun 2 08:36:49 2014 +0200

    tests: Fix conflicting variable name on Solaris.
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Michael Adam <ob...@samba.org>

commit 52eabf4b886135d8ace300b5e7f29b26c86a7c01
Author: Andreas Schneider <a...@samba.org>
Date:   Mon Jun 2 08:30:50 2014 +0200

    tests: Fix building without bindresvport().
    
    This fixes the build on Solaris.
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Michael Adam <ob...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 tests/test_echo_tcp_bind.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/tests/test_echo_tcp_bind.c b/tests/test_echo_tcp_bind.c
index c699b06..d42679a 100644
--- a/tests/test_echo_tcp_bind.c
+++ b/tests/test_echo_tcp_bind.c
@@ -40,7 +40,7 @@ static void test_bind_ipv4(void **state)
        socklen_t salen = sizeof(struct sockaddr);
        struct sockaddr_in sin;
        socklen_t slen = sizeof(struct sockaddr_in);
-       struct sockaddr_un sun;
+       struct sockaddr_un addr_un;
        socklen_t sulen = sizeof(struct sockaddr_un);
        int rc;
        int s;
@@ -110,10 +110,10 @@ static void test_bind_ipv4(void **state)
        assert_int_equal(rc, -1);
        assert_int_equal(errno, EAFNOSUPPORT);
 
-       sun = (struct sockaddr_un) {
+       addr_un = (struct sockaddr_un) {
                .sun_family = AF_UNIX,
        };
-       rc = bind(s, (struct sockaddr *)&sun, sulen);
+       rc = bind(s, (struct sockaddr *)&addr_un, sulen);
        assert_int_equal(rc, -1);
        assert_int_equal(errno, EAFNOSUPPORT);
 
@@ -308,6 +308,7 @@ static void test_bind_ipv4_addr_in_use(void **state)
        close(s);
 }
 
+#ifdef HAVE_BINDRESVPORT
 static void test_bindresvport_ipv4(void **state)
 {
        struct sockaddr_in sin;
@@ -367,6 +368,7 @@ static void test_bindresvport_ipv4_null(void **state)
 
        close(s);
 }
+#endif /* HAVE_BINDRESVPORT */
 
 #ifdef HAVE_IPV6
 static void test_bind_on_ipv6_sock(void **state)
@@ -375,7 +377,7 @@ static void test_bind_on_ipv6_sock(void **state)
        socklen_t slen = sizeof(struct sockaddr_in);
        struct sockaddr_in6 sin6;
        socklen_t slen6 = sizeof(struct sockaddr_in6);
-       struct sockaddr_un sun;
+       struct sockaddr_un addr_un;
        socklen_t sulen = sizeof(struct sockaddr_un);
        int rc;
        int s;
@@ -385,9 +387,9 @@ static void test_bind_on_ipv6_sock(void **state)
        s = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
        assert_return_code(s, errno);
 
-       ZERO_STRUCT(sun);
-       sun.sun_family = AF_UNIX;
-       rc = bind(s, (struct sockaddr *)&sun, sulen);
+       ZERO_STRUCT(addr_un);
+       addr_un.sun_family = AF_UNIX;
+       rc = bind(s, (struct sockaddr *)&addr_un, sulen);
        assert_int_equal(rc, -1);
        /* FreeBSD uses EINVAL here... */
        assert_true(errno == EAFNOSUPPORT || errno == EINVAL);
@@ -417,6 +419,7 @@ static void test_bind_on_ipv6_sock(void **state)
        close(s);
 }
 
+#ifdef HAVE_BINDRESVPORT
 static void test_bindresvport_on_ipv6_sock(void **state)
 {
        struct sockaddr_in sin;
@@ -456,7 +459,7 @@ static void test_bindresvport_on_ipv6_sock_null(void 
**state)
 
        close(s);
 }
-
+#endif /* HAVE_BINDRESVPORT */
 #endif /* HAVE_IPV6 */
 
 int main(void) {
@@ -469,22 +472,26 @@ int main(void) {
                unit_test_setup_teardown(test_bind_ipv4_addr_in_use,
                                         setup_echo_srv_tcp_ipv4,
                                         teardown),
+#ifdef HAVE_BINDRESVPORT
                unit_test_setup_teardown(test_bindresvport_ipv4,
                                         setup_echo_srv_tcp_ipv4,
                                         teardown),
                unit_test_setup_teardown(test_bindresvport_ipv4_null,
                                         setup_echo_srv_tcp_ipv4,
                                         teardown),
+#endif /* HAVE_BINDRESVPORT */
 #ifdef HAVE_IPV6
                unit_test_setup_teardown(test_bind_on_ipv6_sock,
                                         setup_echo_srv_tcp_ipv6,
                                         teardown),
+#ifdef HAVE_BINDRESVPORT
                unit_test_setup_teardown(test_bindresvport_on_ipv6_sock,
                                         setup_echo_srv_tcp_ipv6,
                                         teardown),
                unit_test_setup_teardown(test_bindresvport_on_ipv6_sock_null,
                                         setup_echo_srv_tcp_ipv6,
                                         teardown),
+#endif /* HAVE_BINDRESVPORT */
 #endif /* HAVE_IPV6 */
        };
 


-- 
Socket Wrapper Repository

Reply via email to