summaryrefslogtreecommitdiffstats
path: root/tests/test_echo_tcp_write_read.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-12-20 17:09:56 +0100
committerAndreas Schneider <asn@samba.org>2013-12-20 17:15:36 +0100
commit7d0e5efedce4cc338d0f9fb355793eba6542dfa9 (patch)
tree0f1afbc00a16e33160a839b22e8b2ebbfa619014 /tests/test_echo_tcp_write_read.c
parentf6f5e28f3382d3828228089765040413682db85a (diff)
downloadsocket_wrapper-7d0e5efedce4cc338d0f9fb355793eba6542dfa9.tar.gz
socket_wrapper-7d0e5efedce4cc338d0f9fb355793eba6542dfa9.tar.xz
socket_wrapper-7d0e5efedce4cc338d0f9fb355793eba6542dfa9.zip
tests: Use torture_server_(address|port).
This makes it possible to run tests without socket_wrapper.
Diffstat (limited to 'tests/test_echo_tcp_write_read.c')
-rw-r--r--tests/test_echo_tcp_write_read.c12
1 files changed, 8 insertions, 4 deletions
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);