diff options
Diffstat (limited to 'cpp/test/Ice/binding/Server.cpp')
-rw-r--r-- | cpp/test/Ice/binding/Server.cpp | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/cpp/test/Ice/binding/Server.cpp b/cpp/test/Ice/binding/Server.cpp index cd81429d1ff..6e182cf26e4 100644 --- a/cpp/test/Ice/binding/Server.cpp +++ b/cpp/test/Ice/binding/Server.cpp @@ -18,10 +18,10 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::Identity id = communicator->stringToIdentity("communicator"); - adapter->add(new RemoteCommunicatorI(), id); + adapter->add(ICE_MAKE_SHARED(RemoteCommunicatorI), id); adapter->activate(); TEST_READY @@ -39,32 +39,14 @@ main(int argc, char* argv[]) #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); #endif - int status; - Ice::CommunicatorPtr communicator; - try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); + return run(argc, argv, ich.communicator()); } catch(const Ice::Exception& ex) { cerr << ex << endl; - status = EXIT_FAILURE; + return EXIT_FAILURE; } - - if(communicator) - { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } - } - - return status; } |