aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/unittest
diff options
context:
space:
mode:
authorilnurkh <ilnurkh@yandex-team.com>2023-10-09 23:39:40 +0300
committerilnurkh <ilnurkh@yandex-team.com>2023-10-09 23:57:14 +0300
commite601ca03f859335d57ecff2e5aa6af234b6052ed (patch)
treede519a847e58a1b3993fcbfe05ff44cc946a3e24 /library/cpp/testing/unittest
parentbbf2b6878af3854815a2c0ecb07a687071787639 (diff)
downloadydb-e601ca03f859335d57ecff2e5aa6af234b6052ed.tar.gz
Y_VERIFY->Y_ABORT_UNLESS at ^l
https://clubs.at.yandex-team.ru/arcadia/29404
Diffstat (limited to 'library/cpp/testing/unittest')
-rw-r--r--library/cpp/testing/unittest/registar.cpp10
-rw-r--r--library/cpp/testing/unittest/utmain.cpp4
2 files changed, 7 insertions, 7 deletions
diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp
index 4f032fa00b4..675d1f60030 100644
--- a/library/cpp/testing/unittest/registar.cpp
+++ b/library/cpp/testing/unittest/registar.cpp
@@ -34,8 +34,8 @@ currentTest;
::NUnitTest::TRaiseErrorHandler RaiseErrorHandler;
void ::NUnitTest::NPrivate::RaiseError(const char* what, const TString& msg, bool fatalFailure) {
- Y_VERIFY(UnittestThread, "%s in non-unittest thread with message:\n%s", what, msg.data());
- Y_VERIFY(GetCurrentTest());
+ Y_ABORT_UNLESS(UnittestThread, "%s in non-unittest thread with message:\n%s", what, msg.data());
+ Y_ABORT_UNLESS(GetCurrentTest());
if (RaiseErrorHandler) {
RaiseErrorHandler(what, msg, fatalFailure);
@@ -53,17 +53,17 @@ void ::NUnitTest::NPrivate::RaiseError(const char* what, const TString& msg, boo
}
void ::NUnitTest::SetRaiseErrorHandler(::NUnitTest::TRaiseErrorHandler handler) {
- Y_VERIFY(UnittestThread);
+ Y_ABORT_UNLESS(UnittestThread);
RaiseErrorHandler = std::move(handler);
}
void ::NUnitTest::NPrivate::SetUnittestThread(bool unittestThread) {
- Y_VERIFY(UnittestThread != unittestThread, "state check");
+ Y_ABORT_UNLESS(UnittestThread != unittestThread, "state check");
UnittestThread = unittestThread;
}
void ::NUnitTest::NPrivate::SetCurrentTest(TTestBase* test) {
- Y_VERIFY(!test || !currentTest, "state check");
+ Y_ABORT_UNLESS(!test || !currentTest, "state check");
currentTest = test;
}
diff --git a/library/cpp/testing/unittest/utmain.cpp b/library/cpp/testing/unittest/utmain.cpp
index cae713e3aca..1daabad4b84 100644
--- a/library/cpp/testing/unittest/utmain.cpp
+++ b/library/cpp/testing/unittest/utmain.cpp
@@ -566,7 +566,7 @@ private:
ythrow yexception() << "Forked test finished with unknown status";
}
case TShellCommand::SHELL_RUNNING: {
- Y_VERIFY(false, "This can't happen, we used sync mode, it's a bug!");
+ Y_ABORT_UNLESS(false, "This can't happen, we used sync mode, it's a bug!");
}
case TShellCommand::SHELL_INTERNAL_ERROR: {
ythrow yexception() << "Forked test failed with internal error: " << cmd.GetInternalError();
@@ -706,7 +706,7 @@ int NUnitTest::RunMain(int argc, char** argv) {
memset(&sa, 0, sizeof(sa));
sa.sa_handler = GracefulShutdownHandler;
sa.sa_flags = SA_SIGINFO | SA_RESTART;
- Y_VERIFY(!sigaction(SIGUSR2, &sa, nullptr));
+ Y_ABORT_UNLESS(!sigaction(SIGUSR2, &sa, nullptr));
}
#endif
NTesting::THook::CallBeforeInit();