Commit 84285fb1 authored by Dominik Charousset's avatar Dominik Charousset

Fix formatting

parent 8607ad2f
...@@ -91,7 +91,8 @@ TESTEE(infinite_source) { ...@@ -91,7 +91,8 @@ TESTEE(infinite_source) {
} }
VARARGS_TESTEE(file_reader, size_t buf_size) { VARARGS_TESTEE(file_reader, size_t buf_size) {
return {[=](string& fname) -> result<stream<int>> { return {
[=](string& fname) -> result<stream<int>> {
CAF_CHECK_EQUAL(fname, "numbers.txt"); CAF_CHECK_EQUAL(fname, "numbers.txt");
CAF_CHECK_EQUAL(self->mailbox().empty(), true); CAF_CHECK_EQUAL(self->mailbox().empty(), true);
return attach_stream_source(self, init(buf_size), push_from_buf, return attach_stream_source(self, init(buf_size), push_from_buf,
...@@ -102,7 +103,8 @@ VARARGS_TESTEE(file_reader, size_t buf_size) { ...@@ -102,7 +103,8 @@ VARARGS_TESTEE(file_reader, size_t buf_size) {
CAF_CHECK_EQUAL(self->mailbox().empty(), true); CAF_CHECK_EQUAL(self->mailbox().empty(), true);
attach_stream_source(self, next, init(buf_size), push_from_buf, attach_stream_source(self, next, init(buf_size), push_from_buf,
is_done(self), fin<buf>(self)); is_done(self), fin<buf>(self));
}}; },
};
} }
TESTEE_STATE(sum_up) { TESTEE_STATE(sum_up) {
...@@ -111,7 +113,8 @@ TESTEE_STATE(sum_up) { ...@@ -111,7 +113,8 @@ TESTEE_STATE(sum_up) {
TESTEE(sum_up) { TESTEE(sum_up) {
using intptr = int*; using intptr = int*;
return {[=](stream<int>& in) { return {
[=](stream<int>& in) {
return attach_stream_sink( return attach_stream_sink(
self, self,
// input stream // input stream
...@@ -120,7 +123,8 @@ TESTEE(sum_up) { ...@@ -120,7 +123,8 @@ TESTEE(sum_up) {
[=](intptr& x) { x = &self->state.x; }, [=](intptr& x) { x = &self->state.x; },
// processing step // processing step
[](intptr& x, int y) { *x += y; }, fin<intptr>(self)); [](intptr& x, int y) { *x += y; }, fin<intptr>(self));
}}; },
};
} }
TESTEE_STATE(delayed_sum_up) { TESTEE_STATE(delayed_sum_up) {
...@@ -130,7 +134,8 @@ TESTEE_STATE(delayed_sum_up) { ...@@ -130,7 +134,8 @@ TESTEE_STATE(delayed_sum_up) {
TESTEE(delayed_sum_up) { TESTEE(delayed_sum_up) {
using intptr = int*; using intptr = int*;
self->set_default_handler(skip); self->set_default_handler(skip);
return {[=](ok_atom) { return {
[=](ok_atom) {
self->become([=](stream<int>& in) { self->become([=](stream<int>& in) {
self->set_default_handler(print_and_drop); self->set_default_handler(print_and_drop);
return attach_stream_sink( return attach_stream_sink(
...@@ -144,19 +149,23 @@ TESTEE(delayed_sum_up) { ...@@ -144,19 +149,23 @@ TESTEE(delayed_sum_up) {
// cleanup // cleanup
fin<intptr>(self)); fin<intptr>(self));
}); });
}}; },
};
} }
TESTEE(broken_sink) { TESTEE(broken_sink) {
CAF_IGNORE_UNUSED(self); CAF_IGNORE_UNUSED(self);
return {[=](stream<int>&, const actor&) { return {
[=](stream<int>&, const actor&) {
// nop // nop
}}; },
};
} }
TESTEE(filter) { TESTEE(filter) {
CAF_IGNORE_UNUSED(self); CAF_IGNORE_UNUSED(self);
return {[=](stream<int>& in) { return {
[=](stream<int>& in) {
return attach_stream_stage( return attach_stream_stage(
self, self,
// input stream // input stream
...@@ -172,12 +181,14 @@ TESTEE(filter) { ...@@ -172,12 +181,14 @@ TESTEE(filter) {
}, },
// cleanup // cleanup
fin<unit_t>(self)); fin<unit_t>(self));
}}; },
};
} }
TESTEE(doubler) { TESTEE(doubler) {
CAF_IGNORE_UNUSED(self); CAF_IGNORE_UNUSED(self);
return {[=](stream<int>& in) { return {
[=](stream<int>& in) {
return attach_stream_stage( return attach_stream_stage(
self, self,
// input stream // input stream
...@@ -190,7 +201,8 @@ TESTEE(doubler) { ...@@ -190,7 +201,8 @@ TESTEE(doubler) {
[](unit_t&, downstream<int>& out, int x) { out.push(x * 2); }, [](unit_t&, downstream<int>& out, int x) { out.push(x * 2); },
// cleanup // cleanup
fin<unit_t>(self)); fin<unit_t>(self));
}}; },
};
} }
struct fixture : test_coordinator_fixture<> { struct fixture : test_coordinator_fixture<> {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment