diff options
author | Joe George <joe@zeroc.com> | 2021-02-03 11:16:06 -0500 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2021-02-03 11:42:30 -0500 |
commit | 48f9b28634908c43a23c30e219a9abfb038c1539 (patch) | |
tree | 81420c7142bb57902ad96de1d057b5259c29a287 /cpp/test/IceGrid/activation/Server.cpp | |
parent | IceGrid and IceStorm fixes (diff) | |
download | ice-48f9b28634908c43a23c30e219a9abfb038c1539.tar.bz2 ice-48f9b28634908c43a23c30e219a9abfb038c1539.tar.xz ice-48f9b28634908c43a23c30e219a9abfb038c1539.zip |
Additional C++11 fixes
Diffstat (limited to 'cpp/test/IceGrid/activation/Server.cpp')
-rw-r--r-- | cpp/test/IceGrid/activation/Server.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/cpp/test/IceGrid/activation/Server.cpp b/cpp/test/IceGrid/activation/Server.cpp index 2b683cd5176..e0cc2928d4b 100644 --- a/cpp/test/IceGrid/activation/Server.cpp +++ b/cpp/test/IceGrid/activation/Server.cpp @@ -3,20 +3,19 @@ // #include <Ice/Ice.h> -#include <IceUtil/Thread.h> #include <TestI.h> #include <TestHelper.h> using namespace std; -class Server : public Test::TestHelper +class Server final : public Test::TestHelper { public: - void run(int, char**); + void run(int, char**) override; }; -class TestActivationFailure : public std::runtime_error +class TestActivationFailure final : public std::runtime_error { public: @@ -29,21 +28,21 @@ public: void Server::run(int argc, char** argv) { - Ice::PropertiesPtr properties = createTestProperties(argc, argv); + auto properties = createTestProperties(argc, argv); if(properties->getPropertyAsInt("FailOnStartup") > 0) { throw TestActivationFailure("FailOnStartup"); } Ice::CommunicatorHolder communicator = initialize(argc, argv, properties); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); - TestIPtr testI = ICE_MAKE_SHARED(TestI); + auto adapter = communicator->createObjectAdapter("TestAdapter"); + auto testI = make_shared<TestI>(); adapter->add(testI, Ice::stringToIdentity(properties->getProperty("Ice.Admin.ServerId"))); int delay = properties->getPropertyAsInt("ActivationDelay"); if(delay > 0) { - IceUtil::ThreadControl::sleep(IceUtil::Time::seconds(delay)); + this_thread::sleep_for(chrono::seconds(delay)); } try @@ -58,7 +57,7 @@ Server::run(int argc, char** argv) delay = properties->getPropertyAsInt("DeactivationDelay"); if(delay > 0) { - IceUtil::ThreadControl::sleep(IceUtil::Time::seconds(delay)); + this_thread::sleep_for(chrono::seconds(delay)); } if(testI->isFailed()) |