/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
library/cpp/testing/unittest/pytests/test_subject/tests.cpp
34 строки
1 KB
qkrorlqr
Initial NBS OpenSource export
28 апр 2023, 21:54
28 апр 2023, 21:54
783a858
Код
Авторство
О чём код?
#include <library/cpp/testing/unittest/registar.h> namespace NSubjectTests { class TAlwaysTearDownFixture : public NUnitTest::TBaseFixture { public: void TearDown(NUnitTest::TTestContext&) override { Cerr << Name_ << ": TearDown is ran" << Endl; } }; class TAlwaysTearDownSetUpThrowsFixture : public NUnitTest::TBaseFixture { public: void SetUp(NUnitTest::TTestContext&) override { ythrow yexception() << "hope this won't skip teardown"; } void TearDown(NUnitTest::TTestContext&) override { Cerr << Name_ << ": TearDown is ran" << Endl; } }; Y_UNIT_TEST_SUITE(TestsAlwaysTearDown) { Y_UNIT_TEST_F(TestFail, TAlwaysTearDownFixture) { UNIT_ASSERT(false); } Y_UNIT_TEST_F(TestThrow, TAlwaysTearDownFixture) { ythrow yexception() << "hope this won't skip teardown"; } Y_UNIT_TEST_F(TestSetUpThrows, TAlwaysTearDownSetUpThrowsFixture) { } } }