aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/unittest/registar_ut.cpp
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-02-08 18:25:47 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-02-08 18:25:47 +0300
commita3ac8a71f16e0db7d50d5b1235466ff754e0d228 (patch)
tree8433eb84ffae296ccb9ae094d08491c86c48bdb1 /library/cpp/testing/unittest/registar_ut.cpp
parent60312eaed2e51caa7ed482270d3545a9d27cb284 (diff)
downloadydb-a3ac8a71f16e0db7d50d5b1235466ff754e0d228.tar.gz
intermediate changes
ref:f398132a6a7101a031da4a85ff8dc9f360af7d8a
Diffstat (limited to 'library/cpp/testing/unittest/registar_ut.cpp')
-rw-r--r--library/cpp/testing/unittest/registar_ut.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/library/cpp/testing/unittest/registar_ut.cpp b/library/cpp/testing/unittest/registar_ut.cpp
index aada471030..1f36d53abb 100644
--- a/library/cpp/testing/unittest/registar_ut.cpp
+++ b/library/cpp/testing/unittest/registar_ut.cpp
@@ -275,10 +275,22 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) {
}
}
+ std::string ThrowStr() {
+ if (ThrowMe) {
+ throw *this;
+ }
+
+ return {};
+ }
+
void AssertNoException() {
UNIT_ASSERT_NO_EXCEPTION(Throw());
}
+ void AssertNoExceptionRet() {
+ const TString res = UNIT_ASSERT_NO_EXCEPTION_RESULT(ThrowStr());
+ }
+
template <class TExpectedException>
void AssertException() {
UNIT_ASSERT_EXCEPTION(Throw(), TExpectedException);
@@ -333,6 +345,7 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) {
Y_UNIT_TEST(NoException) {
UNIT_ASSERT_TEST_FAILS(TTestException().AssertNoException());
+ UNIT_ASSERT_TEST_FAILS(TTestException().AssertNoExceptionRet());
UNIT_ASSERT_NO_EXCEPTION(TTestException("", false).Throw());
}