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
eb1452ef
Commit
eb1452ef
authored
Dec 12, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use shorter times for testing delayed messages
parent
3ce41950
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
unit_testing/test_spawn.cpp
unit_testing/test_spawn.cpp
+6
-6
No files found.
unit_testing/test_spawn.cpp
View file @
eb1452ef
...
@@ -371,13 +371,13 @@ void test_spawn() {
...
@@ -371,13 +371,13 @@ void test_spawn() {
CAF_CHECKPOINT
();
CAF_CHECKPOINT
();
CAF_PRINT
(
"test delayed_send()"
);
CAF_PRINT
(
"test delayed_send()"
);
self
->
delayed_send
(
self
,
chrono
::
seconds
(
1
),
1
,
2
,
3
);
self
->
delayed_send
(
self
,
chrono
::
milli
seconds
(
1
),
1
,
2
,
3
);
self
->
receive
(
on
(
1
,
2
,
3
)
>>
[]
{
});
self
->
receive
(
on
(
1
,
2
,
3
)
>>
[]
{
});
self
->
await_all_other_actors_done
();
self
->
await_all_other_actors_done
();
CAF_CHECKPOINT
();
CAF_CHECKPOINT
();
CAF_PRINT
(
"test timeout"
);
CAF_PRINT
(
"test timeout"
);
self
->
receive
(
after
(
chrono
::
seconds
(
1
))
>>
[]
{
});
self
->
receive
(
after
(
chrono
::
milli
seconds
(
1
))
>>
[]
{
});
CAF_CHECKPOINT
();
CAF_CHECKPOINT
();
spawn
(
testee1
);
spawn
(
testee1
);
...
@@ -432,7 +432,7 @@ void test_spawn() {
...
@@ -432,7 +432,7 @@ void test_spawn() {
);
);
self
->
receive
(
self
->
receive
(
on
(
"goodbye!"
)
>>
CAF_CHECKPOINT_CB
(),
on
(
"goodbye!"
)
>>
CAF_CHECKPOINT_CB
(),
after
(
std
::
chrono
::
seconds
(
5
))
>>
CAF_UNEXPECTED_TOUT_CB
()
after
(
std
::
chrono
::
seconds
(
1
))
>>
CAF_UNEXPECTED_TOUT_CB
()
);
);
self
->
receive
(
self
->
receive
(
[
&
](
const
down_msg
&
dm
)
{
[
&
](
const
down_msg
&
dm
)
{
...
@@ -446,7 +446,7 @@ void test_spawn() {
...
@@ -446,7 +446,7 @@ void test_spawn() {
self
->
sync_send
(
sync_testee
,
"!?"
).
await
(
self
->
sync_send
(
sync_testee
,
"!?"
).
await
(
on
<
sync_exited_msg
>
()
>>
CAF_CHECKPOINT_CB
(),
on
<
sync_exited_msg
>
()
>>
CAF_CHECKPOINT_CB
(),
others
()
>>
CAF_UNEXPECTED_MSG_CB_REF
(
self
),
others
()
>>
CAF_UNEXPECTED_MSG_CB_REF
(
self
),
after
(
chrono
::
milliseconds
(
5
))
>>
CAF_UNEXPECTED_TOUT_CB
()
after
(
chrono
::
milliseconds
(
1
))
>>
CAF_UNEXPECTED_TOUT_CB
()
);
);
CAF_CHECKPOINT
();
CAF_CHECKPOINT
();
...
@@ -551,7 +551,7 @@ void test_spawn() {
...
@@ -551,7 +551,7 @@ void test_spawn() {
self
->
link_to
(
pong_actor
);
self
->
link_to
(
pong_actor
);
int
i
=
0
;
int
i
=
0
;
int
flags
=
0
;
int
flags
=
0
;
self
->
delayed_send
(
self
,
chrono
::
seconds
(
1
),
atom
(
"FooBar"
));
self
->
delayed_send
(
self
,
chrono
::
milliseconds
(
10
),
atom
(
"FooBar"
));
// wait for DOWN and EXIT messages of pong
// wait for DOWN and EXIT messages of pong
self
->
receive_for
(
i
,
4
)
(
self
->
receive_for
(
i
,
4
)
(
[
&
](
const
exit_msg
&
em
)
{
[
&
](
const
exit_msg
&
em
)
{
...
@@ -576,7 +576,7 @@ void test_spawn() {
...
@@ -576,7 +576,7 @@ void test_spawn() {
others
()
>>
[
&
]()
{
others
()
>>
[
&
]()
{
CAF_FAILURE
(
"unexpected message: "
<<
to_string
(
self
->
last_dequeued
()));
CAF_FAILURE
(
"unexpected message: "
<<
to_string
(
self
->
last_dequeued
()));
},
},
after
(
chrono
::
seconds
(
5
))
>>
[
&
]()
{
after
(
chrono
::
milliseconds
(
10
))
>>
[
&
]()
{
CAF_FAILURE
(
"timeout in file "
<<
__FILE__
<<
" in line "
<<
__LINE__
);
CAF_FAILURE
(
"timeout in file "
<<
__FILE__
<<
" in line "
<<
__LINE__
);
}
}
);
);
...
...
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