diff options
| author | Andrey Fomichev <[email protected]> | 2022-02-10 16:49:12 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:12 +0300 | 
| commit | e542cc14db4240643a06bb0dde87ecf361f101ab (patch) | |
| tree | 3b03a4b94acd11a4eca042532035806e5fa08ad1 /library/cpp/testing | |
| parent | e2ac73225f30f7fcf7df3cb225cba257f56144c1 (diff) | |
Restoring authorship annotation for Andrey Fomichev <[email protected]>. 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/tests_data.h | 38 | 
2 files changed, 21 insertions, 21 deletions
| diff --git a/library/cpp/testing/common/env.h b/library/cpp/testing/common/env.h index 7b89aa1bed8..952faa91bc2 100644 --- a/library/cpp/testing/common/env.h +++ b/library/cpp/testing/common/env.h @@ -17,10 +17,10 @@ TString ArcadiaFromCurrentLocation(TStringBuf where, TStringBuf path);  // @brief return build folder path  TString BuildRoot(); - +   // @brief return full path to built artefact, where path is relative from arcadia root  TString BinaryPath(TStringBuf path); - +   // @brief return true if environment is testenv otherwise false  bool FromYaTest(); diff --git a/library/cpp/testing/unittest/tests_data.h b/library/cpp/testing/unittest/tests_data.h index 6536bc1ae69..6775e98b5da 100644 --- a/library/cpp/testing/unittest/tests_data.h +++ b/library/cpp/testing/unittest/tests_data.h @@ -5,28 +5,28 @@  #include <util/generic/noncopyable.h>  #include <util/generic/ptr.h>  #include <util/generic/string.h> -#include <util/network/sock.h> +#include <util/network/sock.h>   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 -template <class TSocketType> -void SetReuseAddressAndPort(const TSocketType& sock) { -    const int retAddr = SetSockOpt(sock, SOL_SOCKET, SO_REUSEADDR, 1); -    if (retAddr < 0) { -        ythrow yexception() << "can't set SO_REUSEADDR: " << LastSystemErrorText(-retAddr); -    } - -#ifdef SO_REUSEPORT -    const int retPort = SetSockOpt(sock, SOL_SOCKET, SO_REUSEPORT, 1); -    if (retPort < 0) { -        ythrow yexception() << "can't set SO_REUSEPORT: " << LastSystemErrorText(-retPort); -    } -#endif -} - +// 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  +template <class TSocketType>  +void SetReuseAddressAndPort(const TSocketType& sock) {  +    const int retAddr = SetSockOpt(sock, SOL_SOCKET, SO_REUSEADDR, 1);  +    if (retAddr < 0) {  +        ythrow yexception() << "can't set SO_REUSEADDR: " << LastSystemErrorText(-retAddr);  +    }  +  +#ifdef SO_REUSEPORT  +    const int retPort = SetSockOpt(sock, SOL_SOCKET, SO_REUSEPORT, 1);  +    if (retPort < 0) {  +        ythrow yexception() << "can't set SO_REUSEPORT: " << LastSystemErrorText(-retPort);  +    }  +#endif  +}  +   class TPortManager: public TNonCopyable {  public:      TPortManager(bool reservePortsForCurrentTest = true); | 
