diff options
Diffstat (limited to 'cpp/test/Slice/structure/Client.cpp')
-rw-r--r-- | cpp/test/Slice/structure/Client.cpp | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/cpp/test/Slice/structure/Client.cpp b/cpp/test/Slice/structure/Client.cpp index 9d0f3afd040..ff4afe091b0 100644 --- a/cpp/test/Slice/structure/Client.cpp +++ b/cpp/test/Slice/structure/Client.cpp @@ -38,10 +38,20 @@ allTests(const Ice::CommunicatorPtr& communicator) def_s2.il.push_back(2); def_s2.il.push_back(3); def_s2.sd["abc"] = "def"; +#ifdef ICE_CPP11_MAPPING + def_s2.s = {"name"}; +#else def_s2.s = new S1("name"); - def_s2.cls = new C(5); +#endif + def_s2.cls = ICE_MAKE_SHARED(C, 5); def_s2.prx = communicator->stringToProxy("test"); +#ifndef ICE_CPP11_MAPPING + // + // cpp:comparable required by tests bellow is only + // supported with C++98 mapping. + // + // // Change one primitive member at a time. // @@ -248,7 +258,7 @@ allTests(const Ice::CommunicatorPtr& communicator) v2.prx = 0; test(v1 != v2); } - +#endif cout << "ok" << endl; } @@ -263,34 +273,14 @@ run(const Ice::CommunicatorPtr& communicator) int main(int argc, char* argv[]) { - int status; - Ice::CommunicatorPtr communicator; - try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - communicator = Ice::initialize(argc, argv, initData); - status = run(communicator); + Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); + return run(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; } |