Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
1d9c6bcf
Commit
1d9c6bcf
authored
Dec 08, 2019
by
Simon Giesecke
Committed by
Simon Giesecke
Dec 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: unittest_udp_address not properly formatted
Solution: run clang-format
parent
fdabd73d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
18 deletions
+27
-18
unittest_udp_address.cpp
unittests/unittest_udp_address.cpp
+27
-18
No files found.
unittests/unittest_udp_address.cpp
View file @
1d9c6bcf
...
...
@@ -69,32 +69,36 @@ static void test_resolve (bool bind_,
}
}
validate_address
(
family_
,
addr
.
target_addr
(),
target_addr_
,
expected_port_
);
validate_address
(
family_
,
addr
.
bind_addr
(),
bind_addr_
,
expected_port_
);
validate_address
(
family_
,
addr
.
target_addr
(),
target_addr_
,
expected_port_
);
validate_address
(
family_
,
addr
.
bind_addr
(),
bind_addr_
,
expected_port_
);
}
static
void
test_resolve_bind
(
int
family_
,
const
char
*
name_
,
const
char
*
dest_addr_
,
uint16_t
expected_port_
=
0
,
const
char
*
name_
,
const
char
*
dest_addr_
,
uint16_t
expected_port_
=
0
,
const
char
*
bind_addr_
=
NULL
,
bool
multicast_
=
false
)
{
test_resolve
(
true
,
family_
,
name_
,
dest_addr_
,
expected_port_
,
bind_addr_
,
test_resolve
(
true
,
family_
,
name_
,
dest_addr_
,
expected_port_
,
bind_addr_
,
multicast_
);
}
static
void
test_resolve_connect
(
int
family_
,
const
char
*
name_
,
const
char
*
dest_addr_
,
static
void
test_resolve_connect
(
int
family_
,
const
char
*
name_
,
const
char
*
dest_addr_
,
uint16_t
expected_port_
=
0
,
const
char
*
bind_addr_
=
NULL
,
bool
multicast_
=
false
)
{
test_resolve
(
false
,
family_
,
name_
,
dest_addr_
,
expected_port_
,
bind_addr_
,
test_resolve
(
false
,
family_
,
name_
,
dest_addr_
,
expected_port_
,
bind_addr_
,
multicast_
);
}
static
void
test_resolve_ipv4_simple
()
{
test_resolve_connect
(
AF_INET
,
"127.0.0.1:5555"
,
"127.0.0.1"
,
5555
);
test_resolve_connect
(
AF_INET
,
"127.0.0.1:5555"
,
"127.0.0.1"
,
5555
);
}
static
void
test_resolve_ipv6_simple
()
...
...
@@ -104,12 +108,14 @@ static void test_resolve_ipv6_simple ()
static
void
test_resolve_ipv4_bind
()
{
test_resolve_bind
(
AF_INET
,
"127.0.0.1:5555"
,
"127.0.0.1"
,
5555
,
"127.0.0.1"
);
test_resolve_bind
(
AF_INET
,
"127.0.0.1:5555"
,
"127.0.0.1"
,
5555
,
"127.0.0.1"
);
}
static
void
test_resolve_ipv6_bind
()
{
test_resolve_bind
(
AF_INET6
,
"[abcd::1234:1]:5555"
,
"abcd::1234:1"
,
5555
,
"abcd::1234:1"
);
test_resolve_bind
(
AF_INET6
,
"[abcd::1234:1]:5555"
,
"abcd::1234:1"
,
5555
,
"abcd::1234:1"
);
}
static
void
test_resolve_ipv4_bind_any
()
...
...
@@ -129,7 +135,8 @@ static void test_resolve_ipv4_bind_anyport ()
static
void
test_resolve_ipv6_bind_anyport
()
{
test_resolve_bind
(
AF_INET6
,
"[1:2:3:4::5]:*"
,
"1:2:3:4::5"
,
0
,
"1:2:3:4::5"
);
test_resolve_bind
(
AF_INET6
,
"[1:2:3:4::5]:*"
,
"1:2:3:4::5"
,
0
,
"1:2:3:4::5"
);
}
static
void
test_resolve_ipv4_bind_any_port
()
...
...
@@ -176,7 +183,8 @@ static void test_resolve_ipv6_connect_port0 ()
static
void
test_resolve_ipv4_bind_mcast
()
{
test_resolve_bind
(
AF_INET
,
"239.0.0.1:1234"
,
"239.0.0.1"
,
1234
,
"0.0.0.0"
,
true
);
test_resolve_bind
(
AF_INET
,
"239.0.0.1:1234"
,
"239.0.0.1"
,
1234
,
"0.0.0.0"
,
true
);
}
static
void
test_resolve_ipv6_bind_mcast
()
...
...
@@ -186,12 +194,14 @@ static void test_resolve_ipv6_bind_mcast ()
static
void
test_resolve_ipv4_connect_mcast
()
{
test_resolve_connect
(
AF_INET
,
"239.0.0.1:2222"
,
"239.0.0.1"
,
2222
,
NULL
,
true
);
test_resolve_connect
(
AF_INET
,
"239.0.0.1:2222"
,
"239.0.0.1"
,
2222
,
NULL
,
true
);
}
static
void
test_resolve_ipv6_connect_mcast
()
{
test_resolve_connect
(
AF_INET6
,
"[ff00::1]:2222"
,
"ff00::1"
,
2222
,
NULL
,
true
);
test_resolve_connect
(
AF_INET6
,
"[ff00::1]:2222"
,
"ff00::1"
,
2222
,
NULL
,
true
);
}
static
void
test_resolve_ipv4_mcast_src_bind
()
...
...
@@ -223,14 +233,13 @@ static void test_resolve_ipv4_mcast_src_bind_any ()
static
void
test_resolve_ipv6_mcast_src_bind_any
()
{
test_resolve_bind
(
AF_INET6
,
"*;[ffff::]:5555"
,
"ffff::"
,
5555
,
"::"
,
true
);
test_resolve_bind
(
AF_INET6
,
"*;[ffff::]:5555"
,
"ffff::"
,
5555
,
"::"
,
true
);
}
static
void
test_resolve_ipv4_mcast_src_connect
()
{
test_resolve_connect
(
AF_INET
,
"8.9.10.11;230.2.8.12:5555"
,
"230.2.8.12"
,
5555
,
"8.9.10.11"
,
true
);
test_resolve_connect
(
AF_INET
,
"8.9.10.11;230.2.8.12:5555"
,
"230.2.8.12"
,
5555
,
"8.9.10.11"
,
true
);
}
static
void
test_resolve_ipv6_mcast_src_connect
()
...
...
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