aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/unittest/tests_data.cpp
diff options
context:
space:
mode:
authorVasily Gerasimov <UgnineSirdis@gmail.com>2022-02-10 16:49:09 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:09 +0300
commit6cdc8f140213c595e4ad38bc3d97fcef1146b8c3 (patch)
treef69637041e6fed76ebae0c74ae1fa0c4be6ab5b4 /library/cpp/testing/unittest/tests_data.cpp
parente5d4696304c6689379ac7ce334512404d4b7836c (diff)
downloadydb-6cdc8f140213c595e4ad38bc3d97fcef1146b8c3.tar.gz
Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing/unittest/tests_data.cpp')
-rw-r--r--library/cpp/testing/unittest/tests_data.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/library/cpp/testing/unittest/tests_data.cpp b/library/cpp/testing/unittest/tests_data.cpp
index b51cbc4b87..a131a54ddf 100644
--- a/library/cpp/testing/unittest/tests_data.cpp
+++ b/library/cpp/testing/unittest/tests_data.cpp
@@ -1,5 +1,5 @@
#include "tests_data.h"
-#include "registar.h"
+#include "registar.h"
#include <library/cpp/testing/common/network.h>
@@ -35,10 +35,10 @@ public:
return GetPort(port);
}
- ui16 GetTcpAndUdpPort(ui16 port) {
+ ui16 GetTcpAndUdpPort(ui16 port) {
return GetPort(port);
- }
-
+ }
+
ui16 GetPortsRange(const ui16 startPort, const ui16 range) {
Y_UNUSED(startPort);
auto ports = NTesting::NLegacy::GetFreePortsRange(range);
@@ -54,16 +54,16 @@ public:
private:
void ReservePortForCurrentTest(const TAtomicSharedPtr<NTesting::IPort>& portGuard) {
if (EnableReservePortsForCurrentTest) {
- TTestBase* currentTest = NUnitTest::NPrivate::GetCurrentTest();
- if (currentTest != nullptr) {
- currentTest->RunAfterTest([guard = portGuard]() mutable {
- guard = nullptr; // remove reference for allocated port
- });
- }
- }
- }
-
-private:
+ TTestBase* currentTest = NUnitTest::NPrivate::GetCurrentTest();
+ if (currentTest != nullptr) {
+ currentTest->RunAfterTest([guard = portGuard]() mutable {
+ guard = nullptr; // remove reference for allocated port
+ });
+ }
+ }
+ }
+
+private:
TMutex Lock;
TVector<TAtomicSharedPtr<NTesting::IPort>> ReservedPorts;
const bool EnableReservePortsForCurrentTest;
@@ -81,18 +81,18 @@ TPortManager::~TPortManager() {
ui16 TPortManager::GetPort(ui16 port) {
return Impl_->GetTcpPort(port);
}
-
-ui16 TPortManager::GetTcpPort(ui16 port) {
+
+ui16 TPortManager::GetTcpPort(ui16 port) {
return Impl_->GetTcpPort(port);
-}
-
-ui16 TPortManager::GetUdpPort(ui16 port) {
+}
+
+ui16 TPortManager::GetUdpPort(ui16 port) {
return Impl_->GetUdpPort(port);
-}
-
-ui16 TPortManager::GetTcpAndUdpPort(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);