MCPcopy Create free account
hub / github.com/catboost/catboost / TestClose

Method TestClose

util/network/socket_ut.cpp:167–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void TSockTest::TestClose() {
168 SOCKET socks[2];
169
170 UNIT_ASSERT_EQUAL(SocketPair(socks), 0);
171 TSocket receiver(socks[1]);
172
173 UNIT_ASSERT_EQUAL(static_cast<SOCKET>(receiver), socks[1]);
174
175#if defined _linux_
176 UNIT_ASSERT_GE(fcntl(socks[1], F_GETFD), 0);
177 receiver.Close();
178 UNIT_ASSERT_EQUAL(fcntl(socks[1], F_GETFD), -1);
179#else
180 receiver.Close();
181#endif
182
183 UNIT_ASSERT_EQUAL(static_cast<SOCKET>(receiver), INVALID_SOCKET);
184}
185
186class TPollTest: public TTestBase {
187 UNIT_TEST_SUITE(TPollTest);

Callers

nothing calls this directly

Calls 2

SocketPairFunction · 0.70
CloseMethod · 0.45

Tested by

no test coverage detected