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
71b47d40
Commit
71b47d40
authored
Feb 21, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement unit test for a failing sink
parent
8ff35a7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
libcaf_core/test/local_streaming.cpp
libcaf_core/test/local_streaming.cpp
+21
-0
No files found.
libcaf_core/test/local_streaming.cpp
View file @
71b47d40
...
...
@@ -286,4 +286,25 @@ CAF_TEST(depth_2_pipelin_error_at_source) {
CAF_CHECK_EQUAL
(
fail_state
(
src
),
exit_reason
::
kill
);
}
CAF_TEST
(
depth_2_pipelin_error_at_sink
)
{
CAF_MESSAGE
(
"streams must abort if a sink fails at runtime"
);
auto
src
=
sys
.
spawn
(
file_reader
,
500
);
auto
snk
=
sys
.
spawn
(
sum_up
);
auto
pipeline
=
snk
*
src
;
CAF_MESSAGE
(
CAF_ARG
(
self
)
<<
CAF_ARG
(
src
)
<<
CAF_ARG
(
snk
));
CAF_MESSAGE
(
"initiate stream handshake"
);
self
->
send
(
pipeline
,
"numbers.txt"
);
expect
((
string
),
from
(
self
).
to
(
src
).
with
(
"numbers.txt"
));
expect
((
open_stream_msg
),
from
(
self
).
to
(
snk
));
CAF_MESSAGE
(
"start data transmission (and abort sink)"
);
self
->
send_exit
(
snk
,
exit_reason
::
kill
);
expect
((
upstream_msg
::
ack_open
),
from
(
snk
).
to
(
src
));
expect
((
exit_msg
),
from
(
self
).
to
(
snk
));
CAF_MESSAGE
(
"expect close and result messages from snk"
);
expect
((
upstream_msg
::
forced_drop
),
from
(
snk
).
to
(
src
));
expect
((
error
),
from
(
snk
).
to
(
self
));
CAF_CHECK_EQUAL
(
fail_state
(
src
),
exit_reason
::
normal
);
CAF_CHECK_EQUAL
(
fail_state
(
snk
),
exit_reason
::
kill
);
}
CAF_TEST_FIXTURE_SCOPE_END
()
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