diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/messagebus/test | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/messagebus/test')
5 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/messagebus/test/helper/example.cpp b/library/cpp/messagebus/test/helper/example.cpp index 7c6d704042..0d3000b81c 100644 --- a/library/cpp/messagebus/test/helper/example.cpp +++ b/library/cpp/messagebus/test/helper/example.cpp @@ -14,8 +14,8 @@ static void FillWithJunk(TArrayRef<char> data) { "01234567890123456789012345678901234567890123456789012345678901234567890123456789" "01234567890123456789012345678901234567890123456789012345678901234567890123456789"; - for (size_t i = 0; i < data.size(); i += junk.size()) { - memcpy(data.data() + i, junk.data(), Min(junk.size(), data.size() - i)); + for (size_t i = 0; i < data.size(); i += junk.size()) { + memcpy(data.data() + i, junk.data(), Min(junk.size(), data.size() - i)); } } @@ -79,9 +79,9 @@ void TExampleProtocol::Serialize(const TBusMessage* message, TBuffer& buffer) { // Messages have no data, we recreate them from scratch // instead of sending, so we don't need to serialize them. if (const TExampleRequest* exampleMessage = dynamic_cast<const TExampleRequest*>(message)) { - buffer.Append(exampleMessage->Data.data(), exampleMessage->Data.size()); + buffer.Append(exampleMessage->Data.data(), exampleMessage->Data.size()); } else if (const TExampleResponse* exampleReply = dynamic_cast<const TExampleResponse*>(message)) { - buffer.Append(exampleReply->Data.data(), exampleReply->Data.size()); + buffer.Append(exampleReply->Data.data(), exampleReply->Data.size()); } else { Y_FAIL("unknown message type"); } @@ -277,5 +277,5 @@ void TExampleServer::OnMessage(TOnMessageContext& mess) { status = mess.SendReplyMove(reply); } - Y_VERIFY(status == MESSAGE_OK, "failed to send reply: %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_OK, "failed to send reply: %s", ToString(status).data()); } diff --git a/library/cpp/messagebus/test/helper/message_handler_error.cpp b/library/cpp/messagebus/test/helper/message_handler_error.cpp index c09811ec67..97c73a101d 100644 --- a/library/cpp/messagebus/test/helper/message_handler_error.cpp +++ b/library/cpp/messagebus/test/helper/message_handler_error.cpp @@ -6,7 +6,7 @@ using namespace NBus; using namespace NBus::NTest; void TBusClientHandlerError::OnError(TAutoPtr<TBusMessage>, EMessageStatus status) { - Y_FAIL("must not be called, status: %s", ToString(status).data()); + Y_FAIL("must not be called, status: %s", ToString(status).data()); } void TBusClientHandlerError::OnReply(TAutoPtr<TBusMessage>, TAutoPtr<TBusMessage>) { @@ -18,7 +18,7 @@ void TBusClientHandlerError::OnMessageSentOneWay(TAutoPtr<TBusMessage>) { } void TBusServerHandlerError::OnError(TAutoPtr<TBusMessage>, EMessageStatus status) { - Y_FAIL("must not be called, status: %s", ToString(status).data()); + Y_FAIL("must not be called, status: %s", ToString(status).data()); } void TBusServerHandlerError::OnMessage(TOnMessageContext&) { diff --git a/library/cpp/messagebus/test/perftest/perftest.cpp b/library/cpp/messagebus/test/perftest/perftest.cpp index 8489319278..dbbddf6ef9 100644 --- a/library/cpp/messagebus/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/test/perftest/perftest.cpp @@ -157,7 +157,7 @@ void CheckRequest(TPerftestRequest* request) { TAutoPtr<TPerftestResponse> NewResponse(TPerftestRequest* request) { TAutoPtr<TPerftestResponse> r(new TPerftestResponse); r->SetCompressed(TheConfig->UseCompression); - r->Record.SetData(TString(request->Record.GetData().size(), '.')); + r->Record.SetData(TString(request->Record.GetData().size(), '.')); return r; } @@ -475,10 +475,10 @@ TVector<TNetAddr> ParseNodes(const TString nodes) { TVector<TString> hosts; - size_t numh = Split(nodes.data(), ",", hosts); + size_t numh = Split(nodes.data(), ",", hosts); for (int i = 0; i < int(numh); i++) { - const TNetworkAddress& networkAddress = ParseNetworkAddress(hosts[i].data()); + const TNetworkAddress& networkAddress = ParseNetworkAddress(hosts[i].data()); Y_VERIFY(networkAddress.Begin() != networkAddress.End(), "no addresses"); r.push_back(TNetAddr(networkAddress, &*networkAddress.Begin())); } @@ -542,17 +542,17 @@ void TTestStats::PeriodicallyPrint() { if (!!Server) { fprintf(stderr, "server: q: %u %s\n", (unsigned)Server->Bus->GetExecutor()->GetWorkQueueSize(), - Server->Session->GetStatusSingleLine().data()); + Server->Session->GetStatusSingleLine().data()); } if (!!ServerUsingModule) { fprintf(stderr, "server: q: %u %s\n", (unsigned)ServerUsingModule->Bus->GetExecutor()->GetWorkQueueSize(), - ServerUsingModule->Session->GetStatusSingleLine().data()); + ServerUsingModule->Session->GetStatusSingleLine().data()); } for (const auto& client : clients) { fprintf(stderr, "client: q: %u %s\n", (unsigned)client->Bus->GetExecutor()->GetWorkQueueSize(), - client->Session->GetStatusSingleLine().data()); + client->Session->GetStatusSingleLine().data()); } TStringStream stats; diff --git a/library/cpp/messagebus/test/ut/messagebus_ut.cpp b/library/cpp/messagebus/test/ut/messagebus_ut.cpp index 040f9b7702..a79b266a12 100644 --- a/library/cpp/messagebus/test/ut/messagebus_ut.cpp +++ b/library/cpp/messagebus/test/ut/messagebus_ut.cpp @@ -138,7 +138,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override { Y_UNUSED(message); - Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data()); TestSync.CheckAndIncrement((failures++) * 2); } @@ -159,7 +159,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { status = client.Session->SendMessageAutoPtr(message, &noServerAddr); } - Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); if (count == 0) { // lame way to wait until it is connected @@ -266,7 +266,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { TSystemEvent ErrorHappened; void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { - Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got status: %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got status: %s", ToString(status).data()); ErrorHappened.Signal(); } }; @@ -378,7 +378,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); - Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed, got %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed, got %s", ToString(status).data()); } }; @@ -697,7 +697,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { TestSync.WaitForAndIncrement(0); - Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "must be connection failed, got %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "must be connection failed, got %s", ToString(status).data()); mess.Destroy(); TestSync.CheckAndIncrement(1); } @@ -726,7 +726,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override { TestSync.CheckAndIncrement(0); - Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data()); // check reset is possible here message->Reset(); @@ -755,7 +755,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { client.Session->Shutdown(); ok = client.Session->SendMessageOneWay(message); - Y_VERIFY(ok == MESSAGE_SHUTDOWN, "must be shutdown when sending during shutdown, got %s", ToString(ok).data()); + Y_VERIFY(ok == MESSAGE_SHUTDOWN, "must be shutdown when sending during shutdown, got %s", ToString(ok).data()); // check reset is possible here message->Reset(); @@ -1074,7 +1074,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount), &noServerAddr); - Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); client.TestSync.WaitForAndIncrement(count * 2 + 1); // First connection attempt is for connect call; second one is to get connect result. @@ -1085,7 +1085,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount), &noServerAddr); - Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); client.TestSync.WaitForAndIncrement(count * 2 + 1); // First connection attempt is for connect call; second one is to get connect result. @@ -1107,7 +1107,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount), &noServerAddr); - Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); client.TestSync.WaitForAndIncrement(count * 2 + 1); // First connection attempt is for connect call; second one is to get connect result. @@ -1134,7 +1134,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount), &noServerAddr); - Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data()); client.TestSync.WaitForAndIncrement(count * 2 + 1); // First connection attempt is for connect call; second one is to get connect result. diff --git a/library/cpp/messagebus/test/ut/module_client_ut.cpp b/library/cpp/messagebus/test/ut/module_client_ut.cpp index ebfe185cc6..4e107ecd2d 100644 --- a/library/cpp/messagebus/test/ut/module_client_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_client_ut.cpp @@ -178,7 +178,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { } void ReplyHandler(TBusJob*, EMessageStatus status, TBusMessage* req, TBusMessage* resp) { - Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got wrong status: %s", ToString(status).data()); + Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got wrong status: %s", ToString(status).data()); Y_VERIFY(req == SentMessage, "checking request"); Y_VERIFY(resp == nullptr, "checking response"); GotReplyLatch.CountDown(); |