aboutsummaryrefslogtreecommitdiff
path: root/src/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'src/unittest')
-rw-r--r--src/unittest/test_socket.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/unittest/test_socket.cpp b/src/unittest/test_socket.cpp
index 6d5cf334d..620021b59 100644
--- a/src/unittest/test_socket.cpp
+++ b/src/unittest/test_socket.cpp
@@ -97,11 +97,11 @@ void TestSocket::testIPv4Socket()
UASSERT(strncmp(sendbuffer, rcvbuffer, sizeof(sendbuffer)) == 0);
if (address != Address(0, 0, 0, 0, port)) {
- UASSERT(sender.getAddress().sin_addr.s_addr ==
- address.getAddress().sin_addr.s_addr);
+ UASSERT(sender.getAddress().s_addr ==
+ address.getAddress().s_addr);
} else {
- UASSERT(sender.getAddress().sin_addr.s_addr ==
- Address(127, 0, 0, 1, 0).getAddress().sin_addr.s_addr);
+ UASSERT(sender.getAddress().s_addr ==
+ Address(127, 0, 0, 1, 0).getAddress().s_addr);
}
}
@@ -128,7 +128,7 @@ void TestSocket::testIPv6Socket()
socket6.Bind(address6);
- try {
+ {
socket6.Send(Address(&bytes, port), sendbuffer, sizeof(sendbuffer));
sleep_ms(50);
@@ -142,10 +142,8 @@ void TestSocket::testIPv6Socket()
}
//FIXME: This fails on some systems
UASSERT(strncmp(sendbuffer, rcvbuffer, sizeof(sendbuffer)) == 0);
- UASSERT(memcmp(sender.getAddress6().sin6_addr.s6_addr,
- Address(&bytes, 0).getAddress6().sin6_addr.s6_addr, 16) == 0);
- } catch (SendFailedException &e) {
- errorstream << "IPv6 support enabled but not available!"
- << std::endl;
+
+ UASSERT(memcmp(sender.getAddress6().s6_addr,
+ Address(&bytes, 0).getAddress6().s6_addr, 16) == 0);
}
}