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
467f3367
Commit
467f3367
authored
Apr 23, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added echo_actor to spawn unit test
parent
b36cae49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
unit_testing/test__spawn.cpp
unit_testing/test__spawn.cpp
+18
-0
No files found.
unit_testing/test__spawn.cpp
View file @
467f3367
...
@@ -294,6 +294,17 @@ void testee3(actor_ptr parent)
...
@@ -294,6 +294,17 @@ void testee3(actor_ptr parent)
);
);
}
}
void
echo_actor
()
{
receive
(
others
()
>>
[]()
{
self
->
last_sender
()
<<
self
->
last_dequeued
();
}
);
}
template
<
class
Testee
>
template
<
class
Testee
>
std
::
string
behavior_test
(
actor_ptr
et
)
std
::
string
behavior_test
(
actor_ptr
et
)
{
{
...
@@ -343,6 +354,13 @@ size_t test__spawn()
...
@@ -343,6 +354,13 @@ size_t test__spawn()
receive
(
after
(
std
::
chrono
::
seconds
(
1
))
>>
[]()
{
});
receive
(
after
(
std
::
chrono
::
seconds
(
1
))
>>
[]()
{
});
CPPA_IF_VERBOSE
(
cout
<<
"ok"
<<
endl
);
CPPA_IF_VERBOSE
(
cout
<<
"ok"
<<
endl
);
CPPA_IF_VERBOSE
(
cout
<<
"test echo actor ... "
<<
std
::
flush
);
auto
mecho
=
spawn
(
echo_actor
);
send
(
mecho
,
"hello echo"
);
receive
(
on
(
"hello echo"
)
>>
[]()
{
});
await_all_others_done
();
CPPA_IF_VERBOSE
(
cout
<<
"ok"
<<
endl
);
CPPA_IF_VERBOSE
(
cout
<<
"testee1 ... "
<<
std
::
flush
);
CPPA_IF_VERBOSE
(
cout
<<
"testee1 ... "
<<
std
::
flush
);
spawn
(
testee1
);
spawn
(
testee1
);
await_all_others_done
();
await_all_others_done
();
...
...
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