diff options
Diffstat (limited to 'cpp/test/Ice/operations/Client.cpp')
-rw-r--r-- | cpp/test/Ice/operations/Client.cpp | 58 |
1 files changed, 25 insertions, 33 deletions
diff --git a/cpp/test/Ice/operations/Client.cpp b/cpp/test/Ice/operations/Client.cpp index 9b9af428754..73b19851fb0 100644 --- a/cpp/test/Ice/operations/Client.cpp +++ b/cpp/test/Ice/operations/Client.cpp @@ -16,30 +16,34 @@ DEFINE_TEST("client") using namespace std; int -run(int, char**, const Ice::CommunicatorPtr& communicator, const Ice::InitializationData&) +run(int, char**, const Ice::CommunicatorPtr& communicator, bool remote) { - Test::MyClassPrx allTests(const Ice::CommunicatorPtr&); - Test::MyClassPrx myClass = allTests(communicator); + Test::MyClassPrxPtr allTests(const Ice::CommunicatorPtr&); + Test::MyClassPrxPtr myClass = allTests(communicator); #ifndef ICE_OS_WINRT - cout << "testing server shutdown... " << flush; myClass->shutdown(); - try - { - myClass->opVoid(); - test(false); - } - catch(const Ice::LocalException&) + if(!remote) { - cout << "ok" << endl; + cout << "testing server shutdown... " << flush; + try + { + myClass->opVoid(); + test(false); + } + catch(const Ice::LocalException&) + { + cout << "ok" << endl; + } } #else // // When using SSL the run.py script starts a new server after shutdown - // and the call to opVoid will success. + // and the call to opVoid will succeed. // myClass->shutdown(); #endif + return EXIT_SUCCESS; } @@ -48,11 +52,11 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif - int status; - Ice::CommunicatorPtr communicator; - try { // @@ -66,27 +70,15 @@ main(int argc, char* argv[]) initData.properties->setProperty("Ice.BatchAutoFlushSize", "100"); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator, initData); + Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); + RemoteConfig rc("Ice/operations", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator(), rc.isRemote()); + rc.finished(status); + return status; } 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; } |