summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-09-28 08:11:57 +0200
committerAndreas Schneider <asn@samba.org>2018-10-23 15:39:09 +0200
commita2a8a804405c439082af3083b2ec4c804ca71049 (patch)
treea661744756f45807397264808f1626b26346f83c /tests
parent0983cd2fd88cf580f60fe0cf6b0ddcdfcd18d249 (diff)
downloadsocket_wrapper-a2a8a804405c439082af3083b2ec4c804ca71049.tar.gz
socket_wrapper-a2a8a804405c439082af3083b2ec4c804ca71049.tar.xz
socket_wrapper-a2a8a804405c439082af3083b2ec4c804ca71049.zip
tests: Use assert_return_code() to get errno
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_echo_udp_sendto_recvfrom.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_echo_udp_sendto_recvfrom.c b/tests/test_echo_udp_sendto_recvfrom.c
index bb22371..354247a 100644
--- a/tests/test_echo_udp_sendto_recvfrom.c
+++ b/tests/test_echo_udp_sendto_recvfrom.c
@@ -78,7 +78,7 @@ static void test_sendto_recvfrom_ipv4(void **state)
0,
&addr.sa.s,
addr.sa_socklen);
- assert_int_not_equal(ret, -1);
+ assert_return_code(ret, errno);
ret = recvfrom(s,
recv_buf,
@@ -86,7 +86,7 @@ static void test_sendto_recvfrom_ipv4(void **state)
0,
&srv_in.sa.s,
&srv_in.sa_socklen);
- assert_int_not_equal(ret, -1);
+ assert_return_code(ret, errno);
a = inet_ntop(AF_INET, &srv_in.sa.in.sin_addr, ip, sizeof(ip));
assert_non_null(a);
@@ -101,7 +101,7 @@ static void test_sendto_recvfrom_ipv4(void **state)
0,
&addr.sa.s,
addr.sa_socklen);
- assert_int_not_equal(ret, -1);
+ assert_return_code(ret, errno);
ret = recvfrom(s,
recv_buf,
@@ -109,7 +109,7 @@ static void test_sendto_recvfrom_ipv4(void **state)
0,
NULL,
NULL);
- assert_int_not_equal(ret, -1);
+ assert_return_code(ret, errno);
close(s);
}
@@ -155,7 +155,7 @@ static void test_sendto_recvfrom_ipv6(void **state)
0,
&addr.sa.s,
addr.sa_socklen);
- assert_int_not_equal(ret, -1);
+ assert_return_code(ret, errno);
ret = recvfrom(s,
recv_buf,
@@ -163,7 +163,7 @@ static void test_sendto_recvfrom_ipv6(void **state)
0,
&srv_in6.sa.s,
&srv_in6.sa_socklen);
- assert_int_not_equal(ret, -1);
+ assert_return_code(ret, errno);
a = inet_ntop(AF_INET6, &srv_in6.sa.in6.sin6_addr, ip, sizeof(ip));
assert_non_null(a);
@@ -178,7 +178,7 @@ static void test_sendto_recvfrom_ipv6(void **state)
0,
&addr.sa.s,
addr.sa_socklen);
- assert_int_not_equal(ret, -1);
+ assert_return_code(ret, errno);
ret = recvfrom(s,
recv_buf,
@@ -186,7 +186,7 @@ static void test_sendto_recvfrom_ipv6(void **state)
0,
NULL,
NULL);
- assert_int_not_equal(ret, -1);
+ assert_return_code(ret, errno);
close(s);
}