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 | 2ea6d2c7415473747379b1c65468241b431057ad (patch) | |
tree | 667f873e5a94ca0042984be80442f34aac887f7d /library/cpp/testing | |
parent | edee5b99e1eec042f46725b89dcd81ea7e41d663 (diff) | |
download | ydb-2ea6d2c7415473747379b1c65468241b431057ad.tar.gz |
Restoring authorship annotation for <nsofya@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing')
-rw-r--r-- | library/cpp/testing/common/env.h | 4 | ||||
-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 |
5 files changed, 40 insertions, 40 deletions
diff --git a/library/cpp/testing/common/env.h b/library/cpp/testing/common/env.h index 7b89aa1bed..5d54558367 100644 --- a/library/cpp/testing/common/env.h +++ b/library/cpp/testing/common/env.h @@ -2,14 +2,14 @@ #include <unordered_map> -#include <util/folder/path.h> +#include <util/folder/path.h> #include <util/generic/string.h> #include <util/generic/strbuf.h> #include <util/system/src_location.h> // @brief return full path to arcadia root TString ArcadiaSourceRoot(); - + // @brief return full path for file or folder specified by known source location `where` and `path` which is relative to parent folder of `where` // for the instance: there is 2 files in folder test example_ut.cpp and example.data, so full path to test/example.data can be obtained // from example_ut.cpp as ArcadiaFromCurrentLocation(__SOURCE_FILE__, "example.data") diff --git a/library/cpp/testing/unittest/gtest.cpp b/library/cpp/testing/unittest/gtest.cpp index ebad1ea4d6..8c83ae6287 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 2a5300d886..c7d143be99 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 b51cbc4b87..9cf94d98a0 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 6536bc1ae6..43d9d66513 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(); |