| 54 | }; |
| 55 | |
| 56 | class SocketServerTest : public Test { |
| 57 | |
| 58 | protected: |
| 59 | StrictMock<MockProtocolHandler> protocolHandler; |
| 60 | std::future<void> serverThread{}; |
| 61 | |
| 62 | void SetUp() override { |
| 63 | SocketServer* server = createListeningServer(); |
| 64 | serverThread = std::async(std::launch::async, &SocketServer::acceptOnce, server); |
| 65 | } |
| 66 | |
| 67 | void TearDown() override { |
| 68 | serverThread.wait_for(THREAD_TEST_TIMEOUT); |
| 69 | destroyListeningServer(); |
| 70 | } |
| 71 | |
| 72 | virtual SocketServer* createListeningServer() = 0; |
| 73 | virtual void destroyListeningServer() = 0; |
| 74 | }; |
| 75 | |
| 76 | class TCPSocketServerTest : public SocketServerTest { |
| 77 | protected: |
nothing calls this directly
no outgoing calls
no test coverage detected