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
ec693f37
Commit
ec693f37
authored
Oct 01, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added spawn_typed unit test
parent
13c77715
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
unit_testing/test_spawn.cpp
unit_testing/test_spawn.cpp
+23
-0
No files found.
unit_testing/test_spawn.cpp
View file @
ec693f37
...
...
@@ -311,7 +311,30 @@ struct high_priority_testee_class : event_based_actor {
}
};
struct
my_request
{
int
a
;
int
b
;
};
bool
operator
==
(
const
my_request
&
lhs
,
const
my_request
&
rhs
)
{
return
lhs
.
a
==
rhs
.
a
&&
lhs
.
b
==
rhs
.
b
;
}
typed_actor_ptr
<
replies_to
<
my_request
>::
with
<
bool
>>
spawn_typed_server
()
{
return
spawn_typed
(
on_arg_match
>>
[](
const
my_request
&
req
)
{
return
req
.
a
==
req
.
b
;
}
);
}
void
test_typed_actors
()
{
announce
<
my_request
>
(
&
my_request
::
a
,
&
my_request
::
b
);
auto
sptr
=
spawn_typed_server
();
sync_send
(
sptr
,
my_request
{
2
,
2
}).
await
(
[](
bool
value
)
{
CPPA_CHECK_EQUAL
(
value
,
true
);
}
);
send_exit
(
sptr
,
exit_reason
::
user_defined
);
auto
ptr0
=
spawn_typed
(
on_arg_match
>>
[](
double
d
)
{
return
d
*
d
;
...
...
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