diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/messagebus/rain_check | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/messagebus/rain_check')
17 files changed, 64 insertions, 64 deletions
diff --git a/library/cpp/messagebus/rain_check/core/coro.cpp b/library/cpp/messagebus/rain_check/core/coro.cpp index c79c6dfc5b2..500841dd5b8 100644 --- a/library/cpp/messagebus/rain_check/core/coro.cpp +++ b/library/cpp/messagebus/rain_check/core/coro.cpp @@ -23,7 +23,7 @@ TCoroTaskRunner::TCoroTaskRunner(IEnv* env, ISubtaskListener* parent, TAutoPtr<I } TCoroTaskRunner::~TCoroTaskRunner() { - Y_ASSERT(CoroDone); + Y_ASSERT(CoroDone); } Y_POD_STATIC_THREAD(TContMachineContext*) @@ -32,7 +32,7 @@ Y_POD_STATIC_THREAD(TCoroTaskRunner*) Task; bool TCoroTaskRunner::ReplyReceived() { - Y_ASSERT(!CoroDone); + Y_ASSERT(!CoroDone); TContMachineContext me; @@ -43,8 +43,8 @@ bool TCoroTaskRunner::ReplyReceived() { Stack.VerifyNoStackOverflow(); - Y_ASSERT(CallerContext == &me); - Y_ASSERT(Task == this); + Y_ASSERT(CallerContext == &me); + Y_ASSERT(Task == this); return !CoroDone; } diff --git a/library/cpp/messagebus/rain_check/core/coro_stack.cpp b/library/cpp/messagebus/rain_check/core/coro_stack.cpp index e4517393e4a..83b984ca6e9 100644 --- a/library/cpp/messagebus/rain_check/core/coro_stack.cpp +++ b/library/cpp/messagebus/rain_check/core/coro_stack.cpp @@ -12,8 +12,8 @@ using namespace NRainCheck::NPrivate; TCoroStack::TCoroStack(size_t size) : SizeValue(size) { - Y_VERIFY(size % sizeof(ui32) == 0); - Y_VERIFY(size >= 0x1000); + Y_VERIFY(size % sizeof(ui32) == 0); + Y_VERIFY(size >= 0x1000); DataHolder.Reset(malloc(size)); diff --git a/library/cpp/messagebus/rain_check/core/coro_ut.cpp b/library/cpp/messagebus/rain_check/core/coro_ut.cpp index 7157230da73..61a33584a5f 100644 --- a/library/cpp/messagebus/rain_check/core/coro_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/coro_ut.cpp @@ -7,7 +7,7 @@ using namespace NRainCheck; -Y_UNIT_TEST_SUITE(RainCheckCoro) { +Y_UNIT_TEST_SUITE(RainCheckCoro) { struct TSimpleCoroTask : ICoroTask { TTestSync* const TestSync; @@ -21,7 +21,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { } }; - Y_UNIT_TEST(Simple) { + Y_UNIT_TEST(Simple) { TTestSync testSync; TTestEnv env; @@ -49,7 +49,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { } }; - Y_UNIT_TEST(Sleep) { + Y_UNIT_TEST(Sleep) { TTestSync testSync; TTestEnv env; @@ -94,7 +94,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { } }; - Y_UNIT_TEST(Spawn) { + Y_UNIT_TEST(Spawn) { TTestSync testSync; TTestEnv env; diff --git a/library/cpp/messagebus/rain_check/core/simple.cpp b/library/cpp/messagebus/rain_check/core/simple.cpp index 22e721758e2..70182b2f93e 100644 --- a/library/cpp/messagebus/rain_check/core/simple.cpp +++ b/library/cpp/messagebus/rain_check/core/simple.cpp @@ -9,7 +9,7 @@ TSimpleTaskRunner::TSimpleTaskRunner(IEnv* env, ISubtaskListener* parentTask, TA } TSimpleTaskRunner::~TSimpleTaskRunner() { - Y_ASSERT(!ContinueFunc); + Y_ASSERT(!ContinueFunc); } bool TSimpleTaskRunner::ReplyReceived() { diff --git a/library/cpp/messagebus/rain_check/core/simple_ut.cpp b/library/cpp/messagebus/rain_check/core/simple_ut.cpp index 2eb5fad8f9f..d4545e05aa1 100644 --- a/library/cpp/messagebus/rain_check/core/simple_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/simple_ut.cpp @@ -8,7 +8,7 @@ using namespace NRainCheck; -Y_UNIT_TEST_SUITE(RainCheckSimple) { +Y_UNIT_TEST_SUITE(RainCheckSimple) { struct TTaskWithCompletionCallback: public ISimpleTask { TTestEnv* const Env; TTestSync* const TestSync; @@ -31,7 +31,7 @@ Y_UNIT_TEST_SUITE(RainCheckSimple) { } void SleepCompletionCallback(TSubtaskCompletion* completion) { - Y_VERIFY(completion == &SleepCompletion); + Y_VERIFY(completion == &SleepCompletion); TestSync->CheckAndIncrement(1); Env->SleepService.Sleep(&SleepCompletion, TDuration::MilliSeconds(1)); @@ -48,7 +48,7 @@ Y_UNIT_TEST_SUITE(RainCheckSimple) { } }; - Y_UNIT_TEST(CompletionCallback) { + Y_UNIT_TEST(CompletionCallback) { TTestEnv env; TTestSync testSync; diff --git a/library/cpp/messagebus/rain_check/core/sleep_ut.cpp b/library/cpp/messagebus/rain_check/core/sleep_ut.cpp index f38daf75d67..2ae85a87b18 100644 --- a/library/cpp/messagebus/rain_check/core/sleep_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/sleep_ut.cpp @@ -7,7 +7,7 @@ using namespace NRainCheck; using namespace NActor; -Y_UNIT_TEST_SUITE(Sleep) { +Y_UNIT_TEST_SUITE(Sleep) { struct TTestTask: public ISimpleTask { TSimpleEnv* const Env; TTestSync* const TestSync; @@ -34,7 +34,7 @@ Y_UNIT_TEST_SUITE(Sleep) { } }; - Y_UNIT_TEST(Test) { + Y_UNIT_TEST(Test) { TTestSync testSync; TSimpleEnv env; diff --git a/library/cpp/messagebus/rain_check/core/spawn_ut.cpp b/library/cpp/messagebus/rain_check/core/spawn_ut.cpp index 3aefde88f73..ba5a5e41cf6 100644 --- a/library/cpp/messagebus/rain_check/core/spawn_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/spawn_ut.cpp @@ -12,7 +12,7 @@ using namespace NRainCheck; using namespace NActor; -Y_UNIT_TEST_SUITE(Spawn) { +Y_UNIT_TEST_SUITE(Spawn) { struct TTestTask: public ISimpleTask { TTestSync* const TestSync; @@ -43,7 +43,7 @@ Y_UNIT_TEST_SUITE(Spawn) { } }; - Y_UNIT_TEST(Continuation) { + Y_UNIT_TEST(Continuation) { TTestSync testSync; TSimpleEnv env; @@ -94,7 +94,7 @@ Y_UNIT_TEST_SUITE(Spawn) { } }; - Y_UNIT_TEST(Subtask) { + Y_UNIT_TEST(Subtask) { TTestSync testSync; TTestEnv env; @@ -124,8 +124,8 @@ Y_UNIT_TEST_SUITE(Spawn) { return nullptr; } - for (auto& subtask : Subtasks) { - SpawnSubtask<TNopSimpleTask>(Env, &subtask, ""); + for (auto& subtask : Subtasks) { + SpawnSubtask<TNopSimpleTask>(Env, &subtask, ""); } ++I; @@ -133,7 +133,7 @@ Y_UNIT_TEST_SUITE(Spawn) { } }; - Y_UNIT_TEST(SubtaskLong) { + Y_UNIT_TEST(SubtaskLong) { TTestSync testSync; TTestEnv env; diff --git a/library/cpp/messagebus/rain_check/core/task.cpp b/library/cpp/messagebus/rain_check/core/task.cpp index 3094890ed5f..a098437d534 100644 --- a/library/cpp/messagebus/rain_check/core/task.cpp +++ b/library/cpp/messagebus/rain_check/core/task.cpp @@ -31,7 +31,7 @@ TTaskRunnerBase::TTaskRunnerBase(IEnv* env, ISubtaskListener* parentTask, TAutoP } TTaskRunnerBase::~TTaskRunnerBase() { - Y_ASSERT(Done); + Y_ASSERT(Done); } namespace { @@ -40,19 +40,19 @@ namespace { TRunningInThisThreadGuard(TTaskRunnerBase* task) : Task(task) { - Y_ASSERT(!ThreadCurrentTask); + Y_ASSERT(!ThreadCurrentTask); ThreadCurrentTask = task; } ~TRunningInThisThreadGuard() { - Y_ASSERT(ThreadCurrentTask == Task); + Y_ASSERT(ThreadCurrentTask == Task); ThreadCurrentTask = nullptr; } }; } void NRainCheck::TTaskRunnerBase::Act(NActor::TDefaultTag) { - Y_ASSERT(RefCount() > 0); + Y_ASSERT(RefCount() > 0); TRunningInThisThreadGuard g(this); @@ -63,11 +63,11 @@ void NRainCheck::TTaskRunnerBase::Act(NActor::TDefaultTag) { temp.GetVector()->swap(Pending); - for (auto& pending : *temp.GetVector()) { - if (pending->IsComplete()) { - pending->FireCompletionCallback(GetImplBase()); + for (auto& pending : *temp.GetVector()) { + if (pending->IsComplete()) { + pending->FireCompletionCallback(GetImplBase()); } else { - Pending.push_back(pending); + Pending.push_back(pending); } } @@ -96,11 +96,11 @@ bool TTaskRunnerBase::IsRunningInThisThread() const { TSubtaskCompletion::~TSubtaskCompletion() { ESubtaskState state = State.Get(); - Y_ASSERT(state == CREATED || state == DONE || state == CANCELED); + Y_ASSERT(state == CREATED || state == DONE || state == CANCELED); } void TSubtaskCompletion::FireCompletionCallback(ITaskBase* task) { - Y_ASSERT(IsComplete()); + Y_ASSERT(IsComplete()); if (!!CompletionFunc) { TSubtaskCompletionFunc temp = CompletionFunc; @@ -130,8 +130,8 @@ void NRainCheck::TSubtaskCompletion::Cancel() { } void TSubtaskCompletion::SetRunning(TTaskRunnerBase* parent) { - Y_ASSERT(!TaskRunner); - Y_ASSERT(!!parent); + Y_ASSERT(!TaskRunner); + Y_ASSERT(!!parent); TaskRunner = parent; @@ -142,7 +142,7 @@ void TSubtaskCompletion::SetRunning(TTaskRunnerBase* parent) { for (;;) { ESubtaskState current = State.Get(); if (current != CREATED && current != DONE) { - Y_FAIL("current state should be CREATED or DONE: %s", ToCString(current)); + Y_FAIL("current state should be CREATED or DONE: %s", ToCString(current)); } if (State.CompareAndSet(current, RUNNING)) { return; @@ -151,7 +151,7 @@ void TSubtaskCompletion::SetRunning(TTaskRunnerBase* parent) { } void TSubtaskCompletion::SetDone() { - Y_ASSERT(!!TaskRunner); + Y_ASSERT(!!TaskRunner); TTaskRunnerBase* temp = TaskRunner; TaskRunner = nullptr; @@ -166,7 +166,7 @@ void TSubtaskCompletion::SetDone() { break; } } else { - Y_FAIL("cannot SetDone: unknown state: %s", ToCString(state)); + Y_FAIL("cannot SetDone: unknown state: %s", ToCString(state)); } } @@ -195,11 +195,11 @@ void NRainCheck::TTaskRunnerBase::ReleaseRef() #endif void TTaskRunnerBase::AssertInThisThread() const { - Y_ASSERT(IsRunningInThisThread()); + Y_ASSERT(IsRunningInThisThread()); } TTaskRunnerBase* TTaskRunnerBase::CurrentTask() { - Y_VERIFY(!!ThreadCurrentTask); + Y_VERIFY(!!ThreadCurrentTask); return ThreadCurrentTask; } diff --git a/library/cpp/messagebus/rain_check/core/track.cpp b/library/cpp/messagebus/rain_check/core/track.cpp index d41f6884ba2..092a51a2143 100644 --- a/library/cpp/messagebus/rain_check/core/track.cpp +++ b/library/cpp/messagebus/rain_check/core/track.cpp @@ -17,7 +17,7 @@ TTaskTracker::TTaskTracker(NActor::TExecutor* executor) } TTaskTracker::~TTaskTracker() { - Y_ASSERT(Tasks.Empty()); + Y_ASSERT(Tasks.Empty()); } void TTaskTracker::Shutdown() { @@ -36,7 +36,7 @@ void TTaskTracker::ProcessItem(NActor::TDefaultTag, NActor::TDefaultTag, ITaskFa } void TTaskTracker::ProcessItem(NActor::TDefaultTag, NActor::TDefaultTag, TTaskTrackerReceipt* receipt) { - Y_ASSERT(!receipt->Empty()); + Y_ASSERT(!receipt->Empty()); receipt->Unlink(); delete receipt; } diff --git a/library/cpp/messagebus/rain_check/core/track_ut.cpp b/library/cpp/messagebus/rain_check/core/track_ut.cpp index 22b9b65fe14..05f7de13195 100644 --- a/library/cpp/messagebus/rain_check/core/track_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/track_ut.cpp @@ -7,7 +7,7 @@ using namespace NRainCheck; -Y_UNIT_TEST_SUITE(TaskTracker) { +Y_UNIT_TEST_SUITE(TaskTracker) { struct TTaskForTracker: public ISimpleTask { TTestSync* const TestSync; @@ -23,7 +23,7 @@ Y_UNIT_TEST_SUITE(TaskTracker) { } }; - Y_UNIT_TEST(Simple) { + Y_UNIT_TEST(Simple) { TTestEnv env; TIntrusivePtr<TTaskTracker> tracker(new TTaskTracker(env.GetExecutor())); diff --git a/library/cpp/messagebus/rain_check/http/client_ut.cpp b/library/cpp/messagebus/rain_check/http/client_ut.cpp index 07941acdf58..16281143911 100644 --- a/library/cpp/messagebus/rain_check/http/client_ut.cpp +++ b/library/cpp/messagebus/rain_check/http/client_ut.cpp @@ -141,10 +141,10 @@ namespace { } // anonymous namespace -Y_UNIT_TEST_SUITE(RainCheckHttpClient) { +Y_UNIT_TEST_SUITE(RainCheckHttpClient) { static const TIpPort SERVER_PORT = 4000; - Y_UNIT_TEST(Simple) { + Y_UNIT_TEST(Simple) { // TODO: randomize port if (!IsFixedPortTestAllowed()) { return; @@ -159,7 +159,7 @@ Y_UNIT_TEST_SUITE(RainCheckHttpClient) { env.TestSync.WaitForAndIncrement(1); } - Y_UNIT_TEST(SimplePost) { + Y_UNIT_TEST(SimplePost) { // TODO: randomize port if (!IsFixedPortTestAllowed()) { return; @@ -174,7 +174,7 @@ Y_UNIT_TEST_SUITE(RainCheckHttpClient) { env.TestSync.WaitForAndIncrement(1); } - Y_UNIT_TEST(HttpCodeExtraction) { + Y_UNIT_TEST(HttpCodeExtraction) { // Find "request failed(" string, then copy len("HTTP/1.X NNN") chars and try to convert NNN to HTTP code. #define CHECK_VALID_LINE(line, code) \ diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp index 6a42e74c25e..daac8d9a993 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp @@ -66,7 +66,7 @@ void TBusClientService::OnReply( TAutoPtr<TBusMessage> request, TAutoPtr<TBusMessage> response) { TBusFuture* future = (TBusFuture*)request->Data; - Y_ASSERT(future->Request.Get() == request.Get()); + Y_ASSERT(future->Request.Get() == request.Get()); Y_UNUSED(request.Release()); future->SetDoneAndSchedule(MESSAGE_OK, response); } @@ -74,7 +74,7 @@ void TBusClientService::OnReply( void NRainCheck::TBusClientService::OnMessageSentOneWay( TAutoPtr<NBus::TBusMessage> request) { TBusFuture* future = (TBusFuture*)request->Data; - Y_ASSERT(future->Request.Get() == request.Get()); + Y_ASSERT(future->Request.Get() == request.Get()); Y_UNUSED(request.Release()); future->SetDoneAndSchedule(MESSAGE_OK, nullptr); } @@ -86,7 +86,7 @@ void TBusClientService::OnError( } TBusFuture* future = (TBusFuture*)message->Data; - Y_ASSERT(future->Request.Get() == message.Get()); + Y_ASSERT(future->Request.Get() == message.Get()); Y_UNUSED(message.Release()); future->SetDoneAndSchedule(status, nullptr); } diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h index 6b267550833..0a291cdea69 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h @@ -31,12 +31,12 @@ namespace NRainCheck { } NBus::TBusMessage* GetResponse() const { - Y_ASSERT(IsDone()); + Y_ASSERT(IsDone()); return Response.Get(); } NBus::EMessageStatus GetStatus() const { - Y_ASSERT(IsDone()); + Y_ASSERT(IsDone()); return Status; } }; diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp index e0883b49b98..1b3618558b8 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp @@ -32,7 +32,7 @@ struct TMessageBusClientEnv: public TTestEnvTemplate<TMessageBusClientEnv> { } }; -Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { +Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { struct TSimpleTask: public ISimpleTask { TMessageBusClientEnv* const Env; @@ -58,7 +58,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { TContinueFunc GotReplies() { for (unsigned i = 0; i < Requests.size(); ++i) { - Y_VERIFY(Requests[i]->GetStatus() == MESSAGE_OK); + Y_VERIFY(Requests[i]->GetStatus() == MESSAGE_OK); VerifyDynamicCast<TExampleResponse*>(Requests[i]->GetResponse()); } Env->TestSync.CheckAndIncrement(0); @@ -66,7 +66,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { } }; - Y_UNIT_TEST(Simple) { + Y_UNIT_TEST(Simple) { TObjectCountCheck objectCountCheck; TExampleServer server; @@ -124,15 +124,15 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { TContinueFunc GotReplies() { for (unsigned i = 0; i < Requests.size(); ++i) { - Y_VERIFY(Requests[i]->GetStatus() == MESSAGE_OK); - Y_VERIFY(!Requests[i]->GetResponse()); + Y_VERIFY(Requests[i]->GetStatus() == MESSAGE_OK); + Y_VERIFY(!Requests[i]->GetResponse()); } Env->TestSync.WaitForAndIncrement(2); return nullptr; } }; - Y_UNIT_TEST(OneWay) { + Y_UNIT_TEST(OneWay) { TObjectCountCheck objectCountCheck; TMessageBusClientEnv env; diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp index af2084762f2..7c11399f1be 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp @@ -14,7 +14,7 @@ struct TMessageBusServerEnv: public TTestEnvTemplate<TMessageBusServerEnv> { TExampleProtocol Proto; }; -Y_UNIT_TEST_SUITE(RainCheckMessageBusServer) { +Y_UNIT_TEST_SUITE(RainCheckMessageBusServer) { struct TSimpleServerTask: public ISimpleTask { private: TMessageBusServerEnv* const Env; @@ -33,7 +33,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusServer) { } }; - Y_UNIT_TEST(Simple) { + Y_UNIT_TEST(Simple) { TMessageBusServerEnv env; THolder<TBusTaskStarter> starter(TBusTaskStarter::NewStarter<TSimpleServerTask>(&env)); diff --git a/library/cpp/messagebus/rain_check/test/helper/misc.cpp b/library/cpp/messagebus/rain_check/test/helper/misc.cpp index e0a88a8ab9f..c0fcb272523 100644 --- a/library/cpp/messagebus/rain_check/test/helper/misc.cpp +++ b/library/cpp/messagebus/rain_check/test/helper/misc.cpp @@ -5,7 +5,7 @@ using namespace NRainCheck; void TSpawnNopTasksCoroTask::Run() { - Y_VERIFY(Count <= Completion.size()); + Y_VERIFY(Count <= Completion.size()); for (unsigned i = 0; i < Count; ++i) { SpawnSubtask<TNopCoroTask>(Env, &Completion[i], ""); } @@ -14,7 +14,7 @@ void TSpawnNopTasksCoroTask::Run() { } TContinueFunc TSpawnNopTasksSimpleTask::Start() { - Y_VERIFY(Count <= Completion.size()); + Y_VERIFY(Count <= Completion.size()); for (unsigned i = 0; i < Count; ++i) { SpawnSubtask<TNopSimpleTask>(Env, &Completion[i], ""); } diff --git a/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp b/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp index 5a353da5bb0..22edbd8c6ba 100644 --- a/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp @@ -137,8 +137,8 @@ struct TReproduceCrashTask: public ISimpleTask { }; int main(int argc, char** argv) { - Y_UNUSED(argc); - Y_UNUSED(argv); + Y_UNUSED(argc); + Y_UNUSED(argv); TRainCheckPerftestEnv env; |