Commit b9388f29 authored by Dominik Charousset's avatar Dominik Charousset

Re-implement unit test for local groups

parent 62767a6b
......@@ -23,9 +23,12 @@ using namespace cppa;
void testee(event_based_actor* self, int current_value, int final_result) {
self->become(
on_arg_match >> [=](int result) {
[=](int result) {
auto next = result + current_value;
if (next >= final_result) self->quit();
if (next >= final_result) {
CPPA_CHECKPOINT();
self->quit();
}
else testee(self, next, final_result);
},
after(std::chrono::seconds(2)) >> [=] {
......@@ -35,23 +38,26 @@ void testee(event_based_actor* self, int current_value, int final_result) {
);
}
int main() {
CPPA_TEST(test_local_group);
/*
void test_local_group() {
scoped_actor self;
auto foo_group = group::get("local", "foo");
auto master = spawn_in_group(foo_group, testee, 0, 10);
for (int i = 0; i < 5; ++i) {
// spawn five workers and let them join local/foo
spawn_in_group(foo_group, [master] {
become(on_arg_match >> [master](int v) {
send(master, v);
self->quit();
self->spawn_in_group(foo_group, [master](event_based_actor* m) {
m->become([master, m](int v) {
m->send(master, v);
m->quit();
});
});
}
send(foo_group, 2);
self->send(foo_group, 2);
}
int main() {
CPPA_TEST(test_local_group);
test_local_group();
await_all_actors_done();
shutdown();
*/
return CPPA_TEST_RESULT();
}
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