| 18 | BOOST_FIXTURE_TEST_SUITE(sock_tests, BasicTestingSetup) |
| 19 | |
| 20 | static bool SocketIsClosed(const SOCKET& s) |
| 21 | { |
| 22 | // Notice that if another thread is running and creates its own socket after `s` has been |
| 23 | // closed, it may be assigned the same file descriptor number. In this case, our test will |
| 24 | // wrongly pretend that the socket is not closed. |
| 25 | int type; |
| 26 | socklen_t len = sizeof(type); |
| 27 | return getsockopt(s, SOL_SOCKET, SO_TYPE, (sockopt_arg_type)&type, &len) == SOCKET_ERROR; |
| 28 | } |
| 29 | |
| 30 | static SOCKET CreateSocket() |
| 31 | { |
no outgoing calls
no test coverage detected