summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/slicing/exceptions/Server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/slicing/exceptions/Server.cpp')
-rw-r--r--cpp/test/Ice/slicing/exceptions/Server.cpp30
1 files changed, 5 insertions, 25 deletions
diff --git a/cpp/test/Ice/slicing/exceptions/Server.cpp b/cpp/test/Ice/slicing/exceptions/Server.cpp
index c5fa1076a33..2cd8dba2995 100644
--- a/cpp/test/Ice/slicing/exceptions/Server.cpp
+++ b/cpp/test/Ice/slicing/exceptions/Server.cpp
@@ -20,10 +20,9 @@ run(int, char**, const Ice::CommunicatorPtr& communicator)
{
Ice::PropertiesPtr properties = communicator->getProperties();
properties->setProperty("Ice.Warn.Dispatch", "0");
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000");
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + " -t 2000");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
- Ice::ObjectPtr object = new TestI();
- adapter->add(object, communicator->stringToIdentity("Test"));
+ adapter->add(ICE_MAKE_SHARED(TestI), communicator->stringToIdentity("Test"));
adapter->activate();
TEST_READY
communicator->waitForShutdown();
@@ -36,33 +35,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;
- }
-
- if(communicator)
- {
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
+ return EXIT_FAILURE;
}
-
- return status;
}