diff options
| author | nsofya <[email protected]> | 2022-02-10 16:49:52 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:52 +0300 | 
| commit | 3f5911a056d3dbc4bfd724740244a3a9c11575ef (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/testing | |
| parent | 2ea6d2c7415473747379b1c65468241b431057ad (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 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 5d54558367f..7b89aa1bed8 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 8c83ae62873..ebad1ea4d67 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 c7d143be99b..2a5300d886e 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 9cf94d98a02..b51cbc4b87c 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 43d9d665132..6536bc1ae69 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(); | 
