Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ReadMailReallyFast
code
Commits
e382b267
Commit
e382b267
authored
1 year ago
by
Leon Dietrich
Browse files
Options
Downloads
Patches
Plain Diff
chg: udp unit test to use correct port
parent
dde37e5f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/socket_test.cpp
+12
-7
12 additions, 7 deletions
test/socket_test.cpp
with
12 additions
and
7 deletions
test/socket_test.cpp
+
12
−
7
View file @
e382b267
...
...
@@ -74,7 +74,7 @@ void run_udp_test() {
using
namespace
std
::
chrono_literals
;
const
socketaddr
source_address
=
get_first_general_socketaddr
(
"127.0.0.1"
,
9862
,
socket_t
::
UDP
);
const
socketaddr
destination_address
=
get_first_general_socketaddr
(
"127.0.0.1"
,
986
3
,
socket_t
::
UDP
);
const
socketaddr
destination_address
=
get_first_general_socketaddr
(
"127.0.0.1"
,
986
2
,
socket_t
::
UDP
);
auto
sender
=
client_factory_construct_udp_client
(
source_address
,
udp_test_cb
);
auto
receiver
=
connect
(
destination_address
,
socket_t
::
UDP
);
...
...
@@ -168,32 +168,37 @@ BOOST_AUTO_TEST_CASE(Netio_Socket_TCP) {
BOOST_CHECK
(
tcp_called
);
}
BOOST_AUTO_TEST_CASE
(
Netio_Socket_U
DP
)
{
BOOST_AUTO_TEST_CASE
(
Netio_Socket_U
NIX
)
{
using
namespace
std
::
chrono_literals
;
std
::
thread
ev_thread
(
ev_thread_callable
);
BOOST_CHECK_NO_THROW
(
run_udp_test
());
// TODO put in own test while keeping same ev loop setup
//BOOST_CHECK_NO_THROW(run_unix_test()); // TODO put in own test while keeping same ev loop setup
try
{
run_unix_test
();
}
catch
(
const
netio_exception
&
e
)
{
std
::
cout
<<
e
.
what
()
<<
std
::
endl
;
}
// Sleep one second without using ev timer
std
::
this_thread
::
sleep_for
(
500ms
);
ev_thread
.
join
();
BOOST_CHECK
(
u
dp
_called
);
BOOST_CHECK
(
u
nix
_called
);
}
BOOST_AUTO_TEST_CASE
(
Netio_Socket_U
NIX
)
{
BOOST_AUTO_TEST_CASE
(
Netio_Socket_U
DP
)
{
using
namespace
std
::
chrono_literals
;
std
::
thread
ev_thread
(
ev_thread_callable
);
BOOST_CHECK_NO_THROW
(
run_u
nix
_test
());
// TODO put in own test while keeping same ev loop setup
BOOST_CHECK_NO_THROW
(
run_u
dp
_test
());
// TODO put in own test while keeping same ev loop setup
// Sleep one second without using ev timer
std
::
this_thread
::
sleep_for
(
500ms
);
ev_thread
.
join
();
BOOST_CHECK
(
u
nix
_called
);
BOOST_CHECK
(
u
dp
_called
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment