From 7d0e5efedce4cc338d0f9fb355793eba6542dfa9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 20 Dec 2013 17:09:56 +0100 Subject: tests: Use torture_server_(address|port). This makes it possible to run tests without socket_wrapper. --- tests/test_echo_tcp_write_read.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/test_echo_tcp_write_read.c') diff --git a/tests/test_echo_tcp_write_read.c b/tests/test_echo_tcp_write_read.c index 389e400..e2ffe91 100644 --- a/tests/test_echo_tcp_write_read.c +++ b/tests/test_echo_tcp_write_read.c @@ -46,9 +46,11 @@ static void test_write_read_ipv4(void **state) ZERO_STRUCT(sin); sin.sin_family = AF_INET; - sin.sin_port = htons(TORTURE_ECHO_SRV_PORT); + sin.sin_port = htons(torture_server_port()); - rc = inet_pton(sin.sin_family, TORTURE_ECHO_SRV_IPV4, &sin.sin_addr); + rc = inet_pton(sin.sin_family, + torture_server_address(AF_INET), + &sin.sin_addr); assert_int_equal(rc, 1); rc = connect(s, (struct sockaddr *)&sin, slen); @@ -93,9 +95,11 @@ static void test_write_read_ipv6(void **state) ZERO_STRUCT(sin6); sin6.sin6_family = AF_INET6; - sin6.sin6_port = htons(TORTURE_ECHO_SRV_PORT); + sin6.sin6_port = htons(torture_server_port()); - rc = inet_pton(AF_INET6, TORTURE_ECHO_SRV_IPV6, &sin6.sin6_addr); + rc = inet_pton(AF_INET6, + torture_server_address(AF_INET6), + &sin6.sin6_addr); assert_int_equal(rc, 1); rc = connect(s, (struct sockaddr *)&sin6, slen); -- cgit