Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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 Framework
Commits
0c23fd76
Commit
0c23fd76
authored
Oct 08, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wait conditions in BASP unit test, closes #362
parent
6fc2cbf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
libcaf_io/test/basp.cpp
libcaf_io/test/basp.cpp
+11
-7
No files found.
libcaf_io/test/basp.cpp
View file @
0c23fd76
...
@@ -531,15 +531,18 @@ CAF_TEST(publish_and_connect) {
...
@@ -531,15 +531,18 @@ CAF_TEST(publish_and_connect) {
}
}
CAF_TEST
(
remote_actor_and_send
)
{
CAF_TEST
(
remote_actor_and_send
)
{
constexpr
const
char
*
lo
=
"localhost"
;
CAF_MESSAGE
(
"self: "
<<
to_string
(
self
()
->
address
()));
CAF_MESSAGE
(
"self: "
<<
to_string
(
self
()
->
address
()));
mpx
()
->
provide_scribe
(
"localhost"
,
4242
,
remote_hdl
(
0
));
mpx
()
->
provide_scribe
(
lo
,
4242
,
remote_hdl
(
0
));
CAF_
CHECK
(
mpx
()
->
pending_scribes
().
count
(
make_pair
(
"localhost"
,
4242
))
==
1
);
CAF_
REQUIRE
(
mpx
()
->
pending_scribes
().
count
(
make_pair
(
lo
,
4242
))
==
1
);
auto
mm1
=
get_middleman_actor
();
auto
mm1
=
get_middleman_actor
();
actor
result
;
actor
result
;
auto
f
=
self
()
->
sync_send
(
mm1
,
connect_atom
::
value
,
auto
f
=
self
()
->
sync_send
(
mm1
,
connect_atom
::
value
,
"localhost"
,
uint16_t
{
4242
});
lo
,
uint16_t
{
4242
});
mpx
()
->
exec_runnable
();
// process message in basp_broker
// wait until BASP broker has received and processed the connect message
CAF_CHECK
(
mpx
()
->
pending_scribes
().
count
(
make_pair
(
"localhost"
,
4242
))
==
0
);
while
(
!
aut
()
->
valid
(
remote_hdl
(
0
)))
mpx
()
->
exec_runnable
();
CAF_REQUIRE
(
mpx
()
->
pending_scribes
().
count
(
make_pair
(
lo
,
4242
))
==
0
);
// build a fake server handshake containing the id of our first pseudo actor
// build a fake server handshake containing the id of our first pseudo actor
CAF_MESSAGE
(
"server handshake => client handshake + proxy announcement"
);
CAF_MESSAGE
(
"server handshake => client handshake + proxy announcement"
);
auto
na
=
registry
()
->
named_actors
();
auto
na
=
registry
()
->
named_actors
();
...
@@ -637,8 +640,9 @@ CAF_TEST(actor_serialize_and_deserialize) {
...
@@ -637,8 +640,9 @@ CAF_TEST(actor_serialize_and_deserialize) {
prx
->
id
(),
testee
->
id
()},
prx
->
id
(),
testee
->
id
()},
msg
);
msg
);
// testee must've responded (process forwarded message in BASP broker)
// testee must've responded (process forwarded message in BASP broker)
CAF_MESSAGE
(
"exec runnable, i.e., handle response from testee"
);
CAF_MESSAGE
(
"wait until BASP broker writes to its output buffer"
);
mpx
()
->
exec_runnable
();
// process forwarded message in basp_broker
while
(
mpx
()
->
output_buffer
(
remote_hdl
(
0
)).
empty
())
mpx
()
->
exec_runnable
();
// process forwarded message in basp_broker
// output buffer must contain the reflected message
// output buffer must contain the reflected message
mock
()
mock
()
.
expect
(
remote_hdl
(
0
),
.
expect
(
remote_hdl
(
0
),
...
...
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