Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
actor-incubator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
actor-incubator
Commits
687235ee
Commit
687235ee
authored
Aug 31, 2019
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefer to test with ipv4
parent
342f745a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
libcaf_net/test/udp_datagram_socket.cpp
libcaf_net/test/udp_datagram_socket.cpp
+8
-15
No files found.
libcaf_net/test/udp_datagram_socket.cpp
View file @
687235ee
...
...
@@ -29,6 +29,7 @@
#include "caf/ip_address.hpp"
#include "caf/ipv4_address.hpp"
#include "caf/net/ip.hpp"
#include "caf/net/socket_guard.hpp"
using
namespace
caf
;
using
namespace
caf
::
net
;
...
...
@@ -56,10 +57,8 @@ struct fixture : host_fixture {
ep
.
port
(
0
);
auto
receiver
=
unbox
(
make_udp_datagram_socket
(
ep
));
CAF_MESSAGE
(
"sending data to: "
<<
to_string
(
ep
));
auto
guard
=
detail
::
make_scope_guard
([
&
]
{
close
(
socket_cast
<
net
::
socket
>
(
sender
));
close
(
socket_cast
<
net
::
socket
>
(
receiver
));
});
auto
send_guard
=
make_socket_guard
(
sender
);
auto
receive_guard
=
make_socket_guard
(
receiver
);
if
(
auto
err
=
nonblocking
(
socket_cast
<
net
::
socket
>
(
receiver
),
true
))
CAF_FAIL
(
"nonblocking returned an error"
<<
err
);
auto
test_read_res
=
read
(
receiver
,
make_span
(
buf
));
...
...
@@ -94,19 +93,13 @@ struct fixture : host_fixture {
CAF_TEST_FIXTURE_SCOPE
(
udp_datagram_socket_test
,
fixture
)
CAF_TEST
(
send
and
receive
IPv4
)
{
if
(
!
contains
(
v4_local
))
{
CAF_MESSAGE
(
"this host does not have av IPv4 address"
);
}
else
{
CAF_TEST
(
send
and
receive
)
{
if
(
contains
(
v4_local
))
{
test_send_receive
(
v4_local
);
}
}
CAF_TEST
(
send
and
receive
IPv6
)
{
if
(
!
contains
(
v6_local
))
{
CAF_MESSAGE
(
"this host does not have av IPv6 address"
);
}
else
{
}
else
if
(
contains
(
v6_local
))
{
test_send_receive
(
v6_local
);
}
else
{
CAF_FAIL
(
"could not resolve 'localhost'"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment