| 20 | |
| 21 | namespace { |
| 22 | std::unique_ptr<HttpServer> performHttpRequest(SocketCore& server, |
| 23 | std::string request) |
| 24 | { |
| 25 | auto endpoint = server.getAddrInfo(); |
| 26 | |
| 27 | SocketCore client; |
| 28 | client.establishConnection("localhost", endpoint.port); |
| 29 | while (!client.isWritable(0)) { |
| 30 | } |
| 31 | |
| 32 | auto inbound = server.acceptConnection(); |
| 33 | inbound->setBlockingMode(); |
| 34 | auto rv = make_unique<HttpServer>(inbound); |
| 35 | |
| 36 | client.writeData(request); |
| 37 | while (!rv->receiveRequest()) { |
| 38 | } |
| 39 | return rv; |
| 40 | } |
| 41 | } // namespace |
| 42 | |
| 43 | void HttpServerTest::testHttpBasicAuth() |
no test coverage detected