summaryrefslogtreecommitdiff
path: root/src/test/test-socket-util.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-10-04 23:51:45 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-10-04 23:55:35 +0200
commitbdf7026e9557349cd3eeb291c01655d5f2a55db8 (patch)
tree10d269fed663e99d659c34e2f8e89fe5b3f55ecd /src/test/test-socket-util.c
parent2355af60dc0c0ec2b7fbe69f15a77d980b017b3f (diff)
test: only use assert_se
The asserts used in the tests should never be allowed to be optimized away
Diffstat (limited to 'src/test/test-socket-util.c')
-rw-r--r--src/test/test-socket-util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c
index 17180db652..c2c728bcde 100644
--- a/src/test/test-socket-util.c
+++ b/src/test/test-socket-util.c
@@ -236,7 +236,7 @@ static void *connect_thread(void *arg) {
_cleanup_close_ int fd = -1;
fd = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
- assert(fd >= 0);
+ assert_se(fd >= 0);
assert_se(connect(fd, &sa->sa, sizeof(sa->in)) == 0);
@@ -263,7 +263,7 @@ static void test_nameinfo_pretty(void) {
assert_se(r < 0);
sfd = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0);
- assert(sfd >= 0);
+ assert_se(sfd >= 0);
assert_se(bind(sfd, &s.sa, sizeof(s.in)) == 0);
@@ -276,11 +276,11 @@ static void test_nameinfo_pretty(void) {
log_debug("Accepting new connection on fd:%d", sfd);
cfd = accept4(sfd, &c.sa, &clen, SOCK_CLOEXEC);
- assert(cfd >= 0);
+ assert_se(cfd >= 0);
r = getnameinfo_pretty(cfd, &localhost);
log_info("Connection from %s", localhost);
- assert(r == 0);
+ assert_se(r == 0);
}
static void test_sockaddr_equal(void) {