| 165 | } |
| 166 | |
| 167 | void 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 | |
| 186 | class TPollTest: public TTestBase { |
| 187 | UNIT_TEST_SUITE(TPollTest); |
nothing calls this directly
no test coverage detected