From 5bd9228b4a9cce6d4a836b5ebcafb6c20d1c6138 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 9 Jun 2013 23:45:43 +0100 Subject: [PATCH] Fix HTTP tests build. --- simgear/io/test_HTTP.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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; -- 2.39.5