diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-09-14 15:19:43 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-09-14 15:19:43 +0200 |
commit | 211d16d7c51033a55285f91abde16e1b200d9908 (patch) | |
tree | 1f36f2e15271aa0b4acb7aac798fe694a796fe9e /cpp/test/Ice/acm/AllTests.cpp | |
parent | Extra fixes for PHP5 ZTS builds (diff) | |
download | ice-211d16d7c51033a55285f91abde16e1b200d9908.tar.bz2 ice-211d16d7c51033a55285f91abde16e1b200d9908.tar.xz ice-211d16d7c51033a55285f91abde16e1b200d9908.zip |
Fixed Ice/acm test build failure with C++11
Diffstat (limited to 'cpp/test/Ice/acm/AllTests.cpp')
-rw-r--r-- | cpp/test/Ice/acm/AllTests.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cpp/test/Ice/acm/AllTests.cpp b/cpp/test/Ice/acm/AllTests.cpp index c2ea822e27f..a4294e0f035 100644 --- a/cpp/test/Ice/acm/AllTests.cpp +++ b/cpp/test/Ice/acm/AllTests.cpp @@ -565,6 +565,7 @@ class SetACMTest : public TestCase { public: +#ifndef ICE_CPP11_MAPPING class CloseCallback : public Ice::CloseCallback, private IceUtil::Monitor<IceUtil::Mutex> { public: @@ -606,6 +607,7 @@ public: { } }; +#endif SetACMTest(const RemoteCommunicatorPrxPtr& com) : TestCase("setACM/getACM", com) { @@ -639,6 +641,34 @@ public: proxy->startHeartbeatCount(); proxy->waitForHeartbeatCount(2); +#ifdef ICE_CPP11_MAPPING + auto p1 = promise<void>(); + con->setCloseCallback([&p1](shared_ptr<Ice::Connection>) + { + p1.set_value(); + }); + + con->close(Ice::ConnectionClose::Gracefully); + p1.get_future().wait(); + + try + { + con->throwException(); + test(false); + } + catch(const Ice::ConnectionManuallyClosedException&) + { + } + + auto p2 = promise<void>(); + con->setCloseCallback([&p2](shared_ptr<Ice::Connection>) + { + p2.set_value(); + }); + p2.get_future().wait(); + + con->setHeartbeatCallback([](shared_ptr<Ice::Connection>) {}); +#else CloseCallbackPtr callback = new CloseCallback(); con->setCloseCallback(callback); @@ -659,6 +689,7 @@ public: callback2->waitCallback(); con->setHeartbeatCallback(new HeartbeatCallback()); +#endif } }; |