diff options
author | azevaykin <145343289+azevaykin@users.noreply.github.com> | 2024-09-03 11:17:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 11:17:58 +0300 |
commit | 69a57074e4c259aea0bbb9a735c5ed821743629c (patch) | |
tree | 2ac207624d82800ae8439ee3b44e9d6fd06346d3 | |
parent | 4a4dbe23aa2fe0b44a4b8fab838fa451840e0aa0 (diff) | |
download | ydb-69a57074e4c259aea0bbb9a735c5ed821743629c.tar.gz |
Add const to the condition function (#8644)
-rw-r--r-- | ydb/core/testlib/actors/block_events.h | 2 | ||||
-rw-r--r-- | ydb/core/testlib/actors/test_runtime_ut.cpp | 2 | ||||
-rw-r--r-- | ydb/core/tx/datashard/datashard_ut_build_index.cpp | 2 | ||||
-rw-r--r-- | ydb/core/tx/datashard/datashard_ut_stats.cpp | 2 | ||||
-rw-r--r-- | ydb/core/tx/mediator/mediator_ut.cpp | 6 | ||||
-rw-r--r-- | ydb/core/tx/time_cast/time_cast_ut.cpp | 4 |
6 files changed, 9 insertions, 9 deletions
diff --git a/ydb/core/testlib/actors/block_events.h b/ydb/core/testlib/actors/block_events.h index 681d40a543..f8ca0c37e5 100644 --- a/ydb/core/testlib/actors/block_events.h +++ b/ydb/core/testlib/actors/block_events.h @@ -14,7 +14,7 @@ namespace NActors { template<class TEvType> class TBlockEvents : public std::deque<typename TEvType::TPtr> { public: - TBlockEvents(TTestActorRuntime& runtime, std::function<bool(typename TEvType::TPtr&)> condition = {}) + TBlockEvents(TTestActorRuntime& runtime, std::function<bool(const typename TEvType::TPtr&)> condition = {}) : Runtime(runtime) , Condition(std::move(condition)) , Holder(Runtime.AddObserver<TEvType>( diff --git a/ydb/core/testlib/actors/test_runtime_ut.cpp b/ydb/core/testlib/actors/test_runtime_ut.cpp index d6f47f77d3..24cd2457e0 100644 --- a/ydb/core/testlib/actors/test_runtime_ut.cpp +++ b/ydb/core/testlib/actors/test_runtime_ut.cpp @@ -794,7 +794,7 @@ Y_UNIT_TEST_SUITE(TActorTest) { auto source = runtime.Register(new TSourceActor(target), /* nodeIdx */ 1); runtime.EnableScheduleForActor(source); - TBlockEvents<TEvTrigger> block(runtime, [&](TEvTrigger::TPtr& ev){ return ev->GetRecipientRewrite() == target; }); + TBlockEvents<TEvTrigger> block(runtime, [&](const TEvTrigger::TPtr& ev){ return ev->GetRecipientRewrite() == target; }); runtime.WaitFor("blocked 3 events", [&]{ return block.size() >= 3; }); UNIT_ASSERT_VALUES_EQUAL(block.size(), 3u); UNIT_ASSERT_VALUES_EQUAL(values.size(), 0u); diff --git a/ydb/core/tx/datashard/datashard_ut_build_index.cpp b/ydb/core/tx/datashard/datashard_ut_build_index.cpp index 10c69783d3..5386d04b74 100644 --- a/ydb/core/tx/datashard/datashard_ut_build_index.cpp +++ b/ydb/core/tx/datashard/datashard_ut_build_index.cpp @@ -167,7 +167,7 @@ Y_UNIT_TEST_SUITE(TTxDataShardBuildIndexScan) { CreateShardedTableForIndex(server, sender, "/Root", "table-2", 1, false); - TBlockEvents<TEvDataShard::TEvCompactBorrowed> block(runtime, [&](TEvDataShard::TEvCompactBorrowed::TPtr& event) { + TBlockEvents<TEvDataShard::TEvCompactBorrowed> block(runtime, [&](const TEvDataShard::TEvCompactBorrowed::TPtr& event) { return runtime.FindActorName(event->Sender) == "FLAT_SCHEMESHARD_ACTOR"; }); diff --git a/ydb/core/tx/datashard/datashard_ut_stats.cpp b/ydb/core/tx/datashard/datashard_ut_stats.cpp index e5b17cef8c..eb33fcb66a 100644 --- a/ydb/core/tx/datashard/datashard_ut_stats.cpp +++ b/ydb/core/tx/datashard/datashard_ut_stats.cpp @@ -443,7 +443,7 @@ Y_UNIT_TEST_SUITE(DataShardStats) { UpsertRows(server, sender); - TBlockEvents<NSharedCache::TEvResult> block(runtime, [&](NSharedCache::TEvResult::TPtr& event) { + TBlockEvents<NSharedCache::TEvResult> block(runtime, [&](const NSharedCache::TEvResult::TPtr& event) { return runtime.FindActorName(event->GetRecipientRewrite()) == "DATASHARD_STATS_BUILDER"; }); diff --git a/ydb/core/tx/mediator/mediator_ut.cpp b/ydb/core/tx/mediator/mediator_ut.cpp index 246f9513d9..43b7a35720 100644 --- a/ydb/core/tx/mediator/mediator_ut.cpp +++ b/ydb/core/tx/mediator/mediator_ut.cpp @@ -685,7 +685,7 @@ Y_UNIT_TEST_SUITE(MediatorTest) { // Block plan steps at tablet 1 TBlockEvents<TEvTxProcessing::TEvPlanStep> blockedPlan1(runtime, - [&](TEvTxProcessing::TEvPlanStep::TPtr& ev) { + [&](const TEvTxProcessing::TEvPlanStep::TPtr& ev) { return ev->Get()->Record.GetTabletID() == tablet1; }); @@ -943,12 +943,12 @@ Y_UNIT_TEST_SUITE(MediatorTest) { WatcherState->Updates.clear(); TBlockEvents<TEvTxProcessing::TEvPlanStep> blockedPlan1(runtime, - [&](TEvTxProcessing::TEvPlanStep::TPtr& ev) { + [&](const TEvTxProcessing::TEvPlanStep::TPtr& ev) { return ev->Get()->Record.GetTabletID() == tablet1; }); TBlockEvents<TEvTxProcessing::TEvPlanStep> blockedPlan2(runtime, - [&](TEvTxProcessing::TEvPlanStep::TPtr& ev) { + [&](const TEvTxProcessing::TEvPlanStep::TPtr& ev) { return ev->Get()->Record.GetTabletID() == tablet2; }); diff --git a/ydb/core/tx/time_cast/time_cast_ut.cpp b/ydb/core/tx/time_cast/time_cast_ut.cpp index 85b2c037fc..76fc9321d4 100644 --- a/ydb/core/tx/time_cast/time_cast_ut.cpp +++ b/ydb/core/tx/time_cast/time_cast_ut.cpp @@ -228,9 +228,9 @@ namespace NKikimr::NMediatorTimeCastTest { TBlockEvents<TEvTxProcessing::TEvPlanStepAck> blockAcks(runtime); TBlockEvents<TEvTxProcessing::TEvPlanStep> blockPlan1(runtime, - [&](auto& ev) { return ev->Get()->Record.GetTabletID() == tablet1; }); + [&](const auto& ev) { return ev->Get()->Record.GetTabletID() == tablet1; }); TBlockEvents<TEvTxProcessing::TEvPlanStep> blockPlan2(runtime, - [&](auto& ev) { return ev->Get()->Record.GetTabletID() == tablet2; }); + [&](const auto& ev) { return ev->Get()->Record.GetTabletID() == tablet2; }); ui64 stepTx1 = PlanTx(server, 1, { tablet1, tablet2 }); Cerr << "... tx1 planned at step " << stepTx1 << Endl; |