From 63ffada3525ed6e57fc8f6a8d037edd9e38c5992 Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Thu, 13 Sep 2018 13:26:14 +0300 Subject: [PATCH] Fix tests GitOrigin-RevId: 829b0485d9b1eebc6e53f7d1f035bd702187fdf9 --- tdactor/test/actors_simple.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tdactor/test/actors_simple.cpp b/tdactor/test/actors_simple.cpp index 3825d8f7f..cfef82ac1 100644 --- a/tdactor/test/actors_simple.cpp +++ b/tdactor/test/actors_simple.cpp @@ -35,11 +35,17 @@ static char buf2[BUF_SIZE]; static StringBuilder sb(MutableSlice(buf, BUF_SIZE - 1)); static StringBuilder sb2(MutableSlice(buf2, BUF_SIZE - 1)); +auto create_queue() { + auto res = std::make_shared>(); + res->init(); + return res; +} + TEST(Actors, SendLater) { SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR)); sb.clear(); Scheduler scheduler; - scheduler.init(0, {std::make_shared>()}, nullptr); + scheduler.init(0, {create_queue()}, nullptr); auto guard = scheduler.get_guard(); class Worker : public Actor { @@ -96,7 +102,7 @@ class XReceiver final : public Actor { TEST(Actors, simple_pass_event_arguments) { SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR)); Scheduler scheduler; - scheduler.init(0, {std::make_shared>()}, nullptr); + scheduler.init(0, {create_queue()}, nullptr); auto guard = scheduler.get_guard(); auto id = create_actor("XR").release(); @@ -203,7 +209,7 @@ class PrintChar final : public Actor { TEST(Actors, simple_hand_yield) { SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR)); Scheduler scheduler; - scheduler.init(0, {std::make_shared>()}, nullptr); + scheduler.init(0, {create_queue()}, nullptr); sb.clear(); int cnt = 1000; { @@ -356,7 +362,7 @@ class MasterActor : public MsgActor { TEST(Actors, call_after_destruct) { SET_VERBOSITY_LEVEL(VERBOSITY_NAME(ERROR)); Scheduler scheduler; - scheduler.init(0, {std::make_shared>()}, nullptr); + scheduler.init(0, {create_queue()}, nullptr); { auto guard = scheduler.get_guard(); create_actor("Master").release();