diff options
author | nsofya <nsofya@yandex-team.ru> | 2022-02-10 16:49:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:52 +0300 |
commit | 3f5911a056d3dbc4bfd724740244a3a9c11575ef (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/testing/unittest | |
parent | 2ea6d2c7415473747379b1c65468241b431057ad (diff) | |
download | ydb-3f5911a056d3dbc4bfd724740244a3a9c11575ef.tar.gz |
Restoring authorship annotation for <nsofya@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/testing/unittest')
-rw-r--r-- | library/cpp/testing/unittest/gtest.cpp | 4 | ||||
-rw-r--r-- | library/cpp/testing/unittest/simple.h | 62 | ||||
-rw-r--r-- | library/cpp/testing/unittest/tests_data.cpp | 2 | ||||
-rw-r--r-- | library/cpp/testing/unittest/tests_data.h | 8 |
4 files changed, 38 insertions, 38 deletions
diff --git a/library/cpp/testing/unittest/gtest.cpp b/library/cpp/testing/unittest/gtest.cpp index 8c83ae6287..ebad1ea4d6 100644 --- a/library/cpp/testing/unittest/gtest.cpp +++ b/library/cpp/testing/unittest/gtest.cpp @@ -1,5 +1,5 @@ #include "gtest.h" -#include "simple.h" +#include "simple.h" #include <util/generic/map.h> #include <util/generic/vector.h> @@ -12,7 +12,7 @@ IGTestFactory::~IGTestFactory() { } namespace { - struct TCurrentTest: public TSimpleTestExecutor { + struct TCurrentTest: public TSimpleTestExecutor { inline TCurrentTest(TStringBuf name) : MyName(name) { diff --git a/library/cpp/testing/unittest/simple.h b/library/cpp/testing/unittest/simple.h index c7d143be99..2a5300d886 100644 --- a/library/cpp/testing/unittest/simple.h +++ b/library/cpp/testing/unittest/simple.h @@ -1,39 +1,39 @@ -#pragma once - -#include "registar.h" - -namespace NUnitTest { - struct TSimpleTestExecutor: public TTestBase { +#pragma once + +#include "registar.h" + +namespace NUnitTest { + struct TSimpleTestExecutor: public TTestBase { typedef TVector<TBaseTestCase> TTests; - - TTests Tests; - - virtual void Execute() override final { - AtStart(); - - for (typename TTests::iterator i = Tests.begin(), ie = Tests.end(); i != ie; ++i) { + + TTests Tests; + + virtual void Execute() override final { + AtStart(); + + for (typename TTests::iterator i = Tests.begin(), ie = Tests.end(); i != ie; ++i) { if (!CheckAccessTest(i->Name_)) { - continue; - } + continue; + } TTestContext context(this->Processor()); - try { + try { BeforeTest(i->Name_); - { - TCleanUp cleaner(this); + { + TCleanUp cleaner(this); TTestBase::Run([i, &context] { i->Body_(context); }, Name(), i->Name_, i->ForceFork_); - } - } catch (const ::NUnitTest::TAssertException&) { - } catch (const yexception& e) { + } + } catch (const ::NUnitTest::TAssertException&) { + } catch (const yexception& e) { CATCH_REACTION_BT(i->Name_, e, &context); - } catch (const std::exception& e) { + } catch (const std::exception& e) { CATCH_REACTION(i->Name_, e, &context); - } catch (...) { - AddError("non-std exception!", &context); - } + } catch (...) { + AddError("non-std exception!", &context); + } Finish(i->Name_, &context); - } - - AtEnd(); - } - }; -} + } + + AtEnd(); + } + }; +} diff --git a/library/cpp/testing/unittest/tests_data.cpp b/library/cpp/testing/unittest/tests_data.cpp index 9cf94d98a0..b51cbc4b87 100644 --- a/library/cpp/testing/unittest/tests_data.cpp +++ b/library/cpp/testing/unittest/tests_data.cpp @@ -93,7 +93,7 @@ ui16 TPortManager::GetUdpPort(ui16 port) { ui16 TPortManager::GetTcpAndUdpPort(ui16 port) { return Impl_->GetTcpAndUdpPort(port); } - + ui16 TPortManager::GetPortsRange(const ui16 startPort, const ui16 range) { return Impl_->GetPortsRange(startPort, range); } diff --git a/library/cpp/testing/unittest/tests_data.h b/library/cpp/testing/unittest/tests_data.h index 43d9d66513..6536bc1ae6 100644 --- a/library/cpp/testing/unittest/tests_data.h +++ b/library/cpp/testing/unittest/tests_data.h @@ -7,8 +7,8 @@ #include <util/generic/string.h> #include <util/network/sock.h> -class TInet6StreamSocket; - +class TInet6StreamSocket; + // set two options: SO_REUSEADDR and SO_REUSEPORT, both are required for // correct implementation of TPortManager because of different operating systems // incompatibility: singe SO_REUSEADDR is enough for Linux, but not enough for Darwin @@ -34,7 +34,7 @@ public: // Gets free TCP port ui16 GetPort(ui16 port = 0); - + // Gets free TCP port ui16 GetTcpPort(ui16 port = 0); @@ -49,6 +49,6 @@ public: private: class TPortManagerImpl; THolder<TPortManagerImpl> Impl_; -}; +}; ui16 GetRandomPort(); |