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
c269e25a
Commit
c269e25a
authored
Sep 03, 2019
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ip test and formatting
parent
a35f9d72
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
libcaf_net/src/ip.cpp
libcaf_net/src/ip.cpp
+2
-2
libcaf_net/test/ip.cpp
libcaf_net/test/ip.cpp
+2
-2
No files found.
libcaf_net/src/ip.cpp
View file @
c269e25a
...
...
@@ -217,9 +217,9 @@ std::vector<ip_address> local_addresses(string_view host) {
std
::
vector
<
ip_address
>
local_addresses
(
string_view
host
)
{
if
(
!
host
.
empty
()
&&
host
.
compare
(
v4_any_addr
)
==
0
)
return
{
ip_address
{
make_ipv4_address
(
0
,
0
,
0
,
0
)
}
};
return
{
ip_address
{
make_ipv4_address
(
0
,
0
,
0
,
0
)}
};
if
(
!
host
.
empty
()
&&
host
.
compare
(
v6_any_addr
)
==
0
)
return
{
ip_address
{}
};
return
{
ip_address
{}
};
ifaddrs
*
tmp
=
nullptr
;
if
(
getifaddrs
(
&
tmp
)
!=
0
)
return
{};
...
...
libcaf_net/test/ip.cpp
View file @
c269e25a
...
...
@@ -35,7 +35,7 @@ namespace {
struct
fixture
:
host_fixture
{
fixture
()
:
v6_local
{{
0
},
{
0x1
}}
{
v4_local
=
ip_address
{
make_ipv4_address
(
127
,
0
,
0
,
1
)};
v4_any_addr
=
ip_address
{
make_ipv4_address
(
0
,
0
,
0
,
0
)
};
v4_any_addr
=
ip_address
{
make_ipv4_address
(
0
,
0
,
0
,
0
)
};
}
bool
contains
(
ip_address
x
)
{
...
...
@@ -83,7 +83,7 @@ CAF_TEST(local addresses) {
CAF_MESSAGE
(
"check: localhost"
);
addrs
=
ip
::
local_addresses
(
"localhost"
);
CAF_CHECK
(
!
addrs
.
empty
());
CAF_CHECK
(
contains
(
v4_local
)
&&
contains
(
v6_local
));
CAF_CHECK
(
contains
(
v4_local
)
||
contains
(
v6_local
));
}
CAF_TEST_FIXTURE_SCOPE_END
()
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