diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /util/network/poller_ut.cpp | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/network/poller_ut.cpp')
-rw-r--r-- | util/network/poller_ut.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/util/network/poller_ut.cpp b/util/network/poller_ut.cpp index 0e19bff4c1..6df0dda8ec 100644 --- a/util/network/poller_ut.cpp +++ b/util/network/poller_ut.cpp @@ -1,12 +1,12 @@ #include <library/cpp/testing/unittest/registar.h> #include <util/system/error.h> -#include "pair.h" +#include "pair.h" #include "poller.h" #include "pollerimpl.h" -Y_UNIT_TEST_SUITE(TSocketPollerTest) { - Y_UNIT_TEST(TestSimple) { +Y_UNIT_TEST_SUITE(TSocketPollerTest) { + Y_UNIT_TEST(TestSimple) { SOCKET sockets[2]; UNIT_ASSERT(SocketPair(sockets) == 0); @@ -16,8 +16,8 @@ Y_UNIT_TEST_SUITE(TSocketPollerTest) { TSocketPoller poller; poller.WaitRead(sockets[1], (void*)17); - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); for (ui32 i = 0; i < 3; ++i) { char buf[] = {18}; @@ -28,12 +28,12 @@ Y_UNIT_TEST_SUITE(TSocketPollerTest) { UNIT_ASSERT_VALUES_EQUAL(1, recv(sockets[1], buf, 1, 0)); UNIT_ASSERT_VALUES_EQUAL(18, buf[0]); - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); } } - Y_UNIT_TEST(TestSimpleOneShot) { + Y_UNIT_TEST(TestSimpleOneShot) { SOCKET sockets[2]; UNIT_ASSERT(SocketPair(sockets) == 0); @@ -42,8 +42,8 @@ Y_UNIT_TEST_SUITE(TSocketPollerTest) { TSocketPoller poller; - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); for (ui32 i = 0; i < 3; ++i) { poller.WaitReadOneShot(sockets[1], (void*)17); @@ -59,23 +59,23 @@ Y_UNIT_TEST_SUITE(TSocketPollerTest) { UNIT_ASSERT_VALUES_EQUAL(1, recv(sockets[1], buf, 1, 0)); UNIT_ASSERT_VALUES_EQUAL(char(i + 20), buf[0]); - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); buf[0] = i + 21; UNIT_ASSERT_VALUES_EQUAL(1, send(sockets[0], buf, 1, 0)); // this fails if socket is not oneshot - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); - UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); + UNIT_ASSERT_VALUES_EQUAL(nullptr, poller.WaitT(TDuration::Zero())); UNIT_ASSERT_VALUES_EQUAL(1, recv(sockets[1], buf, 1, 0)); UNIT_ASSERT_VALUES_EQUAL(char(i + 21), buf[0]); } } - Y_UNIT_TEST(TestItIsSafeToUnregisterUnregisteredDescriptor) { + Y_UNIT_TEST(TestItIsSafeToUnregisterUnregisteredDescriptor) { SOCKET sockets[2]; UNIT_ASSERT(SocketPair(sockets) == 0); @@ -87,7 +87,7 @@ Y_UNIT_TEST_SUITE(TSocketPollerTest) { poller.Unwait(s1); } - Y_UNIT_TEST(TestItIsSafeToReregisterDescriptor) { + Y_UNIT_TEST(TestItIsSafeToReregisterDescriptor) { SOCKET sockets[2]; UNIT_ASSERT(SocketPair(sockets) == 0); @@ -96,9 +96,9 @@ Y_UNIT_TEST_SUITE(TSocketPollerTest) { TSocketPoller poller; - poller.WaitRead(s1, nullptr); - poller.WaitRead(s1, nullptr); - poller.WaitWrite(s1, nullptr); + poller.WaitRead(s1, nullptr); + poller.WaitRead(s1, nullptr); + poller.WaitWrite(s1, nullptr); } Y_UNIT_TEST(TestSimpleEdgeTriggered) { |