summaryrefslogtreecommitdiff
path: root/test/actor/actor.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/actor/actor.test.cpp')
-rw-r--r--test/actor/actor.test.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/actor/actor.test.cpp b/test/actor/actor.test.cpp
index 4c7fc3666d..967dc152d9 100644
--- a/test/actor/actor.test.cpp
+++ b/test/actor/actor.test.cpp
@@ -306,6 +306,28 @@ TEST(Actor, Ask) {
ASSERT_EQ(2, result.get());
}
+TEST(Actor, AskVoid) {
+ // Ask waits for void methods
+
+ struct Test {
+ bool& executed;
+
+ Test(bool& executed_) : executed(executed_) {
+ }
+
+ void doIt() {
+ executed = true;
+ }
+ };
+
+ ThreadPool pool { 1 };
+ bool executed = false;
+ Actor<Test> actor(pool, executed);
+
+ actor.ask(&Test::doIt).get();
+ EXPECT_TRUE(executed);
+}
+
TEST(Actor, NoSelfActorRef) {
// Not all actors need a reference to self