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
1adef9e2
Commit
1adef9e2
authored
Sep 25, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved `spawn` unit test
parent
fcfc70e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
unit_testing/test_spawn.cpp
unit_testing/test_spawn.cpp
+14
-2
No files found.
unit_testing/test_spawn.cpp
View file @
1adef9e2
...
...
@@ -315,24 +315,36 @@ void test_typed_actors() {
auto
ptr0
=
spawn_typed
(
on_arg_match
>>
[](
double
d
)
{
return
d
*
d
;
},
on_arg_match
>>
[](
float
f
)
{
return
f
/
2.0
f
;
}
);
CPPA_CHECK
((
std
::
is_same
<
decltype
(
ptr0
),
typed_actor_ptr
<
replies_to
<
double
>::
with
<
double
>
replies_to
<
double
>::
with
<
double
>
,
replies_to
<
float
>::
with
<
float
>
>
>::
value
));
typed_actor_ptr
<
replies_to
<
double
>::
with
<
double
>>
ptr0_double
=
ptr0
;
typed_actor_ptr
<
replies_to
<
float
>::
with
<
float
>>
ptr0_float
=
ptr0
;
auto
ptr
=
spawn_typed
(
on
<
int
>
()
>>
[]
{
return
"wtf"
;
},
on
<
string
>
()
>>
[]
{
return
42
;
},
on
<
float
>
()
>>
[]
{
return
make_cow_tuple
(
1
,
2
,
3
);
},
on
<
double
>
()
>>
[
=
](
double
d
)
{
return
sync_send
(
ptr0
,
d
).
then
(
return
sync_send
(
ptr0
_double
,
d
).
then
(
[](
double
res
)
{
return
res
+
res
;
}
);
}
);
sync_send
(
ptr0_float
,
4.0
f
).
await
(
[](
float
f
)
{
CPPA_CHECK_EQUAL
(
f
,
4.0
f
/
2.0
f
);
}
);
sync_send
(
ptr
,
10.0
).
await
(
[](
double
d
)
{
CPPA_CHECK_EQUAL
(
d
,
200.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