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
a16dffe6
Commit
a16dffe6
authored
Jun 12, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix lambda captures in broker unit test
parent
facce03e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
libcaf_io/test/broker.cpp
libcaf_io/test/broker.cpp
+8
-12
No files found.
libcaf_io/test/broker.cpp
View file @
a16dffe6
...
...
@@ -34,13 +34,13 @@ using namespace std;
using
namespace
caf
;
using
namespace
caf
::
io
;
namespace
{
using
ping_atom
=
caf
::
atom_constant
<
caf
::
atom
(
"ping"
)
>
;
using
pong_atom
=
caf
::
atom_constant
<
caf
::
atom
(
"pong"
)
>
;
using
publish_atom
=
caf
::
atom_constant
<
caf
::
atom
(
"publish"
)
>
;
using
kickoff_atom
=
caf
::
atom_constant
<
caf
::
atom
(
"kickoff"
)
>
;
namespace
{
void
ping
(
event_based_actor
*
self
,
size_t
num_pings
)
{
CAF_MESSAGE
(
"num_pings: "
<<
num_pings
);
auto
count
=
std
::
make_shared
<
size_t
>
(
0
);
...
...
@@ -57,12 +57,12 @@ void ping(event_based_actor* self, size_t num_pings) {
}
return
std
::
make_tuple
(
ping_atom
::
value
,
value
+
1
);
},
others
>>
[
&
]
{
others
>>
[
=
]
{
CAF_TEST_ERROR
(
"Unexpected message: "
<<
to_string
(
self
->
current_message
()));
});
},
others
>>
[
&
]
{
others
>>
[
=
]
{
CAF_TEST_ERROR
(
"Unexpected message: "
<<
to_string
(
self
->
current_message
()));
}
...
...
@@ -84,7 +84,7 @@ void pong(event_based_actor* self) {
CAF_MESSAGE
(
"received down_msg{"
<<
dm
.
reason
<<
"}"
);
self
->
quit
(
dm
.
reason
);
},
others
>>
[
&
]
{
others
>>
[
=
]
{
CAF_TEST_ERROR
(
"Unexpected message: "
<<
to_string
(
self
->
current_message
()));
}
...
...
@@ -92,15 +92,13 @@ void pong(event_based_actor* self) {
// reply to 'ping'
return
std
::
make_tuple
(
pong_atom
::
value
,
value
);
},
others
>>
[
&
]
{
others
>>
[
=
]
{
CAF_TEST_ERROR
(
"Unexpected message: "
<<
to_string
(
self
->
current_message
()));
}
);
}
}
void
peer_fun
(
broker
*
self
,
connection_handle
hdl
,
const
actor
&
buddy
)
{
CAF_MESSAGE
(
"peer_fun called"
);
CAF_CHECK
(
self
!=
nullptr
);
...
...
@@ -150,7 +148,7 @@ void peer_fun(broker* self, connection_handle hdl, const actor& buddy) {
self
->
quit
(
dm
.
reason
);
}
},
others
>>
[
&
]
{
others
>>
[
=
]
{
CAF_TEST_ERROR
(
"Unexpected message: "
<<
to_string
(
self
->
current_message
()));
}
...
...
@@ -175,8 +173,6 @@ behavior peer_acceptor_fun(broker* self, const actor& buddy) {
};
}
namespace
{
void
run_server
(
bool
spawn_client
,
const
char
*
bin_path
)
{
scoped_actor
self
;
auto
serv
=
io
::
spawn_io
(
peer_acceptor_fun
,
spawn
(
pong
));
...
...
@@ -200,7 +196,7 @@ void run_server(bool spawn_client, const char* bin_path) {
);
}
}
}
// namespace <anonymous>
CAF_TEST
(
test_broker
)
{
auto
argv
=
caf
::
test
::
engine
::
argv
();
...
...
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