diff options
author | ilnurkh <[email protected]> | 2023-10-09 23:39:40 +0300 |
---|---|---|
committer | ilnurkh <[email protected]> | 2023-10-09 23:57:14 +0300 |
commit | e601ca03f859335d57ecff2e5aa6af234b6052ed (patch) | |
tree | de519a847e58a1b3993fcbfe05ff44cc946a3e24 /library/cpp/messagebus/test/ut/messagebus_ut.cpp | |
parent | bbf2b6878af3854815a2c0ecb07a687071787639 (diff) |
Y_VERIFY->Y_ABORT_UNLESS at ^l
https://clubs.at.yandex-team.ru/arcadia/29404
Diffstat (limited to 'library/cpp/messagebus/test/ut/messagebus_ut.cpp')
-rw-r--r-- | library/cpp/messagebus/test/ut/messagebus_ut.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/messagebus/test/ut/messagebus_ut.cpp b/library/cpp/messagebus/test/ut/messagebus_ut.cpp index 8d2f4aa444f..8f6aa6a2956 100644 --- a/library/cpp/messagebus/test/ut/messagebus_ut.cpp +++ b/library/cpp/messagebus/test/ut/messagebus_ut.cpp @@ -31,7 +31,7 @@ namespace { } void OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> reply) override { - Y_VERIFY(AtomicGet(SentCompleted), "must be completed"); + Y_ABORT_UNLESS(AtomicGet(SentCompleted), "must be completed"); TExampleClient::OnReply(mess, reply); @@ -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_ABORT_UNLESS(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_ABORT_UNLESS(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_ABORT_UNLESS(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got status: %s", ToString(status).data()); ErrorHappened.Signal(); } }; @@ -327,7 +327,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { } void OnMessage(TOnMessageContext& mess) override { - Y_VERIFY(mess.IsConnectionAlive(), "connection should be alive here"); + Y_ABORT_UNLESS(mess.IsConnectionAlive(), "connection should be alive here"); TAutoPtr<TOnMessageContext> delayedMsg(new TOnMessageContext); delayedMsg->Swap(mess); auto g(Guard(Lock_)); @@ -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_ABORT_UNLESS(status == MESSAGE_SHUTDOWN, "only shutdown allowed, got %s", ToString(status).data()); } }; @@ -432,7 +432,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"); + Y_ABORT_UNLESS(status == MESSAGE_SHUTDOWN, "only shutdown allowed"); } }; @@ -505,7 +505,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { TestSync.WaitForAndIncrement(1); - Y_VERIFY(status == MESSAGE_MESSAGE_TOO_LARGE, "status"); + Y_ABORT_UNLESS(status == MESSAGE_MESSAGE_TOO_LARGE, "status"); } }; @@ -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_ABORT_UNLESS(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_ABORT_UNLESS(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_ABORT_UNLESS(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_ABORT_UNLESS(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_ABORT_UNLESS(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_ABORT_UNLESS(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_ABORT_UNLESS(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. |