From: James Turner Date: Sun, 9 Jun 2013 22:45:43 +0000 (+0100) Subject: Fix HTTP tests build. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5bd9228b4a9cce6d4a836b5ebcafb6c20d1c6138;p=simgear.git Fix HTTP tests build. --- diff --git a/simgear/io/test_HTTP.cxx b/simgear/io/test_HTTP.cxx index b9207c7a..e4c5a7b6 100644 --- a/simgear/io/test_HTTP.cxx +++ b/simgear/io/test_HTTP.cxx @@ -405,12 +405,15 @@ public: class TestServer : public NetChannel { + simgear::NetChannelPoller _poller; public: TestServer() { open(); bind(NULL, 2000); // localhost, any port listen(5); + + _poller.addChannel(this); } virtual ~TestServer() @@ -426,14 +429,25 @@ public: //cout << "did accept from " << addr.getHost() << ":" << addr.getPort() << endl; TestServerChannel* chan = new TestServerChannel(); chan->setHandle(handle); + + _poller.addChannel(chan); + } + + void poll() + { + _poller.poll(); } }; +TestServer testServer; + void waitForComplete(HTTP::Client* cl, TestRequest* tr) { SGTimeStamp start(SGTimeStamp::now()); while (start.elapsedMSec() < 1000) { cl->update(); + testServer.poll(); + if (tr->complete) { return; } @@ -448,6 +462,8 @@ void waitForFailed(HTTP::Client* cl, TestRequest* tr) SGTimeStamp start(SGTimeStamp::now()); while (start.elapsedMSec() < 1000) { cl->update(); + testServer.poll(); + if (tr->failed) { return; } @@ -459,7 +475,6 @@ void waitForFailed(HTTP::Client* cl, TestRequest* tr) int main(int argc, char* argv[]) { - TestServer s; HTTP::Client cl;