diff options
Diffstat (limited to 'cpp/test/Ice')
110 files changed, 7415 insertions, 7415 deletions
diff --git a/cpp/test/Ice/adapterDeactivation/AllTests.cpp b/cpp/test/Ice/adapterDeactivation/AllTests.cpp index e449ad33f54..4b39523946a 100644 --- a/cpp/test/Ice/adapterDeactivation/AllTests.cpp +++ b/cpp/test/Ice/adapterDeactivation/AllTests.cpp @@ -31,23 +31,23 @@ allTests(const CommunicatorPtr& communicator) { cout << "creating/destroying/recreating object adapter... " << flush; - ObjectAdapterPtr adapter = - communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9999"); - try - { - communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9998"); - test(false); - } - catch(const AlreadyRegisteredException&) - { - } - adapter->destroy(); + ObjectAdapterPtr adapter = + communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9999"); + try + { + communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9998"); + test(false); + } + catch(const AlreadyRegisteredException&) + { + } + adapter->destroy(); - // - // Use a different port than the first adapter to avoid an "address already in use" error. - // - adapter = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9998"); - adapter->destroy(); + // + // Use a different port than the first adapter to avoid an "address already in use" error. + // + adapter = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9998"); + adapter->destroy(); cout << "ok" << endl; } @@ -62,12 +62,12 @@ allTests(const CommunicatorPtr& communicator) cout << "testing whether server is gone... " << flush; try { - obj->ice_ping(); - test(false); + obj->ice_ping(); + test(false); } catch(const LocalException&) { - cout << "ok" << endl; + cout << "ok" << endl; } return obj; diff --git a/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp b/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp index 67e361ab6b5..2347ebac86e 100644 --- a/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp +++ b/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp @@ -40,7 +40,7 @@ ServantLocatorI::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie void ServantLocatorI::finished(const Ice::Current& current, const Ice::ObjectPtr& servant, - const Ice::LocalObjectPtr& cookie) + const Ice::LocalObjectPtr& cookie) { test(!_deactivated); diff --git a/cpp/test/Ice/adapterDeactivation/TestI.cpp b/cpp/test/Ice/adapterDeactivation/TestI.cpp index f43409c46f3..18bd51cb0ae 100644 --- a/cpp/test/Ice/adapterDeactivation/TestI.cpp +++ b/cpp/test/Ice/adapterDeactivation/TestI.cpp @@ -20,7 +20,7 @@ TestI::transient(const Current& current) CommunicatorPtr communicator = current.adapter->getCommunicator(); ObjectAdapterPtr adapter = - communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9999"); + communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9999"); adapter->activate(); adapter->destroy(); } diff --git a/cpp/test/Ice/binding/AllTests.cpp b/cpp/test/Ice/binding/AllTests.cpp index 15502bfcfaf..5503d099c78 100644 --- a/cpp/test/Ice/binding/AllTests.cpp +++ b/cpp/test/Ice/binding/AllTests.cpp @@ -33,27 +33,27 @@ public: virtual void ice_response(const string& name) { - Lock sync(*this); - assert(!name.empty()); - _name = name; - notify(); + Lock sync(*this); + assert(!name.empty()); + _name = name; + notify(); } virtual void ice_exception(const Ice::Exception&) { - test(false); + test(false); } virtual string getResult() { - Lock sync(*this); - while(_name.empty()) - { - wait(); - } - return _name; + Lock sync(*this); + while(_name.empty()) + { + wait(); + } + return _name; } private: @@ -77,9 +77,9 @@ createTestIntfPrx(vector<RemoteObjectAdapterPrx>& adapters) TestIntfPrx test; for(vector<RemoteObjectAdapterPrx>::const_iterator p = adapters.begin(); p != adapters.end(); ++p) { - test = (*p)->getTestIntf(); - Ice::EndpointSeq edpts = test->ice_getEndpoints(); - endpoints.insert(endpoints.end(), edpts.begin(), edpts.end()); + test = (*p)->getTestIntf(); + Ice::EndpointSeq edpts = test->ice_getEndpoints(); + endpoints.insert(endpoints.end(), edpts.begin(), edpts.end()); } return TestIntfPrx::uncheckedCast(test->ice_endpoints(endpoints)); } @@ -89,7 +89,7 @@ deactivate(const RemoteCommunicatorPrx& com, vector<RemoteObjectAdapterPrx>& ada { for(vector<RemoteObjectAdapterPrx>::const_iterator p = adapters.begin(); p != adapters.end(); ++p) { - com->deactivateObjectAdapter(*p); + com->deactivateObjectAdapter(*p); } } @@ -103,600 +103,600 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing binding with single endpoint... " << flush; { - RemoteObjectAdapterPrx adapter = com->createObjectAdapter("Adapter", "default"); - - TestIntfPrx test1 = adapter->getTestIntf(); - TestIntfPrx test2 = adapter->getTestIntf(); - test(test1->ice_getConnection() == test2->ice_getConnection()); - - test1->ice_ping(); - test2->ice_ping(); - - com->deactivateObjectAdapter(adapter); - - TestIntfPrx test3 = TestIntfPrx::uncheckedCast(test1); - test(test3->ice_getConnection() == test1->ice_getConnection()); - test(test3->ice_getConnection() == test2->ice_getConnection()); - - try - { - test3->ice_ping(); - test(false); - } - catch(const Ice::ConnectionRefusedException&) - { - } + RemoteObjectAdapterPrx adapter = com->createObjectAdapter("Adapter", "default"); + + TestIntfPrx test1 = adapter->getTestIntf(); + TestIntfPrx test2 = adapter->getTestIntf(); + test(test1->ice_getConnection() == test2->ice_getConnection()); + + test1->ice_ping(); + test2->ice_ping(); + + com->deactivateObjectAdapter(adapter); + + TestIntfPrx test3 = TestIntfPrx::uncheckedCast(test1); + test(test3->ice_getConnection() == test1->ice_getConnection()); + test(test3->ice_getConnection() == test2->ice_getConnection()); + + try + { + test3->ice_ping(); + test(false); + } + catch(const Ice::ConnectionRefusedException&) + { + } } cout << "ok" << endl; cout << "testing binding with multiple endpoints... " << flush; { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("Adapter11", "default")); - adapters.push_back(com->createObjectAdapter("Adapter12", "default")); - adapters.push_back(com->createObjectAdapter("Adapter13", "default")); - - // - // Ensure that when a connection is opened it's reused for new - // proxies and that all endpoints are eventually tried. - // - set<string> names; - names.insert("Adapter11"); - names.insert("Adapter12"); - names.insert("Adapter13"); - while(!names.empty()) - { - vector<RemoteObjectAdapterPrx> adpts = adapters; - - TestIntfPrx test1 = createTestIntfPrx(adpts); - random_shuffle(adpts.begin(), adpts.end(), rng); - TestIntfPrx test2 = createTestIntfPrx(adpts); - random_shuffle(adpts.begin(), adpts.end(), rng); - TestIntfPrx test3 = createTestIntfPrx(adpts); - - test(test1->ice_getConnection() == test2->ice_getConnection()); - test(test2->ice_getConnection() == test3->ice_getConnection()); - - names.erase(test1->getAdapterName()); - test1->ice_getConnection()->close(false); - } - - // - // Ensure that the proxy correctly caches the connection (we - // always send the request over the same connection.) - // - { - for(vector<RemoteObjectAdapterPrx>::const_iterator p = adapters.begin(); p != adapters.end(); ++p) - { - (*p)->getTestIntf()->ice_ping(); - } - - TestIntfPrx test = createTestIntfPrx(adapters); - string name = test->getAdapterName(); - const int nRetry = 10; - int i; - for(i = 0; i < nRetry && test->getAdapterName() == name; i++); - test(i == nRetry); - - for(vector<RemoteObjectAdapterPrx>::const_iterator q = adapters.begin(); q != adapters.end(); ++q) - { - (*q)->getTestIntf()->ice_getConnection()->close(false); - } - } - - // - // Deactivate an adapter and ensure that we can still - // establish the connection to the remaining adapters. - // - com->deactivateObjectAdapter(adapters[0]); - names.insert("Adapter12"); - names.insert("Adapter13"); - while(!names.empty()) - { - vector<RemoteObjectAdapterPrx> adpts = adapters; - - TestIntfPrx test1 = createTestIntfPrx(adpts); - random_shuffle(adpts.begin(), adpts.end(), rng); - TestIntfPrx test2 = createTestIntfPrx(adpts); - random_shuffle(adpts.begin(), adpts.end(), rng); - TestIntfPrx test3 = createTestIntfPrx(adpts); - - test(test1->ice_getConnection() == test2->ice_getConnection()); - test(test2->ice_getConnection() == test3->ice_getConnection()); - - names.erase(test1->getAdapterName()); - test1->ice_getConnection()->close(false); - } - - // - // Deactivate an adapter and ensure that we can still - // establish the connection to the remaining adapter. - // - com->deactivateObjectAdapter(adapters[2]); - TestIntfPrx test = createTestIntfPrx(adapters); - test(test->getAdapterName() == "Adapter12"); - - deactivate(com, adapters); + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("Adapter11", "default")); + adapters.push_back(com->createObjectAdapter("Adapter12", "default")); + adapters.push_back(com->createObjectAdapter("Adapter13", "default")); + + // + // Ensure that when a connection is opened it's reused for new + // proxies and that all endpoints are eventually tried. + // + set<string> names; + names.insert("Adapter11"); + names.insert("Adapter12"); + names.insert("Adapter13"); + while(!names.empty()) + { + vector<RemoteObjectAdapterPrx> adpts = adapters; + + TestIntfPrx test1 = createTestIntfPrx(adpts); + random_shuffle(adpts.begin(), adpts.end(), rng); + TestIntfPrx test2 = createTestIntfPrx(adpts); + random_shuffle(adpts.begin(), adpts.end(), rng); + TestIntfPrx test3 = createTestIntfPrx(adpts); + + test(test1->ice_getConnection() == test2->ice_getConnection()); + test(test2->ice_getConnection() == test3->ice_getConnection()); + + names.erase(test1->getAdapterName()); + test1->ice_getConnection()->close(false); + } + + // + // Ensure that the proxy correctly caches the connection (we + // always send the request over the same connection.) + // + { + for(vector<RemoteObjectAdapterPrx>::const_iterator p = adapters.begin(); p != adapters.end(); ++p) + { + (*p)->getTestIntf()->ice_ping(); + } + + TestIntfPrx test = createTestIntfPrx(adapters); + string name = test->getAdapterName(); + const int nRetry = 10; + int i; + for(i = 0; i < nRetry && test->getAdapterName() == name; i++); + test(i == nRetry); + + for(vector<RemoteObjectAdapterPrx>::const_iterator q = adapters.begin(); q != adapters.end(); ++q) + { + (*q)->getTestIntf()->ice_getConnection()->close(false); + } + } + + // + // Deactivate an adapter and ensure that we can still + // establish the connection to the remaining adapters. + // + com->deactivateObjectAdapter(adapters[0]); + names.insert("Adapter12"); + names.insert("Adapter13"); + while(!names.empty()) + { + vector<RemoteObjectAdapterPrx> adpts = adapters; + + TestIntfPrx test1 = createTestIntfPrx(adpts); + random_shuffle(adpts.begin(), adpts.end(), rng); + TestIntfPrx test2 = createTestIntfPrx(adpts); + random_shuffle(adpts.begin(), adpts.end(), rng); + TestIntfPrx test3 = createTestIntfPrx(adpts); + + test(test1->ice_getConnection() == test2->ice_getConnection()); + test(test2->ice_getConnection() == test3->ice_getConnection()); + + names.erase(test1->getAdapterName()); + test1->ice_getConnection()->close(false); + } + + // + // Deactivate an adapter and ensure that we can still + // establish the connection to the remaining adapter. + // + com->deactivateObjectAdapter(adapters[2]); + TestIntfPrx test = createTestIntfPrx(adapters); + test(test->getAdapterName() == "Adapter12"); + + deactivate(com, adapters); } cout << "ok" << endl; cout << "testing binding with multiple endpoints and AMI... " << flush; { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("AdapterAMI11", "default")); - adapters.push_back(com->createObjectAdapter("AdapterAMI12", "default")); - adapters.push_back(com->createObjectAdapter("AdapterAMI13", "default")); - - // - // Ensure that when a connection is opened it's reused for new - // proxies and that all endpoints are eventually tried. - // - set<string> names; - names.insert("AdapterAMI11"); - names.insert("AdapterAMI12"); - names.insert("AdapterAMI13"); - while(!names.empty()) - { - vector<RemoteObjectAdapterPrx> adpts = adapters; - - TestIntfPrx test1 = createTestIntfPrx(adpts); - random_shuffle(adpts.begin(), adpts.end(), rng); - TestIntfPrx test2 = createTestIntfPrx(adpts); - random_shuffle(adpts.begin(), adpts.end(), rng); - TestIntfPrx test3 = createTestIntfPrx(adpts); - - test(test1->ice_getConnection() == test2->ice_getConnection()); - test(test2->ice_getConnection() == test3->ice_getConnection()); - - names.erase(getAdapterNameWithAMI(test1)); - test1->ice_getConnection()->close(false); - } - - // - // Ensure that the proxy correctly caches the connection (we - // always send the request over the same connection.) - // - { - for(vector<RemoteObjectAdapterPrx>::const_iterator p = adapters.begin(); p != adapters.end(); ++p) - { - (*p)->getTestIntf()->ice_ping(); - } - - TestIntfPrx test = createTestIntfPrx(adapters); - string name = getAdapterNameWithAMI(test); - const int nRetry = 10; - int i; - for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == name; i++); - test(i == nRetry); - - for(vector<RemoteObjectAdapterPrx>::const_iterator q = adapters.begin(); q != adapters.end(); ++q) - { - (*q)->getTestIntf()->ice_getConnection()->close(false); - } - } - - // - // Deactivate an adapter and ensure that we can still - // establish the connection to the remaining adapters. - // - com->deactivateObjectAdapter(adapters[0]); - names.insert("AdapterAMI12"); - names.insert("AdapterAMI13"); - while(!names.empty()) - { - vector<RemoteObjectAdapterPrx> adpts = adapters; - - TestIntfPrx test1 = createTestIntfPrx(adpts); - random_shuffle(adpts.begin(), adpts.end(), rng); - TestIntfPrx test2 = createTestIntfPrx(adpts); - random_shuffle(adpts.begin(), adpts.end(), rng); - TestIntfPrx test3 = createTestIntfPrx(adpts); - - test(test1->ice_getConnection() == test2->ice_getConnection()); - test(test2->ice_getConnection() == test3->ice_getConnection()); - - names.erase(test1->getAdapterName()); - test1->ice_getConnection()->close(false); - } - - // - // Deactivate an adapter and ensure that we can still - // establish the connection to the remaining adapter. - // - com->deactivateObjectAdapter(adapters[2]); - TestIntfPrx test = createTestIntfPrx(adapters); - test(test->getAdapterName() == "AdapterAMI12"); - - deactivate(com, adapters); + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("AdapterAMI11", "default")); + adapters.push_back(com->createObjectAdapter("AdapterAMI12", "default")); + adapters.push_back(com->createObjectAdapter("AdapterAMI13", "default")); + + // + // Ensure that when a connection is opened it's reused for new + // proxies and that all endpoints are eventually tried. + // + set<string> names; + names.insert("AdapterAMI11"); + names.insert("AdapterAMI12"); + names.insert("AdapterAMI13"); + while(!names.empty()) + { + vector<RemoteObjectAdapterPrx> adpts = adapters; + + TestIntfPrx test1 = createTestIntfPrx(adpts); + random_shuffle(adpts.begin(), adpts.end(), rng); + TestIntfPrx test2 = createTestIntfPrx(adpts); + random_shuffle(adpts.begin(), adpts.end(), rng); + TestIntfPrx test3 = createTestIntfPrx(adpts); + + test(test1->ice_getConnection() == test2->ice_getConnection()); + test(test2->ice_getConnection() == test3->ice_getConnection()); + + names.erase(getAdapterNameWithAMI(test1)); + test1->ice_getConnection()->close(false); + } + + // + // Ensure that the proxy correctly caches the connection (we + // always send the request over the same connection.) + // + { + for(vector<RemoteObjectAdapterPrx>::const_iterator p = adapters.begin(); p != adapters.end(); ++p) + { + (*p)->getTestIntf()->ice_ping(); + } + + TestIntfPrx test = createTestIntfPrx(adapters); + string name = getAdapterNameWithAMI(test); + const int nRetry = 10; + int i; + for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == name; i++); + test(i == nRetry); + + for(vector<RemoteObjectAdapterPrx>::const_iterator q = adapters.begin(); q != adapters.end(); ++q) + { + (*q)->getTestIntf()->ice_getConnection()->close(false); + } + } + + // + // Deactivate an adapter and ensure that we can still + // establish the connection to the remaining adapters. + // + com->deactivateObjectAdapter(adapters[0]); + names.insert("AdapterAMI12"); + names.insert("AdapterAMI13"); + while(!names.empty()) + { + vector<RemoteObjectAdapterPrx> adpts = adapters; + + TestIntfPrx test1 = createTestIntfPrx(adpts); + random_shuffle(adpts.begin(), adpts.end(), rng); + TestIntfPrx test2 = createTestIntfPrx(adpts); + random_shuffle(adpts.begin(), adpts.end(), rng); + TestIntfPrx test3 = createTestIntfPrx(adpts); + + test(test1->ice_getConnection() == test2->ice_getConnection()); + test(test2->ice_getConnection() == test3->ice_getConnection()); + + names.erase(test1->getAdapterName()); + test1->ice_getConnection()->close(false); + } + + // + // Deactivate an adapter and ensure that we can still + // establish the connection to the remaining adapter. + // + com->deactivateObjectAdapter(adapters[2]); + TestIntfPrx test = createTestIntfPrx(adapters); + test(test->getAdapterName() == "AdapterAMI12"); + + deactivate(com, adapters); } cout << "ok" << endl; cout << "testing random endpoint selection... " << flush; { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("Adapter21", "default")); - adapters.push_back(com->createObjectAdapter("Adapter22", "default")); - adapters.push_back(com->createObjectAdapter("Adapter23", "default")); - - TestIntfPrx test = createTestIntfPrx(adapters); - test(test->ice_getEndpointSelection() == Ice::Random); - - set<string> names; - names.insert("Adapter21"); - names.insert("Adapter22"); - names.insert("Adapter23"); - while(!names.empty()) - { - names.erase(test->getAdapterName()); - test->ice_getConnection()->close(false); - } - - test = TestIntfPrx::uncheckedCast(test->ice_endpointSelection(Ice::Random)); - test(test->ice_getEndpointSelection() == Ice::Random); - - names.insert("Adapter21"); - names.insert("Adapter22"); - names.insert("Adapter23"); - while(!names.empty()) - { - names.erase(test->getAdapterName()); - test->ice_getConnection()->close(false); - } - - deactivate(com, adapters); + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("Adapter21", "default")); + adapters.push_back(com->createObjectAdapter("Adapter22", "default")); + adapters.push_back(com->createObjectAdapter("Adapter23", "default")); + + TestIntfPrx test = createTestIntfPrx(adapters); + test(test->ice_getEndpointSelection() == Ice::Random); + + set<string> names; + names.insert("Adapter21"); + names.insert("Adapter22"); + names.insert("Adapter23"); + while(!names.empty()) + { + names.erase(test->getAdapterName()); + test->ice_getConnection()->close(false); + } + + test = TestIntfPrx::uncheckedCast(test->ice_endpointSelection(Ice::Random)); + test(test->ice_getEndpointSelection() == Ice::Random); + + names.insert("Adapter21"); + names.insert("Adapter22"); + names.insert("Adapter23"); + while(!names.empty()) + { + names.erase(test->getAdapterName()); + test->ice_getConnection()->close(false); + } + + deactivate(com, adapters); } cout << "ok" << endl; cout << "testing ordered endpoint selection... " << flush; { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("Adapter31", "default")); - adapters.push_back(com->createObjectAdapter("Adapter32", "default")); - adapters.push_back(com->createObjectAdapter("Adapter33", "default")); - - TestIntfPrx test = createTestIntfPrx(adapters); - test = TestIntfPrx::uncheckedCast(test->ice_endpointSelection(Ice::Ordered)); - test(test->ice_getEndpointSelection() == Ice::Ordered); - const int nRetry = 5; - int i; - - // - // Ensure that endpoints are tried in order by deactiving the adapters - // one after the other. - // - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter31"; i++); - test(i == nRetry); - com->deactivateObjectAdapter(adapters[0]); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter32"; i++); - test(i == nRetry); - com->deactivateObjectAdapter(adapters[1]); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter33"; i++); - test(i == nRetry); - com->deactivateObjectAdapter(adapters[2]); - - try - { - test->getAdapterName(); - } - catch(const Ice::ConnectionRefusedException&) - { - } - - Ice::EndpointSeq endpoints = test->ice_getEndpoints(); - - adapters.clear(); - - // - // Now, re-activate the adapters with the same endpoints in the opposite - // order. - // - adapters.push_back(com->createObjectAdapter("Adapter36", endpoints[2]->toString())); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter36"; i++); - test(i == nRetry); - test->ice_getConnection()->close(false); - adapters.push_back(com->createObjectAdapter("Adapter35", endpoints[1]->toString())); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter35"; i++); - test(i == nRetry); - test->ice_getConnection()->close(false); - adapters.push_back(com->createObjectAdapter("Adapter34", endpoints[0]->toString())); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter34"; i++); - test(i == nRetry); - - deactivate(com, adapters); + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("Adapter31", "default")); + adapters.push_back(com->createObjectAdapter("Adapter32", "default")); + adapters.push_back(com->createObjectAdapter("Adapter33", "default")); + + TestIntfPrx test = createTestIntfPrx(adapters); + test = TestIntfPrx::uncheckedCast(test->ice_endpointSelection(Ice::Ordered)); + test(test->ice_getEndpointSelection() == Ice::Ordered); + const int nRetry = 5; + int i; + + // + // Ensure that endpoints are tried in order by deactiving the adapters + // one after the other. + // + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter31"; i++); + test(i == nRetry); + com->deactivateObjectAdapter(adapters[0]); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter32"; i++); + test(i == nRetry); + com->deactivateObjectAdapter(adapters[1]); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter33"; i++); + test(i == nRetry); + com->deactivateObjectAdapter(adapters[2]); + + try + { + test->getAdapterName(); + } + catch(const Ice::ConnectionRefusedException&) + { + } + + Ice::EndpointSeq endpoints = test->ice_getEndpoints(); + + adapters.clear(); + + // + // Now, re-activate the adapters with the same endpoints in the opposite + // order. + // + adapters.push_back(com->createObjectAdapter("Adapter36", endpoints[2]->toString())); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter36"; i++); + test(i == nRetry); + test->ice_getConnection()->close(false); + adapters.push_back(com->createObjectAdapter("Adapter35", endpoints[1]->toString())); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter35"; i++); + test(i == nRetry); + test->ice_getConnection()->close(false); + adapters.push_back(com->createObjectAdapter("Adapter34", endpoints[0]->toString())); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter34"; i++); + test(i == nRetry); + + deactivate(com, adapters); } cout << "ok" << endl; cout << "testing per request binding with single endpoint... " << flush; { - RemoteObjectAdapterPrx adapter = com->createObjectAdapter("Adapter41", "default"); - - TestIntfPrx test1 = TestIntfPrx::uncheckedCast(adapter->getTestIntf()->ice_connectionCached(false)); - TestIntfPrx test2 = TestIntfPrx::uncheckedCast(adapter->getTestIntf()->ice_connectionCached(false)); - test(!test1->ice_isConnectionCached()); - test(!test2->ice_isConnectionCached()); - test(test1->ice_getConnection() == test2->ice_getConnection()); - - test1->ice_ping(); - - com->deactivateObjectAdapter(adapter); - - TestIntfPrx test3 = TestIntfPrx::uncheckedCast(test1); - try - { - test(test3->ice_getConnection() == test1->ice_getConnection()); - test(false); - } - catch(const Ice::ConnectionRefusedException&) - { - } + RemoteObjectAdapterPrx adapter = com->createObjectAdapter("Adapter41", "default"); + + TestIntfPrx test1 = TestIntfPrx::uncheckedCast(adapter->getTestIntf()->ice_connectionCached(false)); + TestIntfPrx test2 = TestIntfPrx::uncheckedCast(adapter->getTestIntf()->ice_connectionCached(false)); + test(!test1->ice_isConnectionCached()); + test(!test2->ice_isConnectionCached()); + test(test1->ice_getConnection() == test2->ice_getConnection()); + + test1->ice_ping(); + + com->deactivateObjectAdapter(adapter); + + TestIntfPrx test3 = TestIntfPrx::uncheckedCast(test1); + try + { + test(test3->ice_getConnection() == test1->ice_getConnection()); + test(false); + } + catch(const Ice::ConnectionRefusedException&) + { + } } cout << "ok" << endl; cout << "testing per request binding with multiple endpoints... " << flush; { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("Adapter51", "default")); - adapters.push_back(com->createObjectAdapter("Adapter52", "default")); - adapters.push_back(com->createObjectAdapter("Adapter53", "default")); - - TestIntfPrx test = TestIntfPrx::uncheckedCast(createTestIntfPrx(adapters)->ice_connectionCached(false)); - test(!test->ice_isConnectionCached()); - - set<string> names; - names.insert("Adapter51"); - names.insert("Adapter52"); - names.insert("Adapter53"); - while(!names.empty()) - { - names.erase(test->getAdapterName()); - } - - com->deactivateObjectAdapter(adapters[0]); - - names.insert("Adapter52"); - names.insert("Adapter53"); - while(!names.empty()) - { - names.erase(test->getAdapterName()); - } - - com->deactivateObjectAdapter(adapters[2]); - - - test(test->getAdapterName() == "Adapter52"); - - deactivate(com, adapters); + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("Adapter51", "default")); + adapters.push_back(com->createObjectAdapter("Adapter52", "default")); + adapters.push_back(com->createObjectAdapter("Adapter53", "default")); + + TestIntfPrx test = TestIntfPrx::uncheckedCast(createTestIntfPrx(adapters)->ice_connectionCached(false)); + test(!test->ice_isConnectionCached()); + + set<string> names; + names.insert("Adapter51"); + names.insert("Adapter52"); + names.insert("Adapter53"); + while(!names.empty()) + { + names.erase(test->getAdapterName()); + } + + com->deactivateObjectAdapter(adapters[0]); + + names.insert("Adapter52"); + names.insert("Adapter53"); + while(!names.empty()) + { + names.erase(test->getAdapterName()); + } + + com->deactivateObjectAdapter(adapters[2]); + + + test(test->getAdapterName() == "Adapter52"); + + deactivate(com, adapters); } cout << "ok" << endl; cout << "testing per request binding with multiple endpoints and AMI... " << flush; { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("AdapterAMI51", "default")); - adapters.push_back(com->createObjectAdapter("AdapterAMI52", "default")); - adapters.push_back(com->createObjectAdapter("AdapterAMI53", "default")); - - TestIntfPrx test = TestIntfPrx::uncheckedCast(createTestIntfPrx(adapters)->ice_connectionCached(false)); - test(!test->ice_isConnectionCached()); - - set<string> names; - names.insert("AdapterAMI51"); - names.insert("AdapterAMI52"); - names.insert("AdapterAMI53"); - while(!names.empty()) - { - names.erase(getAdapterNameWithAMI(test)); - } - - com->deactivateObjectAdapter(adapters[0]); - - names.insert("AdapterAMI52"); - names.insert("AdapterAMI53"); - while(!names.empty()) - { - names.erase(getAdapterNameWithAMI(test)); - } - - com->deactivateObjectAdapter(adapters[2]); - - test(test->getAdapterName() == "AdapterAMI52"); - - deactivate(com, adapters); + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("AdapterAMI51", "default")); + adapters.push_back(com->createObjectAdapter("AdapterAMI52", "default")); + adapters.push_back(com->createObjectAdapter("AdapterAMI53", "default")); + + TestIntfPrx test = TestIntfPrx::uncheckedCast(createTestIntfPrx(adapters)->ice_connectionCached(false)); + test(!test->ice_isConnectionCached()); + + set<string> names; + names.insert("AdapterAMI51"); + names.insert("AdapterAMI52"); + names.insert("AdapterAMI53"); + while(!names.empty()) + { + names.erase(getAdapterNameWithAMI(test)); + } + + com->deactivateObjectAdapter(adapters[0]); + + names.insert("AdapterAMI52"); + names.insert("AdapterAMI53"); + while(!names.empty()) + { + names.erase(getAdapterNameWithAMI(test)); + } + + com->deactivateObjectAdapter(adapters[2]); + + test(test->getAdapterName() == "AdapterAMI52"); + + deactivate(com, adapters); } cout << "ok" << endl; cout << "testing per request binding and ordered endpoint selection... " << flush; { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("Adapter61", "default")); - adapters.push_back(com->createObjectAdapter("Adapter62", "default")); - adapters.push_back(com->createObjectAdapter("Adapter63", "default")); - - TestIntfPrx test = createTestIntfPrx(adapters); - test = TestIntfPrx::uncheckedCast(test->ice_endpointSelection(Ice::Ordered)); - test(test->ice_getEndpointSelection() == Ice::Ordered); - test = TestIntfPrx::uncheckedCast(test->ice_connectionCached(false)); - test(!test->ice_isConnectionCached()); - const int nRetry = 5; - int i; - - // - // Ensure that endpoints are tried in order by deactiving the adapters - // one after the other. - // - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter61"; i++); - test(i == nRetry); - com->deactivateObjectAdapter(adapters[0]); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter62"; i++); - test(i == nRetry); - com->deactivateObjectAdapter(adapters[1]); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter63"; i++); - test(i == nRetry); - com->deactivateObjectAdapter(adapters[2]); - - try - { - test->getAdapterName(); - } - catch(const Ice::ConnectionRefusedException&) - { - } - - Ice::EndpointSeq endpoints = test->ice_getEndpoints(); - - adapters.clear(); - - // - // Now, re-activate the adapters with the same endpoints in the opposite - // order. - // - adapters.push_back(com->createObjectAdapter("Adapter66", endpoints[2]->toString())); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter66"; i++); - test(i == nRetry); - adapters.push_back(com->createObjectAdapter("Adapter65", endpoints[1]->toString())); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter65"; i++); - test(i == nRetry); - adapters.push_back(com->createObjectAdapter("Adapter64", endpoints[0]->toString())); - for(i = 0; i < nRetry && test->getAdapterName() == "Adapter64"; i++); - test(i == nRetry); - - deactivate(com, adapters); + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("Adapter61", "default")); + adapters.push_back(com->createObjectAdapter("Adapter62", "default")); + adapters.push_back(com->createObjectAdapter("Adapter63", "default")); + + TestIntfPrx test = createTestIntfPrx(adapters); + test = TestIntfPrx::uncheckedCast(test->ice_endpointSelection(Ice::Ordered)); + test(test->ice_getEndpointSelection() == Ice::Ordered); + test = TestIntfPrx::uncheckedCast(test->ice_connectionCached(false)); + test(!test->ice_isConnectionCached()); + const int nRetry = 5; + int i; + + // + // Ensure that endpoints are tried in order by deactiving the adapters + // one after the other. + // + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter61"; i++); + test(i == nRetry); + com->deactivateObjectAdapter(adapters[0]); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter62"; i++); + test(i == nRetry); + com->deactivateObjectAdapter(adapters[1]); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter63"; i++); + test(i == nRetry); + com->deactivateObjectAdapter(adapters[2]); + + try + { + test->getAdapterName(); + } + catch(const Ice::ConnectionRefusedException&) + { + } + + Ice::EndpointSeq endpoints = test->ice_getEndpoints(); + + adapters.clear(); + + // + // Now, re-activate the adapters with the same endpoints in the opposite + // order. + // + adapters.push_back(com->createObjectAdapter("Adapter66", endpoints[2]->toString())); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter66"; i++); + test(i == nRetry); + adapters.push_back(com->createObjectAdapter("Adapter65", endpoints[1]->toString())); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter65"; i++); + test(i == nRetry); + adapters.push_back(com->createObjectAdapter("Adapter64", endpoints[0]->toString())); + for(i = 0; i < nRetry && test->getAdapterName() == "Adapter64"; i++); + test(i == nRetry); + + deactivate(com, adapters); } cout << "ok" << endl; cout << "testing per request binding and ordered endpoint selection and AMI... " << flush; { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("AdapterAMI61", "default")); - adapters.push_back(com->createObjectAdapter("AdapterAMI62", "default")); - adapters.push_back(com->createObjectAdapter("AdapterAMI63", "default")); - - TestIntfPrx test = createTestIntfPrx(adapters); - test = TestIntfPrx::uncheckedCast(test->ice_endpointSelection(Ice::Ordered)); - test(test->ice_getEndpointSelection() == Ice::Ordered); - test = TestIntfPrx::uncheckedCast(test->ice_connectionCached(false)); - test(!test->ice_isConnectionCached()); - const int nRetry = 5; - int i; - - // - // Ensure that endpoints are tried in order by deactiving the adapters - // one after the other. - // - for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI61"; i++); - test(i == nRetry); - com->deactivateObjectAdapter(adapters[0]); - for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI62"; i++); - test(i == nRetry); - com->deactivateObjectAdapter(adapters[1]); - for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI63"; i++); - test(i == nRetry); - com->deactivateObjectAdapter(adapters[2]); - - try - { - test->getAdapterName(); - } - catch(const Ice::ConnectionRefusedException&) - { - } - - Ice::EndpointSeq endpoints = test->ice_getEndpoints(); - - adapters.clear(); - - // - // Now, re-activate the adapters with the same endpoints in the opposite - // order. - // - adapters.push_back(com->createObjectAdapter("AdapterAMI66", endpoints[2]->toString())); - for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI66"; i++); - test(i == nRetry); - adapters.push_back(com->createObjectAdapter("AdapterAMI65", endpoints[1]->toString())); - for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI65"; i++); - test(i == nRetry); - adapters.push_back(com->createObjectAdapter("AdapterAMI64", endpoints[0]->toString())); - for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI64"; i++); - test(i == nRetry); - - deactivate(com, adapters); + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("AdapterAMI61", "default")); + adapters.push_back(com->createObjectAdapter("AdapterAMI62", "default")); + adapters.push_back(com->createObjectAdapter("AdapterAMI63", "default")); + + TestIntfPrx test = createTestIntfPrx(adapters); + test = TestIntfPrx::uncheckedCast(test->ice_endpointSelection(Ice::Ordered)); + test(test->ice_getEndpointSelection() == Ice::Ordered); + test = TestIntfPrx::uncheckedCast(test->ice_connectionCached(false)); + test(!test->ice_isConnectionCached()); + const int nRetry = 5; + int i; + + // + // Ensure that endpoints are tried in order by deactiving the adapters + // one after the other. + // + for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI61"; i++); + test(i == nRetry); + com->deactivateObjectAdapter(adapters[0]); + for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI62"; i++); + test(i == nRetry); + com->deactivateObjectAdapter(adapters[1]); + for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI63"; i++); + test(i == nRetry); + com->deactivateObjectAdapter(adapters[2]); + + try + { + test->getAdapterName(); + } + catch(const Ice::ConnectionRefusedException&) + { + } + + Ice::EndpointSeq endpoints = test->ice_getEndpoints(); + + adapters.clear(); + + // + // Now, re-activate the adapters with the same endpoints in the opposite + // order. + // + adapters.push_back(com->createObjectAdapter("AdapterAMI66", endpoints[2]->toString())); + for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI66"; i++); + test(i == nRetry); + adapters.push_back(com->createObjectAdapter("AdapterAMI65", endpoints[1]->toString())); + for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI65"; i++); + test(i == nRetry); + adapters.push_back(com->createObjectAdapter("AdapterAMI64", endpoints[0]->toString())); + for(i = 0; i < nRetry && getAdapterNameWithAMI(test) == "AdapterAMI64"; i++); + test(i == nRetry); + + deactivate(com, adapters); } cout << "ok" << endl; cout << "testing endpoint mode filtering... " << flush; { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("Adapter71", "default")); - adapters.push_back(com->createObjectAdapter("Adapter72", "udp")); - - TestIntfPrx test = createTestIntfPrx(adapters); - test(test->getAdapterName() == "Adapter71"); - - TestIntfPrx testUDP = TestIntfPrx::uncheckedCast(test->ice_datagram()); - test(test->ice_getConnection() != testUDP->ice_getConnection()); - try - { - testUDP->getAdapterName(); - } - catch(const Ice::TwowayOnlyException&) - { - } + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("Adapter71", "default")); + adapters.push_back(com->createObjectAdapter("Adapter72", "udp")); + + TestIntfPrx test = createTestIntfPrx(adapters); + test(test->getAdapterName() == "Adapter71"); + + TestIntfPrx testUDP = TestIntfPrx::uncheckedCast(test->ice_datagram()); + test(test->ice_getConnection() != testUDP->ice_getConnection()); + try + { + testUDP->getAdapterName(); + } + catch(const Ice::TwowayOnlyException&) + { + } } cout << "ok" << endl; if(!communicator->getProperties()->getProperty("Ice.Plugin.IceSSL").empty()) { - cout << "testing unsecure vs. secure endpoints... " << flush; - { - vector<RemoteObjectAdapterPrx> adapters; - adapters.push_back(com->createObjectAdapter("Adapter81", "ssl")); - adapters.push_back(com->createObjectAdapter("Adapter82", "tcp")); - - TestIntfPrx test = createTestIntfPrx(adapters); - int i; - for(i = 0; i < 5; i++) - { - test(test->getAdapterName() == "Adapter82"); - test->ice_getConnection()->close(false); - } - - TestIntfPrx testSecure = TestIntfPrx::uncheckedCast(test->ice_secure(true)); - test(testSecure->ice_isSecure()); - testSecure = TestIntfPrx::uncheckedCast(test->ice_secure(false)); - test(!testSecure->ice_isSecure()); - testSecure = TestIntfPrx::uncheckedCast(test->ice_secure(true)); - test(testSecure->ice_isSecure()); - test(test->ice_getConnection() != testSecure->ice_getConnection()); - - com->deactivateObjectAdapter(adapters[1]); - - for(i = 0; i < 5; i++) - { - test(test->getAdapterName() == "Adapter81"); - test->ice_getConnection()->close(false); - } - - com->createObjectAdapter("Adapter83", (test->ice_getEndpoints()[1])->toString()); // Reactive tcp OA. - - for(i = 0; i < 5; i++) - { - test(test->getAdapterName() == "Adapter83"); - test->ice_getConnection()->close(false); - } - - com->deactivateObjectAdapter(adapters[0]); - try - { - testSecure->ice_ping(); - test(false); - } - catch(const Ice::ConnectionRefusedException&) - { - } - - deactivate(com, adapters); - } - cout << "ok" << endl; + cout << "testing unsecure vs. secure endpoints... " << flush; + { + vector<RemoteObjectAdapterPrx> adapters; + adapters.push_back(com->createObjectAdapter("Adapter81", "ssl")); + adapters.push_back(com->createObjectAdapter("Adapter82", "tcp")); + + TestIntfPrx test = createTestIntfPrx(adapters); + int i; + for(i = 0; i < 5; i++) + { + test(test->getAdapterName() == "Adapter82"); + test->ice_getConnection()->close(false); + } + + TestIntfPrx testSecure = TestIntfPrx::uncheckedCast(test->ice_secure(true)); + test(testSecure->ice_isSecure()); + testSecure = TestIntfPrx::uncheckedCast(test->ice_secure(false)); + test(!testSecure->ice_isSecure()); + testSecure = TestIntfPrx::uncheckedCast(test->ice_secure(true)); + test(testSecure->ice_isSecure()); + test(test->ice_getConnection() != testSecure->ice_getConnection()); + + com->deactivateObjectAdapter(adapters[1]); + + for(i = 0; i < 5; i++) + { + test(test->getAdapterName() == "Adapter81"); + test->ice_getConnection()->close(false); + } + + com->createObjectAdapter("Adapter83", (test->ice_getEndpoints()[1])->toString()); // Reactive tcp OA. + + for(i = 0; i < 5; i++) + { + test(test->getAdapterName() == "Adapter83"); + test->ice_getConnection()->close(false); + } + + com->deactivateObjectAdapter(adapters[0]); + try + { + testSecure->ice_ping(); + test(false); + } + catch(const Ice::ConnectionRefusedException&) + { + } + + deactivate(com, adapters); + } + cout << "ok" << endl; } com->shutdown(); diff --git a/cpp/test/Ice/binding/Client.cpp b/cpp/test/Ice/binding/Client.cpp index 0527d790712..a0f1ccc1976 100644 --- a/cpp/test/Ice/binding/Client.cpp +++ b/cpp/test/Ice/binding/Client.cpp @@ -29,26 +29,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/binding/Server.cpp b/cpp/test/Ice/binding/Server.cpp index 99d9b2beafd..ca6e34b3b7d 100644 --- a/cpp/test/Ice/binding/Server.cpp +++ b/cpp/test/Ice/binding/Server.cpp @@ -36,26 +36,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/binding/TestI.cpp b/cpp/test/Ice/binding/TestI.cpp index cbbad4a6e11..8407ebff887 100644 --- a/cpp/test/Ice/binding/TestI.cpp +++ b/cpp/test/Ice/binding/TestI.cpp @@ -41,7 +41,7 @@ RemoteCommunicatorI::shutdown(const Ice::Current& current) RemoteObjectAdapterI::RemoteObjectAdapterI(const Ice::ObjectAdapterPtr& adapter) : _adapter(adapter), _testIntf(TestIntfPrx::uncheckedCast(_adapter->add(new TestI(), - adapter->getCommunicator()->stringToIdentity("test")))) + adapter->getCommunicator()->stringToIdentity("test")))) { _adapter->activate(); } @@ -57,7 +57,7 @@ RemoteObjectAdapterI::deactivate(const Ice::Current&) { try { - _adapter->destroy(); + _adapter->destroy(); } catch(const ObjectAdapterDeactivatedException&) { diff --git a/cpp/test/Ice/binding/TestI.h b/cpp/test/Ice/binding/TestI.h index b17e3585bcc..569f6f24965 100644 --- a/cpp/test/Ice/binding/TestI.h +++ b/cpp/test/Ice/binding/TestI.h @@ -17,7 +17,7 @@ class RemoteCommunicatorI : public Test::RemoteCommunicator public: virtual Test::RemoteObjectAdapterPrx createObjectAdapter(const std::string&, const std::string&, - const Ice::Current&); + const Ice::Current&); virtual void deactivateObjectAdapter(const Test::RemoteObjectAdapterPrx&, const Ice::Current&); virtual void shutdown(const Ice::Current&); }; diff --git a/cpp/test/Ice/checksum/client/Client.cpp b/cpp/test/Ice/checksum/client/Client.cpp index e9d573432c0..792d51c0beb 100644 --- a/cpp/test/Ice/checksum/client/Client.cpp +++ b/cpp/test/Ice/checksum/client/Client.cpp @@ -30,26 +30,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/checksum/server/Server.cpp b/cpp/test/Ice/checksum/server/Server.cpp index 273c04de334..261564c6ca8 100644 --- a/cpp/test/Ice/checksum/server/Server.cpp +++ b/cpp/test/Ice/checksum/server/Server.cpp @@ -32,26 +32,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp index 535fe84ffba..e7e70631422 100644 --- a/cpp/test/Ice/custom/AllTests.cpp +++ b/cpp/test/Ice/custom/AllTests.cpp @@ -69,7 +69,7 @@ public: virtual void ice_response(const Test::BoolSeq& ret, const Test::BoolSeq& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -95,18 +95,18 @@ public: } virtual void ice_response(const pair<const Ice::Byte*, const Ice::Byte*>& ret, - const pair<const Ice::Byte*, const Ice::Byte*>& out) + const pair<const Ice::Byte*, const Ice::Byte*>& out) { test(_in.second - _in.first == out.second - out.first); test(_in.second - _in.first == ret.second - ret.first); - Ice::Byte* b = const_cast<Ice::Byte*>(_in.first); - Ice::Byte* r = const_cast<Ice::Byte*>(ret.first); - Ice::Byte* o = const_cast<Ice::Byte*>(out.first); - while(b != _in.second) - { - test(*r++ == *b); - test(*o++ == *b++); - } + Ice::Byte* b = const_cast<Ice::Byte*>(_in.first); + Ice::Byte* r = const_cast<Ice::Byte*>(ret.first); + Ice::Byte* o = const_cast<Ice::Byte*>(out.first); + while(b != _in.second) + { + test(*r++ == *b); + test(*o++ == *b++); + } called(); } @@ -134,7 +134,7 @@ public: virtual void ice_response(const Test::VariableList& ret, const Test::VariableList& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -162,7 +162,7 @@ public: virtual void ice_response(const Test::BoolSeq& ret, const Test::BoolSeq& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -188,18 +188,18 @@ public: } virtual void ice_response(const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& ret, - const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& out) + const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& out) { test(ice_distance(out.first, out.second) == static_cast<Ice::Int>(_in.size())); test(ice_distance(ret.first, ret.second) == static_cast<Ice::Int>(_in.size())); - Test::ByteList::const_iterator b; - Test::ByteList::const_iterator o = out.first; - Test::ByteList::const_iterator r = ret.first; - for(b = _in.begin(); b != _in.end(); ++b) - { - test(*b == *o++); - test(*b == *r++); - } + Test::ByteList::const_iterator b; + Test::ByteList::const_iterator o = out.first; + Test::ByteList::const_iterator r = ret.first; + for(b = _in.begin(); b != _in.end(); ++b) + { + test(*b == *o++); + test(*b == *r++); + } called(); } @@ -227,7 +227,7 @@ public: virtual void ice_response(const Test::VariableList& ret, const Test::VariableList& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -255,7 +255,7 @@ public: virtual void ice_response(const Test::BoolSeq& ret, const Test::BoolSeq& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -283,7 +283,7 @@ public: virtual void ice_response(const Test::ByteList& ret, const Test::ByteList& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -311,7 +311,7 @@ public: virtual void ice_response(const Test::VariableList& ret, const Test::VariableList& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -339,7 +339,7 @@ public: virtual void ice_response(const deque<bool>& ret, const deque<bool>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -367,7 +367,7 @@ public: virtual void ice_response(const list<bool>& ret, const list<bool>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -395,7 +395,7 @@ public: virtual void ice_response(const deque<Ice::Byte>& ret, const deque<Ice::Byte>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -423,7 +423,7 @@ public: virtual void ice_response(const list<Ice::Byte>& ret, const list<Ice::Byte>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -451,7 +451,7 @@ public: virtual void ice_response(const MyByteSeq& ret, const MyByteSeq& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -479,7 +479,7 @@ public: virtual void ice_response(const deque<string>& ret, const deque<string>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -507,7 +507,7 @@ public: virtual void ice_response(const list<string>& ret, const list<string>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -535,7 +535,7 @@ public: virtual void ice_response(const deque<Test::Fixed>& ret, const deque<Test::Fixed>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -563,7 +563,7 @@ public: virtual void ice_response(const list<Test::Fixed>& ret, const list<Test::Fixed>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -591,7 +591,7 @@ public: virtual void ice_response(const deque<Test::Variable>& ret, const deque<Test::Variable>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -619,7 +619,7 @@ public: virtual void ice_response(const list<Test::Variable>& ret, const list<Test::Variable>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -647,7 +647,7 @@ public: virtual void ice_response(const deque<Test::StringStringDict>& ret, const deque<Test::StringStringDict>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -675,7 +675,7 @@ public: virtual void ice_response(const list<Test::StringStringDict>& ret, const list<Test::StringStringDict>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -703,7 +703,7 @@ public: virtual void ice_response(const deque<Test::E>& ret, const deque<Test::E>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -731,7 +731,7 @@ public: virtual void ice_response(const list<Test::E>& ret, const list<Test::E>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -759,7 +759,7 @@ public: virtual void ice_response(const deque<Test::CPrx>& ret, const deque<Test::CPrx>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -787,7 +787,7 @@ public: virtual void ice_response(const list<Test::CPrx>& ret, const list<Test::CPrx>& out) { test(out == _in); - test(ret == _in); + test(ret == _in); called(); } @@ -814,13 +814,13 @@ public: virtual void ice_response(const deque<Test::CPtr>& ret, const deque<Test::CPtr>& out) { - test(out.size() == _in.size()); - test(ret.size() == _in.size()); - for(unsigned int i = 1; i < _in.size(); ++i) - { - test(out[i] == out[0]); - test(ret[i] == out[i]); - } + test(out.size() == _in.size()); + test(ret.size() == _in.size()); + for(unsigned int i = 1; i < _in.size(); ++i) + { + test(out[i] == out[0]); + test(ret[i] == out[i]); + } called(); } @@ -847,14 +847,14 @@ public: virtual void ice_response(const list<Test::CPtr>& ret, const list<Test::CPtr>& out) { - test(out.size() == _in.size()); - test(ret.size() == _in.size()); - list<Test::CPtr>::const_iterator p1; - list<Test::CPtr>::const_iterator p2; - for(p1 = out.begin(), p2 = ret.begin(); p1 != out.end(); ++p1, ++p2) - { - test(*p1 == *p2); - } + test(out.size() == _in.size()); + test(ret.size() == _in.size()); + list<Test::CPtr>::const_iterator p1; + list<Test::CPtr>::const_iterator p2; + for(p1 = out.begin(), p2 = ret.begin(); p1 != out.end(); ++p1, ++p2) + { + test(*p1 == *p2); + } called(); } @@ -875,17 +875,17 @@ class AMI_TestIntf_opClassStructI : public Test::AMI_TestIntf_opClassStruct, pub public: AMI_TestIntf_opClassStructI(const Test::ClassStructPtr& cs, const Test::ClassStructSeq& csseq1) : - _cs(cs), _csseq1(csseq1) + _cs(cs), _csseq1(csseq1) { } virtual void ice_response(const ::Test::ClassStructPtr& ret, - const ::Test::ClassStructPtr& cs1, - const ::Test::ClassStructSeq& seq) + const ::Test::ClassStructPtr& cs1, + const ::Test::ClassStructSeq& seq) { - test(ret == _cs); - test(cs1 == _cs); - test(seq == _csseq1); + test(ret == _cs); + test(cs1 == _cs); + test(seq == _csseq1); called(); } @@ -912,9 +912,9 @@ public: virtual void ice_response(const wstring& ret, const wstring& out) { - test(out == _in); - test(ret == _in); - called(); + test(out == _in); + test(ret == _in); + called(); } virtual void ice_exception(const ::Ice::Exception&) @@ -940,9 +940,9 @@ public: virtual void ice_response(const wstring& ret, const wstring& out) { - test(out == _in); - test(ret == _in); - called(); + test(out == _in); + test(ret == _in); + called(); } virtual void ice_exception(const ::Ice::Exception&) @@ -974,18 +974,18 @@ public: virtual void ice_exception(const ::Ice::Exception& ex) { try - { - ex.ice_throw(); - } - catch(const Test1::WstringException& e) - { - test(e.reason == _in); - called(); - } - catch(...) - { + { + ex.ice_throw(); + } + catch(const Test1::WstringException& e) + { + test(e.reason == _in); + called(); + } + catch(...) + { test(false); - } + } } private: @@ -1012,18 +1012,18 @@ public: virtual void ice_exception(const ::Ice::Exception& ex) { try - { - ex.ice_throw(); - } - catch(const Test2::WstringException& e) - { - test(e.reason == _in); - called(); - } - catch(...) - { + { + ex.ice_throw(); + } + catch(const Test2::WstringException& e) + { + test(e.reason == _in); + called(); + } + catch(...) + { test(false); - } + } } private: @@ -1038,7 +1038,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) { cout << "testing stringToProxy... " << flush; string ref = communicator->getProperties()->getPropertyWithDefault( - "Custom.Proxy", "test:default -p 12010 -t 10000"); + "Custom.Proxy", "test:default -p 12010 -t 10000"); Ice::ObjectPrx base = communicator->stringToProxy(ref); test(base); cout << "ok" << endl; @@ -1053,487 +1053,487 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) { Test::DoubleSeq in(5); - in[0] = 3.14; - in[1] = 1 / 3; - in[2] = 0.375; - in[3] = 4 / 3; - in[4] = -5.725; - Ice::Double inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const Ice::Double*, const Ice::Double*> inPair(inArray, inArray + 5); + in[0] = 3.14; + in[1] = 1 / 3; + in[2] = 0.375; + in[3] = 4 / 3; + in[4] = -5.725; + Ice::Double inArray[5]; + for(int i = 0; i < 5; ++i) + { + inArray[i] = in[i]; + } + pair<const Ice::Double*, const Ice::Double*> inPair(inArray, inArray + 5); - Test::DoubleSeq out; - Test::DoubleSeq ret = t->opDoubleArray(inPair, out); - test(out == in); - test(ret == in); + Test::DoubleSeq out; + Test::DoubleSeq ret = t->opDoubleArray(inPair, out); + test(out == in); + test(ret == in); } { Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - bool inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const bool*, const bool*> inPair(inArray, inArray + 5); + in[0] = false; + in[1] = true; + in[2] = true; + in[3] = false; + in[4] = true; + bool inArray[5]; + for(int i = 0; i < 5; ++i) + { + inArray[i] = in[i]; + } + pair<const bool*, const bool*> inPair(inArray, inArray + 5); - Test::BoolSeq out; - Test::BoolSeq ret = t->opBoolArray(inPair, out); - test(out == in); - test(ret == in); + Test::BoolSeq out; + Test::BoolSeq ret = t->opBoolArray(inPair, out); + test(out == in); + test(ret == in); } { Test::ByteList in; - Ice::Byte inArray[5]; - inArray[0] = '1'; - in.push_back(inArray[0]); - inArray[1] = '2'; - in.push_back(inArray[1]); - inArray[2] = '3'; - in.push_back(inArray[2]); - inArray[3] = '4'; - in.push_back(inArray[3]); - inArray[4] = '5'; - in.push_back(inArray[4]); - pair<const Ice::Byte*, const Ice::Byte*> inPair(inArray, inArray + 5); - - Test::ByteList out; - Test::ByteList ret = t->opByteArray(inPair, out); - test(out == in); - test(ret == in); + Ice::Byte inArray[5]; + inArray[0] = '1'; + in.push_back(inArray[0]); + inArray[1] = '2'; + in.push_back(inArray[1]); + inArray[2] = '3'; + in.push_back(inArray[2]); + inArray[3] = '4'; + in.push_back(inArray[3]); + inArray[4] = '5'; + in.push_back(inArray[4]); + pair<const Ice::Byte*, const Ice::Byte*> inPair(inArray, inArray + 5); + + Test::ByteList out; + Test::ByteList ret = t->opByteArray(inPair, out); + test(out == in); + test(ret == in); } { Test::VariableList in; - Test::Variable inArray[5]; - inArray[0].s = "These"; - in.push_back(inArray[0]); - inArray[1].s = "are"; - in.push_back(inArray[1]); - inArray[2].s = "five"; - in.push_back(inArray[2]); - inArray[3].s = "short"; - in.push_back(inArray[3]); - inArray[4].s = "strings."; - in.push_back(inArray[4]); - pair<const Test::Variable*, const Test::Variable*> inPair(inArray, inArray + 5); - - Test::VariableList out; - Test::VariableList ret = t->opVariableArray(inPair, out); - test(out == in); - test(ret == in); + Test::Variable inArray[5]; + inArray[0].s = "These"; + in.push_back(inArray[0]); + inArray[1].s = "are"; + in.push_back(inArray[1]); + inArray[2].s = "five"; + in.push_back(inArray[2]); + inArray[3].s = "short"; + in.push_back(inArray[3]); + inArray[4].s = "strings."; + in.push_back(inArray[4]); + pair<const Test::Variable*, const Test::Variable*> inPair(inArray, inArray + 5); + + Test::VariableList out; + Test::VariableList ret = t->opVariableArray(inPair, out); + test(out == in); + test(ret == in); } { Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> inPair(in.begin(), in.end()); + in[0] = false; + in[1] = true; + in[2] = true; + in[3] = false; + in[4] = true; + pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> inPair(in.begin(), in.end()); - Test::BoolSeq out; - Test::BoolSeq ret = t->opBoolRange(inPair, out); - test(out == in); - test(ret == in); + Test::BoolSeq out; + Test::BoolSeq ret = t->opBoolRange(inPair, out); + test(out == in); + test(ret == in); } { Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); + in.push_back('1'); + in.push_back('2'); + in.push_back('3'); + in.push_back('4'); + in.push_back('5'); + pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); - Test::ByteList out; - Test::ByteList ret = t->opByteRange(inPair, out); - test(out == in); - test(ret == in); + Test::ByteList out; + Test::ByteList ret = t->opByteRange(inPair, out); + test(out == in); + test(ret == in); } { Test::VariableList in; - Test::Variable v; - v.s = "These"; - in.push_back(v); - v.s = "are"; - in.push_back(v); - v.s = "five"; - in.push_back(v); - v.s = "short"; - in.push_back(v); - v.s = "strings."; - in.push_back(v); - pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator> inPair(in.begin(), in.end()); - - Test::VariableList out; - Test::VariableList ret = t->opVariableRange(inPair, out); - test(out == in); - test(ret == in); + Test::Variable v; + v.s = "These"; + in.push_back(v); + v.s = "are"; + in.push_back(v); + v.s = "five"; + in.push_back(v); + v.s = "short"; + in.push_back(v); + v.s = "strings."; + in.push_back(v); + pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator> inPair(in.begin(), in.end()); + + Test::VariableList out; + Test::VariableList ret = t->opVariableRange(inPair, out); + test(out == in); + test(ret == in); } { Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - bool inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const bool*, const bool*> inPair(inArray, inArray + 5); + in[0] = false; + in[1] = true; + in[2] = true; + in[3] = false; + in[4] = true; + bool inArray[5]; + for(int i = 0; i < 5; ++i) + { + inArray[i] = in[i]; + } + pair<const bool*, const bool*> inPair(inArray, inArray + 5); - Test::BoolSeq out; - Test::BoolSeq ret = t->opBoolRangeType(inPair, out); - test(out == in); - test(ret == in); + Test::BoolSeq out; + Test::BoolSeq ret = t->opBoolRangeType(inPair, out); + test(out == in); + test(ret == in); } { Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); + in.push_back('1'); + in.push_back('2'); + in.push_back('3'); + in.push_back('4'); + in.push_back('5'); + pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); - Test::ByteList out; - Test::ByteList ret = t->opByteRangeType(inPair, out); - test(out == in); - test(ret == in); + Test::ByteList out; + Test::ByteList ret = t->opByteRangeType(inPair, out); + test(out == in); + test(ret == in); } { Test::VariableList in; - deque<Test::Variable> inSeq; - Test::Variable v; - v.s = "These"; - in.push_back(v); - inSeq.push_back(v); - v.s = "are"; - in.push_back(v); - inSeq.push_back(v); - v.s = "five"; - in.push_back(v); - inSeq.push_back(v); - v.s = "short"; - in.push_back(v); - inSeq.push_back(v); - v.s = "strings."; - in.push_back(v); - inSeq.push_back(v); - pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator> - inPair(inSeq.begin(), inSeq.end()); - - Test::VariableList out; - Test::VariableList ret = t->opVariableRangeType(inPair, out); - test(out == in); - test(ret == in); + deque<Test::Variable> inSeq; + Test::Variable v; + v.s = "These"; + in.push_back(v); + inSeq.push_back(v); + v.s = "are"; + in.push_back(v); + inSeq.push_back(v); + v.s = "five"; + in.push_back(v); + inSeq.push_back(v); + v.s = "short"; + in.push_back(v); + inSeq.push_back(v); + v.s = "strings."; + in.push_back(v); + inSeq.push_back(v); + pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator> + inPair(inSeq.begin(), inSeq.end()); + + Test::VariableList out; + Test::VariableList ret = t->opVariableRangeType(inPair, out); + test(out == in); + test(ret == in); } { deque<bool> in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; + in[0] = false; + in[1] = true; + in[2] = true; + in[3] = false; + in[4] = true; - deque<bool> out; - deque<bool> ret = t->opBoolSeq(in, out); - test(out == in); - test(ret == in); + deque<bool> out; + deque<bool> ret = t->opBoolSeq(in, out); + test(out == in); + test(ret == in); } { list<bool> in; - in.push_back(false); - in.push_back(true); - in.push_back(true); - in.push_back(false); - in.push_back(true); + in.push_back(false); + in.push_back(true); + in.push_back(true); + in.push_back(false); + in.push_back(true); - list<bool> out; - list<bool> ret = t->opBoolList(in, out); - test(out == in); - test(ret == in); + list<bool> out; + list<bool> ret = t->opBoolList(in, out); + test(out == in); + test(ret == in); } { deque< ::Ice::Byte> in(5); - in[0] = '1'; - in[1] = '2'; - in[2] = '3'; - in[3] = '4'; - in[4] = '5'; + in[0] = '1'; + in[1] = '2'; + in[2] = '3'; + in[3] = '4'; + in[4] = '5'; - deque< ::Ice::Byte> out; - deque< ::Ice::Byte> ret = t->opByteSeq(in, out); - test(out == in); - test(ret == in); + deque< ::Ice::Byte> out; + deque< ::Ice::Byte> ret = t->opByteSeq(in, out); + test(out == in); + test(ret == in); } { list< ::Ice::Byte> in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); + in.push_back('1'); + in.push_back('2'); + in.push_back('3'); + in.push_back('4'); + in.push_back('5'); - list< ::Ice::Byte> out; - list< ::Ice::Byte> ret = t->opByteList(in, out); - test(out == in); - test(ret == in); + list< ::Ice::Byte> out; + list< ::Ice::Byte> ret = t->opByteList(in, out); + test(out == in); + test(ret == in); } { MyByteSeq in(5); - int i = 0; - for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p) - { - *p = '1' + i++; - } + int i = 0; + for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p) + { + *p = '1' + i++; + } - MyByteSeq out; - MyByteSeq ret = t->opMyByteSeq(in, out); - test(out == in); - test(ret == in); + MyByteSeq out; + MyByteSeq ret = t->opMyByteSeq(in, out); + test(out == in); + test(ret == in); } { deque<string> in(5); - in[0] = "These"; - in[1] = "are"; - in[2] = "five"; - in[3] = "short"; - in[4] = "strings."; + in[0] = "These"; + in[1] = "are"; + in[2] = "five"; + in[3] = "short"; + in[4] = "strings."; - deque<string> out; - deque<string> ret = t->opStringSeq(in, out); - test(out == in); - test(ret == in); + deque<string> out; + deque<string> ret = t->opStringSeq(in, out); + test(out == in); + test(ret == in); } { list<string> in; - in.push_back("These"); - in.push_back("are"); - in.push_back("five"); - in.push_back("short"); - in.push_back("strings."); + in.push_back("These"); + in.push_back("are"); + in.push_back("five"); + in.push_back("short"); + in.push_back("strings."); - list<string> out; - list<string> ret = t->opStringList(in, out); - test(out == in); - test(ret == in); + list<string> out; + list<string> ret = t->opStringList(in, out); + test(out == in); + test(ret == in); } { deque<Test::Fixed> in(5); - in[0].s = 1; - in[1].s = 2; - in[2].s = 3; - in[3].s = 4; - in[4].s = 5; + in[0].s = 1; + in[1].s = 2; + in[2].s = 3; + in[3].s = 4; + in[4].s = 5; - deque<Test::Fixed> out; - deque<Test::Fixed> ret = t->opFixedSeq(in, out); - test(out == in); - test(ret == in); + deque<Test::Fixed> out; + deque<Test::Fixed> ret = t->opFixedSeq(in, out); + test(out == in); + test(ret == in); } { list<Test::Fixed> in(5); - short num = 1; - for(list<Test::Fixed>::iterator p = in.begin(); p != in.end(); ++p) - { - (*p).s = num++; - } + short num = 1; + for(list<Test::Fixed>::iterator p = in.begin(); p != in.end(); ++p) + { + (*p).s = num++; + } - list<Test::Fixed> out; - list<Test::Fixed> ret = t->opFixedList(in, out); - test(out == in); - test(ret == in); + list<Test::Fixed> out; + list<Test::Fixed> ret = t->opFixedList(in, out); + test(out == in); + test(ret == in); } { deque<Test::Variable> in(5); - in[0].s = "These"; - in[1].s = "are"; - in[2].s = "five"; - in[3].s = "short"; - in[4].s = "strings."; + in[0].s = "These"; + in[1].s = "are"; + in[2].s = "five"; + in[3].s = "short"; + in[4].s = "strings."; - deque<Test::Variable> out; - deque<Test::Variable> ret = t->opVariableSeq(in, out); - test(out == in); - test(ret == in); + deque<Test::Variable> out; + deque<Test::Variable> ret = t->opVariableSeq(in, out); + test(out == in); + test(ret == in); } { list<Test::Variable> in; - Test::Variable v; - v.s = "These"; - in.push_back(v); - v.s = "are"; - in.push_back(v); - v.s = "five"; - in.push_back(v); - v.s = "short"; - in.push_back(v); - v.s = "strings."; - in.push_back(v); + Test::Variable v; + v.s = "These"; + in.push_back(v); + v.s = "are"; + in.push_back(v); + v.s = "five"; + in.push_back(v); + v.s = "short"; + in.push_back(v); + v.s = "strings."; + in.push_back(v); - list<Test::Variable> out; - list<Test::Variable> ret = t->opVariableList(in, out); - test(out == in); - test(ret == in); + list<Test::Variable> out; + list<Test::Variable> ret = t->opVariableList(in, out); + test(out == in); + test(ret == in); } { deque<Test::StringStringDict> in(5); - in[0]["A"] = "a"; - in[1]["B"] = "b"; - in[2]["C"] = "c"; - in[3]["D"] = "d"; - in[4]["E"] = "e"; + in[0]["A"] = "a"; + in[1]["B"] = "b"; + in[2]["C"] = "c"; + in[3]["D"] = "d"; + in[4]["E"] = "e"; - deque<Test::StringStringDict> out; - deque<Test::StringStringDict> ret = t->opStringStringDictSeq(in, out); - test(out == in); - test(ret == in); + deque<Test::StringStringDict> out; + deque<Test::StringStringDict> ret = t->opStringStringDictSeq(in, out); + test(out == in); + test(ret == in); } { list<Test::StringStringDict> in; - Test::StringStringDict ssd; - ssd["A"] = "a"; - in.push_back(ssd); - ssd["B"] = "b"; - in.push_back(ssd); - ssd["C"] = "c"; - in.push_back(ssd); - ssd["D"] = "d"; - in.push_back(ssd); - ssd["E"] = "e"; - in.push_back(ssd); + Test::StringStringDict ssd; + ssd["A"] = "a"; + in.push_back(ssd); + ssd["B"] = "b"; + in.push_back(ssd); + ssd["C"] = "c"; + in.push_back(ssd); + ssd["D"] = "d"; + in.push_back(ssd); + ssd["E"] = "e"; + in.push_back(ssd); - list<Test::StringStringDict> out; - list<Test::StringStringDict> ret = t->opStringStringDictList(in, out); - test(out == in); - test(ret == in); + list<Test::StringStringDict> out; + list<Test::StringStringDict> ret = t->opStringStringDictList(in, out); + test(out == in); + test(ret == in); } { deque<Test::E> in(5); - in[0] = Test::E1; - in[1] = Test::E2; - in[2] = Test::E3; - in[3] = Test::E1; - in[4] = Test::E3; + in[0] = Test::E1; + in[1] = Test::E2; + in[2] = Test::E3; + in[3] = Test::E1; + in[4] = Test::E3; - deque<Test::E> out; - deque<Test::E> ret = t->opESeq(in, out); - test(out == in); - test(ret == in); + deque<Test::E> out; + deque<Test::E> ret = t->opESeq(in, out); + test(out == in); + test(ret == in); } { list<Test::E> in; - in.push_back(Test::E1); - in.push_back(Test::E2); - in.push_back(Test::E3); - in.push_back(Test::E1); - in.push_back(Test::E3); + in.push_back(Test::E1); + in.push_back(Test::E2); + in.push_back(Test::E3); + in.push_back(Test::E1); + in.push_back(Test::E3); - list<Test::E> out; - list<Test::E> ret = t->opEList(in, out); - test(out == in); - test(ret == in); + list<Test::E> out; + list<Test::E> ret = t->opEList(in, out); + test(out == in); + test(ret == in); } { deque<Test::CPrx> in(5); - in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")); - in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")); - in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")); - in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")); - in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")); + in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")); + in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")); + in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")); + in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")); + in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")); - deque<Test::CPrx> out; - deque<Test::CPrx> ret = t->opCPrxSeq(in, out); - test(out == in); - test(ret == in); + deque<Test::CPrx> out; + deque<Test::CPrx> ret = t->opCPrxSeq(in, out); + test(out == in); + test(ret == in); } { list<Test::CPrx> in; - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"))); - list<Test::CPrx> out; - list<Test::CPrx> ret = t->opCPrxList(in, out); - test(out == in); - test(ret == in); + list<Test::CPrx> out; + list<Test::CPrx> ret = t->opCPrxList(in, out); + test(out == in); + test(ret == in); } { deque<Test::CPtr> in(5); - in[0] = new Test::C(); - in[1] = in[0]; - in[2] = in[0]; - in[3] = in[0]; - in[4] = in[0]; - - deque<Test::CPtr> out; - deque<Test::CPtr> ret = t->opCSeq(in, out); - test(out.size() == in.size()); - test(ret.size() == in.size()); - for(unsigned int i = 1; i < in.size(); ++i) - { - test(out[i] == out[0]); - test(ret[i] == out[i]); - } + in[0] = new Test::C(); + in[1] = in[0]; + in[2] = in[0]; + in[3] = in[0]; + in[4] = in[0]; + + deque<Test::CPtr> out; + deque<Test::CPtr> ret = t->opCSeq(in, out); + test(out.size() == in.size()); + test(ret.size() == in.size()); + for(unsigned int i = 1; i < in.size(); ++i) + { + test(out[i] == out[0]); + test(ret[i] == out[i]); + } } { list<Test::CPtr> in; - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - - list<Test::CPtr> out; - list<Test::CPtr> ret = t->opCList(in, out); - test(out.size() == in.size()); - test(ret.size() == in.size()); - list<Test::CPtr>::const_iterator p1; - list<Test::CPtr>::const_iterator p2; - for(p1 = out.begin(), p2 = ret.begin(); p1 != out.end(); ++p1, ++p2) - { - test(*p1 == *p2); - } + in.push_back(new Test::C()); + in.push_back(new Test::C()); + in.push_back(new Test::C()); + in.push_back(new Test::C()); + in.push_back(new Test::C()); + + list<Test::CPtr> out; + list<Test::CPtr> ret = t->opCList(in, out); + test(out.size() == in.size()); + test(ret.size() == in.size()); + list<Test::CPtr>::const_iterator p1; + list<Test::CPtr>::const_iterator p2; + for(p1 = out.begin(), p2 = ret.begin(); p1 != out.end(); ++p1, ++p2) + { + test(*p1 == *p2); + } } cout << "ok" << endl; @@ -1544,422 +1544,422 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) { Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - bool inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const bool*, const bool*> inPair(inArray, inArray + 5); - - AMI_TestIntf_opBoolArrayIPtr cb = new AMI_TestIntf_opBoolArrayI(in); - t->opBoolArray_async(cb, inPair); - test(cb->check()); + in[0] = false; + in[1] = true; + in[2] = true; + in[3] = false; + in[4] = true; + bool inArray[5]; + for(int i = 0; i < 5; ++i) + { + inArray[i] = in[i]; + } + pair<const bool*, const bool*> inPair(inArray, inArray + 5); + + AMI_TestIntf_opBoolArrayIPtr cb = new AMI_TestIntf_opBoolArrayI(in); + t->opBoolArray_async(cb, inPair); + test(cb->check()); } { - Ice::Byte in[5]; - in[0] = '1'; - in[1] = '2'; - in[2] = '3'; - in[3] = '4'; - in[4] = '5'; - pair<const Ice::Byte*, const Ice::Byte*> inPair(in, in + 5); - - AMI_TestIntf_opByteArrayIPtr cb = new AMI_TestIntf_opByteArrayI(inPair); - t->opByteArray_async(cb, inPair); - test(cb->check()); + Ice::Byte in[5]; + in[0] = '1'; + in[1] = '2'; + in[2] = '3'; + in[3] = '4'; + in[4] = '5'; + pair<const Ice::Byte*, const Ice::Byte*> inPair(in, in + 5); + + AMI_TestIntf_opByteArrayIPtr cb = new AMI_TestIntf_opByteArrayI(inPair); + t->opByteArray_async(cb, inPair); + test(cb->check()); } { Test::VariableList in; - Test::Variable inArray[5]; - inArray[0].s = "These"; - in.push_back(inArray[0]); - inArray[1].s = "are"; - in.push_back(inArray[1]); - inArray[2].s = "five"; - in.push_back(inArray[2]); - inArray[3].s = "short"; - in.push_back(inArray[3]); - inArray[4].s = "strings."; - in.push_back(inArray[4]); - pair<const Test::Variable*, const Test::Variable*> inPair(inArray, inArray + 5); - - AMI_TestIntf_opVariableArrayIPtr cb = new AMI_TestIntf_opVariableArrayI(in); - t->opVariableArray_async(cb, inPair); - test(cb->check()); + Test::Variable inArray[5]; + inArray[0].s = "These"; + in.push_back(inArray[0]); + inArray[1].s = "are"; + in.push_back(inArray[1]); + inArray[2].s = "five"; + in.push_back(inArray[2]); + inArray[3].s = "short"; + in.push_back(inArray[3]); + inArray[4].s = "strings."; + in.push_back(inArray[4]); + pair<const Test::Variable*, const Test::Variable*> inPair(inArray, inArray + 5); + + AMI_TestIntf_opVariableArrayIPtr cb = new AMI_TestIntf_opVariableArrayI(in); + t->opVariableArray_async(cb, inPair); + test(cb->check()); } { Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> inPair(in.begin(), in.end()); - - AMI_TestIntf_opBoolRangeIPtr cb = new AMI_TestIntf_opBoolRangeI(in); - t->opBoolRange_async(cb, inPair); - test(cb->check()); + in[0] = false; + in[1] = true; + in[2] = true; + in[3] = false; + in[4] = true; + pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> inPair(in.begin(), in.end()); + + AMI_TestIntf_opBoolRangeIPtr cb = new AMI_TestIntf_opBoolRangeI(in); + t->opBoolRange_async(cb, inPair); + test(cb->check()); } { Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); - - AMI_TestIntf_opByteRangeIPtr cb = new AMI_TestIntf_opByteRangeI(in); - t->opByteRange_async(cb, inPair); - test(cb->check()); + in.push_back('1'); + in.push_back('2'); + in.push_back('3'); + in.push_back('4'); + in.push_back('5'); + pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); + + AMI_TestIntf_opByteRangeIPtr cb = new AMI_TestIntf_opByteRangeI(in); + t->opByteRange_async(cb, inPair); + test(cb->check()); } { Test::VariableList in; - Test::Variable v; - v.s = "These"; - in.push_back(v); - v.s = "are"; - in.push_back(v); - v.s = "five"; - in.push_back(v); - v.s = "short"; - in.push_back(v); - v.s = "strings."; - in.push_back(v); - pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator> inPair(in.begin(), in.end()); - - AMI_TestIntf_opVariableRangeIPtr cb = new AMI_TestIntf_opVariableRangeI(in); - t->opVariableRange_async(cb, inPair); - test(cb->check()); + Test::Variable v; + v.s = "These"; + in.push_back(v); + v.s = "are"; + in.push_back(v); + v.s = "five"; + in.push_back(v); + v.s = "short"; + in.push_back(v); + v.s = "strings."; + in.push_back(v); + pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator> inPair(in.begin(), in.end()); + + AMI_TestIntf_opVariableRangeIPtr cb = new AMI_TestIntf_opVariableRangeI(in); + t->opVariableRange_async(cb, inPair); + test(cb->check()); } { Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - bool inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const bool*, const bool*> inPair(inArray, inArray + 5); - - AMI_TestIntf_opBoolRangeTypeIPtr cb = new AMI_TestIntf_opBoolRangeTypeI(in); - t->opBoolRangeType_async(cb, inPair); - test(cb->check()); + in[0] = false; + in[1] = true; + in[2] = true; + in[3] = false; + in[4] = true; + bool inArray[5]; + for(int i = 0; i < 5; ++i) + { + inArray[i] = in[i]; + } + pair<const bool*, const bool*> inPair(inArray, inArray + 5); + + AMI_TestIntf_opBoolRangeTypeIPtr cb = new AMI_TestIntf_opBoolRangeTypeI(in); + t->opBoolRangeType_async(cb, inPair); + test(cb->check()); } { Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); - - AMI_TestIntf_opByteRangeTypeIPtr cb = new AMI_TestIntf_opByteRangeTypeI(in); - t->opByteRangeType_async(cb, inPair); - test(cb->check()); + in.push_back('1'); + in.push_back('2'); + in.push_back('3'); + in.push_back('4'); + in.push_back('5'); + pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); + + AMI_TestIntf_opByteRangeTypeIPtr cb = new AMI_TestIntf_opByteRangeTypeI(in); + t->opByteRangeType_async(cb, inPair); + test(cb->check()); } { Test::VariableList in; - deque<Test::Variable> inSeq; - Test::Variable v; - v.s = "These"; - in.push_back(v); - inSeq.push_back(v); - v.s = "are"; - in.push_back(v); - inSeq.push_back(v); - v.s = "five"; - in.push_back(v); - inSeq.push_back(v); - v.s = "short"; - in.push_back(v); - inSeq.push_back(v); - v.s = "strings."; - in.push_back(v); - inSeq.push_back(v); - pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator> - inPair(inSeq.begin(), inSeq.end()); - - AMI_TestIntf_opVariableRangeTypeIPtr cb = new AMI_TestIntf_opVariableRangeTypeI(in); - t->opVariableRangeType_async(cb, inPair); - test(cb->check()); + deque<Test::Variable> inSeq; + Test::Variable v; + v.s = "These"; + in.push_back(v); + inSeq.push_back(v); + v.s = "are"; + in.push_back(v); + inSeq.push_back(v); + v.s = "five"; + in.push_back(v); + inSeq.push_back(v); + v.s = "short"; + in.push_back(v); + inSeq.push_back(v); + v.s = "strings."; + in.push_back(v); + inSeq.push_back(v); + pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator> + inPair(inSeq.begin(), inSeq.end()); + + AMI_TestIntf_opVariableRangeTypeIPtr cb = new AMI_TestIntf_opVariableRangeTypeI(in); + t->opVariableRangeType_async(cb, inPair); + test(cb->check()); } { deque<bool> in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - - AMI_TestIntf_opBoolSeqIPtr cb = new AMI_TestIntf_opBoolSeqI(in); - t->opBoolSeq_async(cb, in); - test(cb->check()); + in[0] = false; + in[1] = true; + in[2] = true; + in[3] = false; + in[4] = true; + + AMI_TestIntf_opBoolSeqIPtr cb = new AMI_TestIntf_opBoolSeqI(in); + t->opBoolSeq_async(cb, in); + test(cb->check()); } { list<bool> in; - in.push_back(false); - in.push_back(true); - in.push_back(true); - in.push_back(false); - in.push_back(true); - - AMI_TestIntf_opBoolListIPtr cb = new AMI_TestIntf_opBoolListI(in); - t->opBoolList_async(cb, in); - test(cb->check()); + in.push_back(false); + in.push_back(true); + in.push_back(true); + in.push_back(false); + in.push_back(true); + + AMI_TestIntf_opBoolListIPtr cb = new AMI_TestIntf_opBoolListI(in); + t->opBoolList_async(cb, in); + test(cb->check()); } { deque< ::Ice::Byte> in(5); - in[0] = '1'; - in[1] = '2'; - in[2] = '3'; - in[3] = '4'; - in[4] = '5'; - - AMI_TestIntf_opByteSeqIPtr cb = new AMI_TestIntf_opByteSeqI(in); - t->opByteSeq_async(cb, in); - test(cb->check()); + in[0] = '1'; + in[1] = '2'; + in[2] = '3'; + in[3] = '4'; + in[4] = '5'; + + AMI_TestIntf_opByteSeqIPtr cb = new AMI_TestIntf_opByteSeqI(in); + t->opByteSeq_async(cb, in); + test(cb->check()); } { list< ::Ice::Byte> in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - - AMI_TestIntf_opByteListIPtr cb = new AMI_TestIntf_opByteListI(in); - t->opByteList_async(cb, in); - test(cb->check()); + in.push_back('1'); + in.push_back('2'); + in.push_back('3'); + in.push_back('4'); + in.push_back('5'); + + AMI_TestIntf_opByteListIPtr cb = new AMI_TestIntf_opByteListI(in); + t->opByteList_async(cb, in); + test(cb->check()); } { MyByteSeq in(5); - int i = 0; - for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p) - { - *p = '1' + i++; - } - - AMI_TestIntf_opMyByteSeqIPtr cb = new AMI_TestIntf_opMyByteSeqI(in); - t->opMyByteSeq_async(cb, in); - test(cb->check()); + int i = 0; + for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p) + { + *p = '1' + i++; + } + + AMI_TestIntf_opMyByteSeqIPtr cb = new AMI_TestIntf_opMyByteSeqI(in); + t->opMyByteSeq_async(cb, in); + test(cb->check()); } { deque<string> in(5); - in[0] = "These"; - in[1] = "are"; - in[2] = "five"; - in[3] = "short"; - in[4] = "strings."; - - AMI_TestIntf_opStringSeqIPtr cb = new AMI_TestIntf_opStringSeqI(in); - t->opStringSeq_async(cb, in); - test(cb->check()); + in[0] = "These"; + in[1] = "are"; + in[2] = "five"; + in[3] = "short"; + in[4] = "strings."; + + AMI_TestIntf_opStringSeqIPtr cb = new AMI_TestIntf_opStringSeqI(in); + t->opStringSeq_async(cb, in); + test(cb->check()); } { list<string> in; - in.push_back("These"); - in.push_back("are"); - in.push_back("five"); - in.push_back("short"); - in.push_back("strings."); - - AMI_TestIntf_opStringListIPtr cb = new AMI_TestIntf_opStringListI(in); - t->opStringList_async(cb, in); - test(cb->check()); + in.push_back("These"); + in.push_back("are"); + in.push_back("five"); + in.push_back("short"); + in.push_back("strings."); + + AMI_TestIntf_opStringListIPtr cb = new AMI_TestIntf_opStringListI(in); + t->opStringList_async(cb, in); + test(cb->check()); } { deque<Test::Fixed> in(5); - in[0].s = 1; - in[1].s = 2; - in[2].s = 3; - in[3].s = 4; - in[4].s = 5; - - AMI_TestIntf_opFixedSeqIPtr cb = new AMI_TestIntf_opFixedSeqI(in); - t->opFixedSeq_async(cb, in); - test(cb->check()); + in[0].s = 1; + in[1].s = 2; + in[2].s = 3; + in[3].s = 4; + in[4].s = 5; + + AMI_TestIntf_opFixedSeqIPtr cb = new AMI_TestIntf_opFixedSeqI(in); + t->opFixedSeq_async(cb, in); + test(cb->check()); } { list<Test::Fixed> in(5); - short num = 1; - for(list<Test::Fixed>::iterator p = in.begin(); p != in.end(); ++p) - { - (*p).s = num++; - } - - AMI_TestIntf_opFixedListIPtr cb = new AMI_TestIntf_opFixedListI(in); - t->opFixedList_async(cb, in); - test(cb->check()); + short num = 1; + for(list<Test::Fixed>::iterator p = in.begin(); p != in.end(); ++p) + { + (*p).s = num++; + } + + AMI_TestIntf_opFixedListIPtr cb = new AMI_TestIntf_opFixedListI(in); + t->opFixedList_async(cb, in); + test(cb->check()); } { deque<Test::Variable> in(5); - in[0].s = "These"; - in[1].s = "are"; - in[2].s = "five"; - in[3].s = "short"; - in[4].s = "strings."; - - AMI_TestIntf_opVariableSeqIPtr cb = new AMI_TestIntf_opVariableSeqI(in); - t->opVariableSeq_async(cb, in); - test(cb->check()); + in[0].s = "These"; + in[1].s = "are"; + in[2].s = "five"; + in[3].s = "short"; + in[4].s = "strings."; + + AMI_TestIntf_opVariableSeqIPtr cb = new AMI_TestIntf_opVariableSeqI(in); + t->opVariableSeq_async(cb, in); + test(cb->check()); } { list<Test::Variable> in; - Test::Variable v; - v.s = "These"; - in.push_back(v); - v.s = "are"; - in.push_back(v); - v.s = "five"; - in.push_back(v); - v.s = "short"; - in.push_back(v); - v.s = "strings."; - in.push_back(v); - - AMI_TestIntf_opVariableListIPtr cb = new AMI_TestIntf_opVariableListI(in); - t->opVariableList_async(cb, in); - test(cb->check()); + Test::Variable v; + v.s = "These"; + in.push_back(v); + v.s = "are"; + in.push_back(v); + v.s = "five"; + in.push_back(v); + v.s = "short"; + in.push_back(v); + v.s = "strings."; + in.push_back(v); + + AMI_TestIntf_opVariableListIPtr cb = new AMI_TestIntf_opVariableListI(in); + t->opVariableList_async(cb, in); + test(cb->check()); } { deque<Test::StringStringDict> in(5); - in[0]["A"] = "a"; - in[1]["B"] = "b"; - in[2]["C"] = "c"; - in[3]["D"] = "d"; - in[4]["E"] = "e"; - - AMI_TestIntf_opStringStringDictSeqIPtr cb = new AMI_TestIntf_opStringStringDictSeqI(in); - t->opStringStringDictSeq_async(cb, in); - test(cb->check()); + in[0]["A"] = "a"; + in[1]["B"] = "b"; + in[2]["C"] = "c"; + in[3]["D"] = "d"; + in[4]["E"] = "e"; + + AMI_TestIntf_opStringStringDictSeqIPtr cb = new AMI_TestIntf_opStringStringDictSeqI(in); + t->opStringStringDictSeq_async(cb, in); + test(cb->check()); } { list<Test::StringStringDict> in; - Test::StringStringDict ssd; - ssd["A"] = "a"; - in.push_back(ssd); - ssd["B"] = "b"; - in.push_back(ssd); - ssd["C"] = "c"; - in.push_back(ssd); - ssd["D"] = "d"; - in.push_back(ssd); - ssd["E"] = "e"; - in.push_back(ssd); - - AMI_TestIntf_opStringStringDictListIPtr cb = new AMI_TestIntf_opStringStringDictListI(in); - t->opStringStringDictList_async(cb, in); - test(cb->check()); + Test::StringStringDict ssd; + ssd["A"] = "a"; + in.push_back(ssd); + ssd["B"] = "b"; + in.push_back(ssd); + ssd["C"] = "c"; + in.push_back(ssd); + ssd["D"] = "d"; + in.push_back(ssd); + ssd["E"] = "e"; + in.push_back(ssd); + + AMI_TestIntf_opStringStringDictListIPtr cb = new AMI_TestIntf_opStringStringDictListI(in); + t->opStringStringDictList_async(cb, in); + test(cb->check()); } { deque<Test::E> in(5); - in[0] = Test::E1; - in[1] = Test::E2; - in[2] = Test::E3; - in[3] = Test::E1; - in[4] = Test::E3; - - AMI_TestIntf_opESeqIPtr cb = new AMI_TestIntf_opESeqI(in); - t->opESeq_async(cb, in); - test(cb->check()); + in[0] = Test::E1; + in[1] = Test::E2; + in[2] = Test::E3; + in[3] = Test::E1; + in[4] = Test::E3; + + AMI_TestIntf_opESeqIPtr cb = new AMI_TestIntf_opESeqI(in); + t->opESeq_async(cb, in); + test(cb->check()); } { list<Test::E> in; - in.push_back(Test::E1); - in.push_back(Test::E2); - in.push_back(Test::E3); - in.push_back(Test::E1); - in.push_back(Test::E3); - - AMI_TestIntf_opEListIPtr cb = new AMI_TestIntf_opEListI(in); - t->opEList_async(cb, in); - test(cb->check()); + in.push_back(Test::E1); + in.push_back(Test::E2); + in.push_back(Test::E3); + in.push_back(Test::E1); + in.push_back(Test::E3); + + AMI_TestIntf_opEListIPtr cb = new AMI_TestIntf_opEListI(in); + t->opEList_async(cb, in); + test(cb->check()); } { deque<Test::CPrx> in(5); - in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")); - in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")); - in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")); - in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")); - in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")); - - AMI_TestIntf_opCPrxSeqIPtr cb = new AMI_TestIntf_opCPrxSeqI(in); - t->opCPrxSeq_async(cb, in); - test(cb->check()); + in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")); + in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")); + in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")); + in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")); + in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")); + + AMI_TestIntf_opCPrxSeqIPtr cb = new AMI_TestIntf_opCPrxSeqI(in); + t->opCPrxSeq_async(cb, in); + test(cb->check()); } { list<Test::CPrx> in; - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"))); - - AMI_TestIntf_opCPrxListIPtr cb = new AMI_TestIntf_opCPrxListI(in); - t->opCPrxList_async(cb, in); - test(cb->check()); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"))); + + AMI_TestIntf_opCPrxListIPtr cb = new AMI_TestIntf_opCPrxListI(in); + t->opCPrxList_async(cb, in); + test(cb->check()); } { deque<Test::CPtr> in(5); - in[0] = new Test::C(); - in[1] = in[0]; - in[2] = in[0]; - in[3] = in[0]; - in[4] = in[0]; - - AMI_TestIntf_opCSeqIPtr cb = new AMI_TestIntf_opCSeqI(in); - t->opCSeq_async(cb, in); - test(cb->check()); + in[0] = new Test::C(); + in[1] = in[0]; + in[2] = in[0]; + in[3] = in[0]; + in[4] = in[0]; + + AMI_TestIntf_opCSeqIPtr cb = new AMI_TestIntf_opCSeqI(in); + t->opCSeq_async(cb, in); + test(cb->check()); } { list<Test::CPtr> in; - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - - AMI_TestIntf_opCListIPtr cb = new AMI_TestIntf_opCListI(in); - t->opCList_async(cb, in); - test(cb->check()); + in.push_back(new Test::C()); + in.push_back(new Test::C()); + in.push_back(new Test::C()); + in.push_back(new Test::C()); + in.push_back(new Test::C()); + + AMI_TestIntf_opCListIPtr cb = new AMI_TestIntf_opCListI(in); + t->opCList_async(cb, in); + test(cb->check()); } cout << "ok" << endl; @@ -1987,10 +1987,10 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) if(!collocated) { cout << "testing class mapped structs with AMI... " << flush; - AMI_TestIntf_opClassStructIPtr cb = new AMI_TestIntf_opClassStructI(cs, csseq1); - t->opClassStruct_async(cb, cs, csseq1); - test(cb->check()); - cout << "ok" << endl; + AMI_TestIntf_opClassStructIPtr cb = new AMI_TestIntf_opClassStructI(cs, csseq1); + t->opClassStruct_async(cb, cs, csseq1); + test(cb->check()); + cout << "ok" << endl; } cout << "testing wstring... " << flush; @@ -2008,14 +2008,14 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) wdict2 = wdict1; ref = communicator->getProperties()->getPropertyWithDefault( - "Custom.WstringProxy1", "wstring1:default -p 12010 -t 10000"); + "Custom.WstringProxy1", "wstring1:default -p 12010 -t 10000"); base = communicator->stringToProxy(ref); test(base); Test1::WstringClassPrx wsc1 = Test1::WstringClassPrx::checkedCast(base); test(t); ref = communicator->getProperties()->getPropertyWithDefault( - "Custom.WstringProxy2", "wstring2:default -p 12010 -t 10000"); + "Custom.WstringProxy2", "wstring2:default -p 12010 -t 10000"); base = communicator->stringToProxy(ref); test(base); Test2::WstringClassPrx wsc2 = Test2::WstringClassPrx::checkedCast(base); @@ -2029,9 +2029,9 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) if(!collocated) { - AMI_Test1_opStringIPtr cb = new AMI_Test1_opStringI(wstr); - wsc1->opString_async(cb, wstr); - test(cb->check()); + AMI_Test1_opStringIPtr cb = new AMI_Test1_opStringI(wstr); + wsc1->opString_async(cb, wstr); + test(cb->check()); } ret = wsc2->opString(wstr, out); @@ -2040,9 +2040,9 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) if(!collocated) { - AMI_Test2_opStringIPtr cb = new AMI_Test2_opStringI(wstr); - wsc2->opString_async(cb, wstr); - test(cb->check()); + AMI_Test2_opStringIPtr cb = new AMI_Test2_opStringI(wstr); + wsc2->opString_async(cb, wstr); + test(cb->check()); } Test1::WstringStruct wss1; @@ -2070,9 +2070,9 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) if(!collocated) { - AMI_Test1_throwExceptIPtr cb = new AMI_Test1_throwExceptI(wstr); - wsc1->throwExcept_async(cb, wstr); - test(cb->check()); + AMI_Test1_throwExceptIPtr cb = new AMI_Test1_throwExceptI(wstr); + wsc1->throwExcept_async(cb, wstr); + test(cb->check()); } try @@ -2086,9 +2086,9 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) if(!collocated) { - AMI_Test2_throwExceptIPtr cb = new AMI_Test2_throwExceptI(wstr); - wsc2->throwExcept_async(cb, wstr); - test(cb->check()); + AMI_Test2_throwExceptIPtr cb = new AMI_Test2_throwExceptI(wstr); + wsc2->throwExcept_async(cb, wstr); + test(cb->check()); } cout << "ok" << endl; diff --git a/cpp/test/Ice/custom/Client.cpp b/cpp/test/Ice/custom/Client.cpp index 14e524cc20e..6241f91a320 100644 --- a/cpp/test/Ice/custom/Client.cpp +++ b/cpp/test/Ice/custom/Client.cpp @@ -33,8 +33,8 @@ main(int argc, char** argv) try { Ice::InitializationData initData; - initData.stringConverter = new Test::StringConverterI(); - initData.wstringConverter = new Test::WstringConverterI(); + initData.stringConverter = new Test::StringConverterI(); + initData.wstringConverter = new Test::WstringConverterI(); communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } diff --git a/cpp/test/Ice/custom/Collocated.cpp b/cpp/test/Ice/custom/Collocated.cpp index fea1ce2681a..b7da06a2c82 100644 --- a/cpp/test/Ice/custom/Collocated.cpp +++ b/cpp/test/Ice/custom/Collocated.cpp @@ -38,11 +38,11 @@ main(int argc, char** argv) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000"); - initData.stringConverter = new Test::StringConverterI(); - initData.wstringConverter = new Test::WstringConverterI(); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + initData.properties->setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000"); + initData.stringConverter = new Test::StringConverterI(); + initData.wstringConverter = new Test::WstringConverterI(); communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } diff --git a/cpp/test/Ice/custom/MyByteSeq.cpp b/cpp/test/Ice/custom/MyByteSeq.cpp index de8306692cc..0fcdf2b4f74 100644 --- a/cpp/test/Ice/custom/MyByteSeq.cpp +++ b/cpp/test/Ice/custom/MyByteSeq.cpp @@ -31,7 +31,7 @@ MyByteSeq::MyByteSeq(const MyByteSeq& seq) if(_size != 0) { _data = (Ice::Byte*)malloc(_size); - memcpy(_data, seq._data, _size); + memcpy(_data, seq._data, _size); } else { @@ -82,13 +82,13 @@ MyByteSeq::operator=(const MyByteSeq& rhs) if(_data != 0) { free(_data); - _data = 0; + _data = 0; } _size = rhs._size; if(_size != 0) { _data = (Ice::Byte*)malloc(_size); - memcpy(_data, rhs._data, _size); + memcpy(_data, rhs._data, _size); } } diff --git a/cpp/test/Ice/custom/Server.cpp b/cpp/test/Ice/custom/Server.cpp index 0e3925e6c08..15ef0f01bf9 100644 --- a/cpp/test/Ice/custom/Server.cpp +++ b/cpp/test/Ice/custom/Server.cpp @@ -37,11 +37,11 @@ main(int argc, char** argv) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000"); - initData.stringConverter = new Test::StringConverterI(); - initData.wstringConverter = new Test::WstringConverterI(); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + initData.properties->setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000"); + initData.stringConverter = new Test::StringConverterI(); + initData.wstringConverter = new Test::WstringConverterI(); communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } diff --git a/cpp/test/Ice/custom/ServerAMD.cpp b/cpp/test/Ice/custom/ServerAMD.cpp index 92c0fad867c..d4ccd779899 100644 --- a/cpp/test/Ice/custom/ServerAMD.cpp +++ b/cpp/test/Ice/custom/ServerAMD.cpp @@ -37,12 +37,12 @@ main(int argc, char** argv) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - - initData.properties->setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000"); - initData.stringConverter = new Test::StringConverterI(); - initData.wstringConverter = new Test::WstringConverterI(); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + + initData.properties->setProperty("Ice.OA.TestAdapter.Endpoints", "default -p 12010 -t 10000"); + initData.stringConverter = new Test::StringConverterI(); + initData.wstringConverter = new Test::WstringConverterI(); communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } diff --git a/cpp/test/Ice/custom/StringConverterI.cpp b/cpp/test/Ice/custom/StringConverterI.cpp index f3798ad5db5..626a3626476 100644 --- a/cpp/test/Ice/custom/StringConverterI.cpp +++ b/cpp/test/Ice/custom/StringConverterI.cpp @@ -30,7 +30,7 @@ Test::StringConverterI::toUTF8(const char* sourceStart, const char* sourceEnd, I void Test::StringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, - string& target) const + string& target) const { size_t size = static_cast<size_t>(sourceEnd - sourceStart); target.resize(size); @@ -63,7 +63,7 @@ Test::WstringConverterI::toUTF8(const wchar_t* sourceStart, const wchar_t* sourc void Test::WstringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, - wstring& target) const + wstring& target) const { size_t size = static_cast<size_t>(sourceEnd - sourceStart); string s; diff --git a/cpp/test/Ice/custom/StringConverterI.h b/cpp/test/Ice/custom/StringConverterI.h index 6d555358398..9a2d63cfd9b 100644 --- a/cpp/test/Ice/custom/StringConverterI.h +++ b/cpp/test/Ice/custom/StringConverterI.h @@ -26,7 +26,7 @@ public: virtual Ice::Byte* toUTF8(const char*, const char*, Ice::UTF8Buffer&) const; virtual void fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, - std::string& target) const; + std::string& target) const; }; class WstringConverterI : public Ice::WstringConverter @@ -35,7 +35,7 @@ public: virtual Ice::Byte* toUTF8(const wchar_t*, const wchar_t*, Ice::UTF8Buffer&) const; virtual void fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, - std::wstring& target) const; + std::wstring& target) const; }; diff --git a/cpp/test/Ice/custom/Test.ice b/cpp/test/Ice/custom/Test.ice index baa8cceb1e3..ec21d2d7802 100644 --- a/cpp/test/Ice/custom/Test.ice +++ b/cpp/test/Ice/custom/Test.ice @@ -139,7 +139,7 @@ sequence<ClassStruct> ClassStructSeq; ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq opByteSeq(["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq inSeq, - out ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq outSeq); + out ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq outSeq); ByteList opByteList(ByteList inSeq, out ByteList outSeq); @@ -148,7 +148,7 @@ sequence<ClassStruct> ClassStructSeq; ["cpp:type:std::deque<std::string>"] StringSeq opStringSeq(["cpp:type:std::deque<std::string>"] StringSeq inSeq, - out ["cpp:type:std::deque<std::string>"] StringSeq outSeq); + out ["cpp:type:std::deque<std::string>"] StringSeq outSeq); StringList opStringList(StringList inSeq, out StringList outSeq); @@ -160,13 +160,13 @@ sequence<ClassStruct> ClassStructSeq; ["cpp:type:std::deque< ::Test::Variable>"] VariableSeq opVariableSeq(["cpp:type:std::deque< ::Test::Variable>"] VariableSeq inSeq, - out ["cpp:type:std::deque< ::Test::Variable>"] VariableSeq outSeq); + out ["cpp:type:std::deque< ::Test::Variable>"] VariableSeq outSeq); VariableList opVariableList(VariableList inSeq, out VariableList outSeq); ["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq opStringStringDictSeq(["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq inSeq, - out ["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq outSeq); + out ["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq outSeq); StringStringDictList opStringStringDictList(StringStringDictList inSeq, out StringStringDictList outSeq); @@ -177,7 +177,7 @@ sequence<ClassStruct> ClassStructSeq; ["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq opCPrxSeq(["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq inSeq, - out ["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq outSeq); + out ["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq outSeq); CPrxList opCPrxList(CPrxList inSeq, out CPrxList outSeq); diff --git a/cpp/test/Ice/custom/TestAMD.ice b/cpp/test/Ice/custom/TestAMD.ice index 736131296fe..b0c8383855b 100644 --- a/cpp/test/Ice/custom/TestAMD.ice +++ b/cpp/test/Ice/custom/TestAMD.ice @@ -139,7 +139,7 @@ sequence<ClassStruct> ClassStructSeq; ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq opByteSeq(["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq inSeq, - out ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq outSeq); + out ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq outSeq); ByteList opByteList(ByteList inSeq, out ByteList outSeq); @@ -148,7 +148,7 @@ sequence<ClassStruct> ClassStructSeq; ["cpp:type:std::deque<std::string>"] StringSeq opStringSeq(["cpp:type:std::deque<std::string>"] StringSeq inSeq, - out ["cpp:type:std::deque<std::string>"] StringSeq outSeq); + out ["cpp:type:std::deque<std::string>"] StringSeq outSeq); StringList opStringList(StringList inSeq, out StringList outSeq); @@ -160,13 +160,13 @@ sequence<ClassStruct> ClassStructSeq; ["cpp:type:std::deque< ::Test::Variable>"] VariableSeq opVariableSeq(["cpp:type:std::deque< ::Test::Variable>"] VariableSeq inSeq, - out ["cpp:type:std::deque< ::Test::Variable>"] VariableSeq outSeq); + out ["cpp:type:std::deque< ::Test::Variable>"] VariableSeq outSeq); VariableList opVariableList(VariableList inSeq, out VariableList outSeq); ["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq opStringStringDictSeq(["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq inSeq, - out ["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq outSeq); + out ["cpp:type:std::deque< ::Test::StringStringDict>"] StringStringDictSeq outSeq); StringStringDictList opStringStringDictList(StringStringDictList inSeq, out StringStringDictList outSeq); @@ -177,7 +177,7 @@ sequence<ClassStruct> ClassStructSeq; ["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq opCPrxSeq(["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq inSeq, - out ["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq outSeq); + out ["cpp:type:std::deque< ::Test::CPrx>"] CPrxSeq outSeq); CPrxList opCPrxList(CPrxList inSeq, out CPrxList outSeq); diff --git a/cpp/test/Ice/custom/TestAMDI.cpp b/cpp/test/Ice/custom/TestAMDI.cpp index b7c4cd26c79..e323194c210 100644 --- a/cpp/test/Ice/custom/TestAMDI.cpp +++ b/cpp/test/Ice/custom/TestAMDI.cpp @@ -17,8 +17,8 @@ TestIntfI::TestIntfI(const Ice::CommunicatorPtr& communicator) void TestIntfI::opDoubleArray_async(const Test::AMD_TestIntf_opDoubleArrayPtr& opDoubleArrayCB, - const std::pair<const Ice::Double*, const Ice::Double*>& inSeq, - const Ice::Current& current) + const std::pair<const Ice::Double*, const Ice::Double*>& inSeq, + const Ice::Current& current) { Test::DoubleSeq outSeq(inSeq.first, inSeq.second); opDoubleArrayCB->ice_response(outSeq, outSeq); @@ -26,8 +26,8 @@ TestIntfI::opDoubleArray_async(const Test::AMD_TestIntf_opDoubleArrayPtr& opDoub void TestIntfI::opBoolArray_async(const Test::AMD_TestIntf_opBoolArrayPtr& opBoolArrayCB, - const std::pair<const bool*, const bool*>& inSeq, - const Ice::Current& current) + const std::pair<const bool*, const bool*>& inSeq, + const Ice::Current& current) { Test::BoolSeq outSeq(inSeq.first, inSeq.second); opBoolArrayCB->ice_response(outSeq, outSeq); @@ -35,16 +35,16 @@ TestIntfI::opBoolArray_async(const Test::AMD_TestIntf_opBoolArrayPtr& opBoolArra void TestIntfI::opByteArray_async(const Test::AMD_TestIntf_opByteArrayPtr& opByteArrayCB, - const std::pair<const Ice::Byte*, const Ice::Byte*>& inSeq, - const Ice::Current& current) + const std::pair<const Ice::Byte*, const Ice::Byte*>& inSeq, + const Ice::Current& current) { opByteArrayCB->ice_response(inSeq, inSeq); } void TestIntfI::opVariableArray_async(const Test::AMD_TestIntf_opVariableArrayPtr& opVariableArrayCB, - const std::pair<const Test::Variable*, const Test::Variable*>& inSeq, - const Ice::Current& current) + const std::pair<const Test::Variable*, const Test::Variable*>& inSeq, + const Ice::Current& current) { Test::VariableList outSeq(inSeq.first, inSeq.second); opVariableArrayCB->ice_response(outSeq, outSeq); @@ -52,8 +52,8 @@ TestIntfI::opVariableArray_async(const Test::AMD_TestIntf_opVariableArrayPtr& op void TestIntfI::opBoolRange_async(const Test::AMD_TestIntf_opBoolRangePtr& opBoolRangeCB, - const std::pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>& inSeq, - const Ice::Current& current) + const std::pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>& inSeq, + const Ice::Current& current) { Test::BoolSeq outSeq(inSeq.first, inSeq.second); opBoolRangeCB->ice_response(outSeq, outSeq); @@ -61,17 +61,17 @@ TestIntfI::opBoolRange_async(const Test::AMD_TestIntf_opBoolRangePtr& opBoolRang void TestIntfI::opByteRange_async(const Test::AMD_TestIntf_opByteRangePtr& opByteRangeCB, - const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& inSeq, - const Ice::Current& current) + const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& inSeq, + const Ice::Current& current) { opByteRangeCB->ice_response(inSeq, inSeq); } void TestIntfI::opVariableRange_async(const Test::AMD_TestIntf_opVariableRangePtr& opVariableRangeCB, - const std::pair<Test::VariableList::const_iterator, - Test::VariableList::const_iterator>& inSeq, - const Ice::Current& current) + const std::pair<Test::VariableList::const_iterator, + Test::VariableList::const_iterator>& inSeq, + const Ice::Current& current) { Test::VariableList outSeq(inSeq.first, inSeq.second); opVariableRangeCB->ice_response(outSeq, outSeq); @@ -79,8 +79,8 @@ TestIntfI::opVariableRange_async(const Test::AMD_TestIntf_opVariableRangePtr& op void TestIntfI::opBoolRangeType_async(const Test::AMD_TestIntf_opBoolRangeTypePtr& opBoolRangeTypeCB, - const std::pair<const bool*, const bool*>& inSeq, - const Ice::Current& current) + const std::pair<const bool*, const bool*>& inSeq, + const Ice::Current& current) { Test::BoolSeq outSeq(inSeq.first, inSeq.second); opBoolRangeTypeCB->ice_response(outSeq, outSeq); @@ -88,8 +88,8 @@ TestIntfI::opBoolRangeType_async(const Test::AMD_TestIntf_opBoolRangeTypePtr& op void TestIntfI::opByteRangeType_async(const Test::AMD_TestIntf_opByteRangeTypePtr& opByteRangeTypeCB, - const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& inSeq, - const Ice::Current& current) + const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& inSeq, + const Ice::Current& current) { Test::ByteList outSeq(inSeq.first, inSeq.second); opByteRangeTypeCB->ice_response(outSeq, outSeq); @@ -97,22 +97,22 @@ TestIntfI::opByteRangeType_async(const Test::AMD_TestIntf_opByteRangeTypePtr& op void TestIntfI::opVariableRangeType_async(const Test::AMD_TestIntf_opVariableRangeTypePtr& opVariableRangeTypeCB, - const std::pair<std::deque<Test::Variable>::const_iterator, - std::deque<Test::Variable>::const_iterator>& inSeq, - const Ice::Current& current) + const std::pair<std::deque<Test::Variable>::const_iterator, + std::deque<Test::Variable>::const_iterator>& inSeq, + const Ice::Current& current) { Test::VariableList outSeq; for(std::deque<Test::Variable>::const_iterator p = inSeq.first; p != inSeq.second; ++p) { - outSeq.push_back(*p); + outSeq.push_back(*p); } opVariableRangeTypeCB->ice_response(outSeq, outSeq); } void TestIntfI::opBoolSeq_async(const Test::AMD_TestIntf_opBoolSeqPtr& opBoolSeqCB, - const std::deque<bool>& inSeq, - const Ice::Current& current) + const std::deque<bool>& inSeq, + const Ice::Current& current) { std::deque<bool> outSeq(inSeq); opBoolSeqCB->ice_response(outSeq, outSeq); @@ -120,8 +120,8 @@ TestIntfI::opBoolSeq_async(const Test::AMD_TestIntf_opBoolSeqPtr& opBoolSeqCB, void TestIntfI::opBoolList_async(const Test::AMD_TestIntf_opBoolListPtr& opBoolListCB, - const Test::BoolList& inSeq, - const Ice::Current& current) + const Test::BoolList& inSeq, + const Ice::Current& current) { Test::BoolList outSeq(inSeq); opBoolListCB->ice_response(outSeq, outSeq); @@ -129,8 +129,8 @@ TestIntfI::opBoolList_async(const Test::AMD_TestIntf_opBoolListPtr& opBoolListCB void TestIntfI::opByteSeq_async(const Test::AMD_TestIntf_opByteSeqPtr& opByteSeqCB, - const std::deque<Ice::Byte>& inSeq, - const Ice::Current& current) + const std::deque<Ice::Byte>& inSeq, + const Ice::Current& current) { std::deque<Ice::Byte> outSeq(inSeq); opByteSeqCB->ice_response(outSeq, outSeq); @@ -138,8 +138,8 @@ TestIntfI::opByteSeq_async(const Test::AMD_TestIntf_opByteSeqPtr& opByteSeqCB, void TestIntfI::opByteList_async(const Test::AMD_TestIntf_opByteListPtr& opByteListCB, - const Test::ByteList& inSeq, - const Ice::Current& current) + const Test::ByteList& inSeq, + const Ice::Current& current) { Test::ByteList outSeq(inSeq); opByteListCB->ice_response(outSeq, outSeq); @@ -147,8 +147,8 @@ TestIntfI::opByteList_async(const Test::AMD_TestIntf_opByteListPtr& opByteListCB void TestIntfI::opMyByteSeq_async(const Test::AMD_TestIntf_opMyByteSeqPtr& opMyByteSeqCB, - const MyByteSeq& inSeq, - const Ice::Current& current) + const MyByteSeq& inSeq, + const Ice::Current& current) { MyByteSeq outSeq(inSeq); opMyByteSeqCB->ice_response(outSeq, outSeq); @@ -156,8 +156,8 @@ TestIntfI::opMyByteSeq_async(const Test::AMD_TestIntf_opMyByteSeqPtr& opMyByteSe void TestIntfI::opStringSeq_async(const Test::AMD_TestIntf_opStringSeqPtr& opStringSeqCB, - const std::deque<std::string>& inSeq, - const Ice::Current& current) + const std::deque<std::string>& inSeq, + const Ice::Current& current) { std::deque<std::string> outSeq(inSeq); opStringSeqCB->ice_response(outSeq, outSeq); @@ -165,8 +165,8 @@ TestIntfI::opStringSeq_async(const Test::AMD_TestIntf_opStringSeqPtr& opStringSe void TestIntfI::opStringList_async(const Test::AMD_TestIntf_opStringListPtr& opStringListCB, - const Test::StringList& inSeq, - const Ice::Current& current) + const Test::StringList& inSeq, + const Ice::Current& current) { Test::StringList outSeq(inSeq); opStringListCB->ice_response(outSeq, outSeq); @@ -174,8 +174,8 @@ TestIntfI::opStringList_async(const Test::AMD_TestIntf_opStringListPtr& opString void TestIntfI::opFixedSeq_async(const Test::AMD_TestIntf_opFixedSeqPtr& opFixedSeqCB, - const std::deque<Test::Fixed>& inSeq, - const Ice::Current& current) + const std::deque<Test::Fixed>& inSeq, + const Ice::Current& current) { std::deque<Test::Fixed> outSeq(inSeq); opFixedSeqCB->ice_response(outSeq, outSeq); @@ -183,8 +183,8 @@ TestIntfI::opFixedSeq_async(const Test::AMD_TestIntf_opFixedSeqPtr& opFixedSeqCB void TestIntfI::opFixedList_async(const Test::AMD_TestIntf_opFixedListPtr& opFixedListCB, - const Test::FixedList& inSeq, - const Ice::Current& current) + const Test::FixedList& inSeq, + const Ice::Current& current) { Test::FixedList outSeq(inSeq); opFixedListCB->ice_response(outSeq, outSeq); @@ -192,8 +192,8 @@ TestIntfI::opFixedList_async(const Test::AMD_TestIntf_opFixedListPtr& opFixedLis void TestIntfI::opVariableSeq_async(const Test::AMD_TestIntf_opVariableSeqPtr& opVariableSeqCB, - const std::deque<Test::Variable>& inSeq, - const Ice::Current& current) + const std::deque<Test::Variable>& inSeq, + const Ice::Current& current) { std::deque<Test::Variable> outSeq(inSeq); opVariableSeqCB->ice_response(outSeq, outSeq); @@ -201,8 +201,8 @@ TestIntfI::opVariableSeq_async(const Test::AMD_TestIntf_opVariableSeqPtr& opVari void TestIntfI::opVariableList_async(const Test::AMD_TestIntf_opVariableListPtr& opVariableListCB, - const Test::VariableList& inSeq, - const Ice::Current& current) + const Test::VariableList& inSeq, + const Ice::Current& current) { Test::VariableList outSeq(inSeq); opVariableListCB->ice_response(outSeq, outSeq); @@ -210,8 +210,8 @@ TestIntfI::opVariableList_async(const Test::AMD_TestIntf_opVariableListPtr& opVa void TestIntfI::opStringStringDictSeq_async(const Test::AMD_TestIntf_opStringStringDictSeqPtr& opStringStringDictSeqCB, - const std::deque<Test::StringStringDict>& inSeq, - const Ice::Current& current) + const std::deque<Test::StringStringDict>& inSeq, + const Ice::Current& current) { std::deque<Test::StringStringDict> outSeq(inSeq); opStringStringDictSeqCB->ice_response(outSeq, outSeq); @@ -219,8 +219,8 @@ TestIntfI::opStringStringDictSeq_async(const Test::AMD_TestIntf_opStringStringDi void TestIntfI::opStringStringDictList_async(const Test::AMD_TestIntf_opStringStringDictListPtr& opStringStringDictListCB, - const Test::StringStringDictList& inSeq, - const Ice::Current& current) + const Test::StringStringDictList& inSeq, + const Ice::Current& current) { Test::StringStringDictList outSeq(inSeq); opStringStringDictListCB->ice_response(outSeq, outSeq); @@ -228,8 +228,8 @@ TestIntfI::opStringStringDictList_async(const Test::AMD_TestIntf_opStringStringD void TestIntfI::opESeq_async(const Test::AMD_TestIntf_opESeqPtr& opESeqCB, - const std::deque<Test::E>& inSeq, - const Ice::Current& current) + const std::deque<Test::E>& inSeq, + const Ice::Current& current) { std::deque<Test::E> outSeq(inSeq); opESeqCB->ice_response(outSeq, outSeq); @@ -237,8 +237,8 @@ TestIntfI::opESeq_async(const Test::AMD_TestIntf_opESeqPtr& opESeqCB, void TestIntfI::opEList_async(const Test::AMD_TestIntf_opEListPtr& opEListCB, - const Test::EList& inSeq, - const Ice::Current& current) + const Test::EList& inSeq, + const Ice::Current& current) { Test::EList outSeq(inSeq); opEListCB->ice_response(outSeq, outSeq); @@ -246,8 +246,8 @@ TestIntfI::opEList_async(const Test::AMD_TestIntf_opEListPtr& opEListCB, void TestIntfI::opCPrxSeq_async(const Test::AMD_TestIntf_opCPrxSeqPtr& opCPrxSeqCB, - const std::deque<Test::CPrx>& inSeq, - const Ice::Current& current) + const std::deque<Test::CPrx>& inSeq, + const Ice::Current& current) { std::deque<Test::CPrx> outSeq(inSeq); opCPrxSeqCB->ice_response(outSeq, outSeq); @@ -255,8 +255,8 @@ TestIntfI::opCPrxSeq_async(const Test::AMD_TestIntf_opCPrxSeqPtr& opCPrxSeqCB, void TestIntfI::opCPrxList_async(const Test::AMD_TestIntf_opCPrxListPtr& opCPrxListCB, - const Test::CPrxList& inSeq, - const Ice::Current& current) + const Test::CPrxList& inSeq, + const Ice::Current& current) { Test::CPrxList outSeq(inSeq); opCPrxListCB->ice_response(outSeq, outSeq); @@ -264,8 +264,8 @@ TestIntfI::opCPrxList_async(const Test::AMD_TestIntf_opCPrxListPtr& opCPrxListCB void TestIntfI::opCSeq_async(const Test::AMD_TestIntf_opCSeqPtr& opCSeqCB, - const std::deque<Test::CPtr>& inSeq, - const Ice::Current& current) + const std::deque<Test::CPtr>& inSeq, + const Ice::Current& current) { std::deque<Test::CPtr> outSeq(inSeq); opCSeqCB->ice_response(outSeq, outSeq); @@ -273,8 +273,8 @@ TestIntfI::opCSeq_async(const Test::AMD_TestIntf_opCSeqPtr& opCSeqCB, void TestIntfI::opCList_async(const Test::AMD_TestIntf_opCListPtr& opCListCB, - const Test::CList& inSeq, - const Ice::Current& current) + const Test::CList& inSeq, + const Ice::Current& current) { Test::CList outSeq(inSeq); opCListCB->ice_response(outSeq, outSeq); @@ -282,16 +282,16 @@ TestIntfI::opCList_async(const Test::AMD_TestIntf_opCListPtr& opCListCB, void TestIntfI::opClassStruct_async(const ::Test::AMD_TestIntf_opClassStructPtr& cb, - const ::Test::ClassStructPtr& inS, - const ::Test::ClassStructSeq& inSeq, - const ::Ice::Current&) + const ::Test::ClassStructPtr& inS, + const ::Test::ClassStructSeq& inSeq, + const ::Ice::Current&) { cb->ice_response(inS, inS, inSeq); } void TestIntfI::shutdown_async(const Test::AMD_TestIntf_shutdownPtr& shutdownCB, - const Ice::Current& current) + const Ice::Current& current) { _communicator->shutdown(); shutdownCB->ice_response(); diff --git a/cpp/test/Ice/custom/TestAMDI.h b/cpp/test/Ice/custom/TestAMDI.h index 634d7f64ce8..04133eb2e50 100644 --- a/cpp/test/Ice/custom/TestAMDI.h +++ b/cpp/test/Ice/custom/TestAMDI.h @@ -19,130 +19,130 @@ public: TestIntfI(const Ice::CommunicatorPtr&); virtual void opDoubleArray_async(const Test::AMD_TestIntf_opDoubleArrayPtr&, - const std::pair<const Ice::Double*, const Ice::Double*>&, - const Ice::Current&); + const std::pair<const Ice::Double*, const Ice::Double*>&, + const Ice::Current&); virtual void opBoolArray_async(const Test::AMD_TestIntf_opBoolArrayPtr&, - const std::pair<const bool*, const bool*>&, - const Ice::Current&); + const std::pair<const bool*, const bool*>&, + const Ice::Current&); virtual void opByteArray_async(const Test::AMD_TestIntf_opByteArrayPtr&, - const std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, - const Ice::Current&); + const std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, + const Ice::Current&); virtual void opVariableArray_async(const Test::AMD_TestIntf_opVariableArrayPtr&, - const std::pair<const Test::Variable*, const Test::Variable*>&, - const Ice::Current&); + const std::pair<const Test::Variable*, const Test::Variable*>&, + const Ice::Current&); virtual void opBoolRange_async(const Test::AMD_TestIntf_opBoolRangePtr&, - const std::pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>&, - const Ice::Current&); + const std::pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>&, + const Ice::Current&); virtual void opByteRange_async(const Test::AMD_TestIntf_opByteRangePtr&, - const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>&, - const Ice::Current&); + const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>&, + const Ice::Current&); virtual void opVariableRange_async(const Test::AMD_TestIntf_opVariableRangePtr&, - const std::pair<Test::VariableList::const_iterator, - Test::VariableList::const_iterator>&, - const Ice::Current&); + const std::pair<Test::VariableList::const_iterator, + Test::VariableList::const_iterator>&, + const Ice::Current&); virtual void opBoolRangeType_async(const Test::AMD_TestIntf_opBoolRangeTypePtr&, - const std::pair<const bool*, const bool*>&, - const Ice::Current&); + const std::pair<const bool*, const bool*>&, + const Ice::Current&); virtual void opByteRangeType_async(const Test::AMD_TestIntf_opByteRangeTypePtr&, - const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>&, - const Ice::Current&); + const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>&, + const Ice::Current&); virtual void opVariableRangeType_async(const Test::AMD_TestIntf_opVariableRangeTypePtr&, - const std::pair<std::deque<Test::Variable>::const_iterator, - std::deque<Test::Variable>::const_iterator>&, - const Ice::Current&); + const std::pair<std::deque<Test::Variable>::const_iterator, + std::deque<Test::Variable>::const_iterator>&, + const Ice::Current&); virtual void opBoolSeq_async(const Test::AMD_TestIntf_opBoolSeqPtr&, - const std::deque<bool>&, - const Ice::Current&); + const std::deque<bool>&, + const Ice::Current&); virtual void opBoolList_async(const Test::AMD_TestIntf_opBoolListPtr&, - const Test::BoolList&, - const Ice::Current&); + const Test::BoolList&, + const Ice::Current&); virtual void opByteSeq_async(const Test::AMD_TestIntf_opByteSeqPtr&, - const std::deque<Ice::Byte>&, - const Ice::Current&); + const std::deque<Ice::Byte>&, + const Ice::Current&); virtual void opByteList_async(const Test::AMD_TestIntf_opByteListPtr&, - const Test::ByteList&, - const Ice::Current&); + const Test::ByteList&, + const Ice::Current&); virtual void opMyByteSeq_async(const Test::AMD_TestIntf_opMyByteSeqPtr&, - const MyByteSeq&, - const Ice::Current&); + const MyByteSeq&, + const Ice::Current&); virtual void opStringSeq_async(const Test::AMD_TestIntf_opStringSeqPtr&, - const std::deque<std::string>&, - const Ice::Current&); + const std::deque<std::string>&, + const Ice::Current&); virtual void opStringList_async(const Test::AMD_TestIntf_opStringListPtr&, - const Test::StringList&, - const Ice::Current&); + const Test::StringList&, + const Ice::Current&); virtual void opFixedSeq_async(const Test::AMD_TestIntf_opFixedSeqPtr&, - const std::deque<Test::Fixed>&, - const Ice::Current&); + const std::deque<Test::Fixed>&, + const Ice::Current&); virtual void opFixedList_async(const Test::AMD_TestIntf_opFixedListPtr&, - const Test::FixedList&, - const Ice::Current&); + const Test::FixedList&, + const Ice::Current&); virtual void opVariableSeq_async(const Test::AMD_TestIntf_opVariableSeqPtr&, - const std::deque<Test::Variable>&, - const Ice::Current&); + const std::deque<Test::Variable>&, + const Ice::Current&); virtual void opVariableList_async(const Test::AMD_TestIntf_opVariableListPtr&, - const Test::VariableList&, - const Ice::Current&); + const Test::VariableList&, + const Ice::Current&); virtual void opStringStringDictSeq_async(const Test::AMD_TestIntf_opStringStringDictSeqPtr&, - const std::deque<Test::StringStringDict>&, - const Ice::Current&); + const std::deque<Test::StringStringDict>&, + const Ice::Current&); virtual void opStringStringDictList_async(const Test::AMD_TestIntf_opStringStringDictListPtr&, - const Test::StringStringDictList&, - const Ice::Current&); + const Test::StringStringDictList&, + const Ice::Current&); virtual void opESeq_async(const Test::AMD_TestIntf_opESeqPtr&, - const std::deque<Test::E>&, - const Ice::Current&); + const std::deque<Test::E>&, + const Ice::Current&); virtual void opEList_async(const Test::AMD_TestIntf_opEListPtr&, - const Test::EList&, - const Ice::Current&); + const Test::EList&, + const Ice::Current&); virtual void opCPrxSeq_async(const Test::AMD_TestIntf_opCPrxSeqPtr&, - const std::deque<Test::CPrx>&, - const Ice::Current&); + const std::deque<Test::CPrx>&, + const Ice::Current&); virtual void opCPrxList_async(const Test::AMD_TestIntf_opCPrxListPtr&, - const Test::CPrxList&, - const Ice::Current&); + const Test::CPrxList&, + const Ice::Current&); virtual void opCSeq_async(const Test::AMD_TestIntf_opCSeqPtr&, - const std::deque<Test::CPtr>&, - const Ice::Current&); + const std::deque<Test::CPtr>&, + const Ice::Current&); virtual void opCList_async(const Test::AMD_TestIntf_opCListPtr&, - const Test::CList&, - const Ice::Current&); + const Test::CList&, + const Ice::Current&); virtual void opClassStruct_async(const ::Test::AMD_TestIntf_opClassStructPtr&, - const ::Test::ClassStructPtr&, - const ::Test::ClassStructSeq&, - const ::Ice::Current&); + const ::Test::ClassStructPtr&, + const ::Test::ClassStructSeq&, + const ::Ice::Current&); virtual void shutdown_async(const Test::AMD_TestIntf_shutdownPtr&, - const Ice::Current&); + const Ice::Current&); private: diff --git a/cpp/test/Ice/custom/TestI.cpp b/cpp/test/Ice/custom/TestI.cpp index e25e467d09a..df9e4f055da 100644 --- a/cpp/test/Ice/custom/TestI.cpp +++ b/cpp/test/Ice/custom/TestI.cpp @@ -17,8 +17,8 @@ TestIntfI::TestIntfI(const Ice::CommunicatorPtr& communicator) Test::DoubleSeq TestIntfI::opDoubleArray(const std::pair<const Ice::Double*, const Ice::Double*>& inSeq, - Test::DoubleSeq& outSeq, - const Ice::Current& current) + Test::DoubleSeq& outSeq, + const Ice::Current& current) { Test::DoubleSeq(inSeq.first, inSeq.second).swap(outSeq); return outSeq; @@ -26,8 +26,8 @@ TestIntfI::opDoubleArray(const std::pair<const Ice::Double*, const Ice::Double*> Test::BoolSeq TestIntfI::opBoolArray(const std::pair<const bool*, const bool*>& inSeq, - Test::BoolSeq& outSeq, - const Ice::Current& current) + Test::BoolSeq& outSeq, + const Ice::Current& current) { Test::BoolSeq(inSeq.first, inSeq.second).swap(outSeq); return outSeq; @@ -35,8 +35,8 @@ TestIntfI::opBoolArray(const std::pair<const bool*, const bool*>& inSeq, Test::ByteList TestIntfI::opByteArray(const std::pair<const Ice::Byte*, const Ice::Byte*>& inSeq, - Test::ByteList& outSeq, - const Ice::Current& current) + Test::ByteList& outSeq, + const Ice::Current& current) { Test::ByteList(inSeq.first, inSeq.second).swap(outSeq); return outSeq; @@ -44,8 +44,8 @@ TestIntfI::opByteArray(const std::pair<const Ice::Byte*, const Ice::Byte*>& inSe Test::VariableList TestIntfI::opVariableArray(const std::pair<const Test::Variable*, const Test::Variable*>& inSeq, - Test::VariableList& outSeq, - const Ice::Current& current) + Test::VariableList& outSeq, + const Ice::Current& current) { Test::VariableList(inSeq.first, inSeq.second).swap(outSeq); return outSeq; @@ -53,8 +53,8 @@ TestIntfI::opVariableArray(const std::pair<const Test::Variable*, const Test::Va Test::BoolSeq TestIntfI::opBoolRange(const std::pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>& inSeq, - Test::BoolSeq& outSeq, - const Ice::Current&) + Test::BoolSeq& outSeq, + const Ice::Current&) { Test::BoolSeq(inSeq.first, inSeq.second).swap(outSeq); return outSeq; @@ -62,8 +62,8 @@ TestIntfI::opBoolRange(const std::pair<Test::BoolSeq::const_iterator, Test::Bool Test::ByteList TestIntfI::opByteRange(const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& inSeq, - Test::ByteList& outSeq, - const Ice::Current&) + Test::ByteList& outSeq, + const Ice::Current&) { Test::ByteList(inSeq.first, inSeq.second).swap(outSeq); return outSeq; @@ -71,9 +71,9 @@ TestIntfI::opByteRange(const std::pair<Test::ByteList::const_iterator, Test::Byt Test::VariableList TestIntfI::opVariableRange( - const std::pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>& inSeq, - Test::VariableList& outSeq, - const Ice::Current&) + const std::pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>& inSeq, + Test::VariableList& outSeq, + const Ice::Current&) { Test::VariableList(inSeq.first, inSeq.second).swap(outSeq); return outSeq; @@ -81,8 +81,8 @@ TestIntfI::opVariableRange( Test::BoolSeq TestIntfI::opBoolRangeType(const std::pair<const bool*, const bool*>& inSeq, - Test::BoolSeq& outSeq, - const Ice::Current&) + Test::BoolSeq& outSeq, + const Ice::Current&) { Test::BoolSeq(inSeq.first, inSeq.second).swap(outSeq); return outSeq; @@ -90,8 +90,8 @@ TestIntfI::opBoolRangeType(const std::pair<const bool*, const bool*>& inSeq, Test::ByteList TestIntfI::opByteRangeType(const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& inSeq, - Test::ByteList& outSeq, - const Ice::Current&) + Test::ByteList& outSeq, + const Ice::Current&) { Test::ByteList(inSeq.first, inSeq.second).swap(outSeq); return outSeq; @@ -99,21 +99,21 @@ TestIntfI::opByteRangeType(const std::pair<Test::ByteList::const_iterator, Test: Test::VariableList TestIntfI::opVariableRangeType( - const std::pair<std::deque<Test::Variable>::const_iterator, std::deque<Test::Variable>::const_iterator>& inSeq, - Test::VariableList& outSeq, - const Ice::Current&) + const std::pair<std::deque<Test::Variable>::const_iterator, std::deque<Test::Variable>::const_iterator>& inSeq, + Test::VariableList& outSeq, + const Ice::Current&) { for(std::deque<Test::Variable>::const_iterator p = inSeq.first; p != inSeq.second; ++p) { - outSeq.push_back(*p); + outSeq.push_back(*p); } return outSeq; } std::deque<bool> TestIntfI::opBoolSeq(const std::deque<bool>& inSeq, - std::deque<bool>& outSeq, - const Ice::Current& current) + std::deque<bool>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -121,8 +121,8 @@ TestIntfI::opBoolSeq(const std::deque<bool>& inSeq, std::list<bool> TestIntfI::opBoolList(const std::list<bool>& inSeq, - std::list<bool>& outSeq, - const Ice::Current& current) + std::list<bool>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -130,8 +130,8 @@ TestIntfI::opBoolList(const std::list<bool>& inSeq, std::deque< ::Ice::Byte> TestIntfI::opByteSeq(const std::deque< ::Ice::Byte>& inSeq, - std::deque< ::Ice::Byte>& outSeq, - const Ice::Current& current) + std::deque< ::Ice::Byte>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -139,8 +139,8 @@ TestIntfI::opByteSeq(const std::deque< ::Ice::Byte>& inSeq, std::list< ::Ice::Byte> TestIntfI::opByteList(const std::list< ::Ice::Byte>& inSeq, - std::list< ::Ice::Byte>& outSeq, - const Ice::Current& current) + std::list< ::Ice::Byte>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -148,8 +148,8 @@ TestIntfI::opByteList(const std::list< ::Ice::Byte>& inSeq, MyByteSeq TestIntfI::opMyByteSeq(const MyByteSeq& inSeq, - MyByteSeq& outSeq, - const Ice::Current& current) + MyByteSeq& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -157,8 +157,8 @@ TestIntfI::opMyByteSeq(const MyByteSeq& inSeq, std::deque< ::std::string> TestIntfI::opStringSeq(const std::deque< ::std::string>& inSeq, - std::deque< ::std::string>& outSeq, - const Ice::Current& current) + std::deque< ::std::string>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -166,8 +166,8 @@ TestIntfI::opStringSeq(const std::deque< ::std::string>& inSeq, std::list< ::std::string> TestIntfI::opStringList(const std::list< ::std::string>& inSeq, - std::list< ::std::string>& outSeq, - const Ice::Current& current) + std::list< ::std::string>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -175,8 +175,8 @@ TestIntfI::opStringList(const std::list< ::std::string>& inSeq, std::deque< ::Test::Fixed> TestIntfI::opFixedSeq(const std::deque< ::Test::Fixed>& inSeq, - std::deque< ::Test::Fixed>& outSeq, - const Ice::Current& current) + std::deque< ::Test::Fixed>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -184,8 +184,8 @@ TestIntfI::opFixedSeq(const std::deque< ::Test::Fixed>& inSeq, std::list< ::Test::Fixed> TestIntfI::opFixedList(const std::list< ::Test::Fixed>& inSeq, - std::list< ::Test::Fixed>& outSeq, - const Ice::Current& current) + std::list< ::Test::Fixed>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -193,8 +193,8 @@ TestIntfI::opFixedList(const std::list< ::Test::Fixed>& inSeq, std::deque< ::Test::Variable> TestIntfI::opVariableSeq(const std::deque< ::Test::Variable>& inSeq, - std::deque< ::Test::Variable>& outSeq, - const Ice::Current& current) + std::deque< ::Test::Variable>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -202,8 +202,8 @@ TestIntfI::opVariableSeq(const std::deque< ::Test::Variable>& inSeq, std::list< ::Test::Variable> TestIntfI::opVariableList(const std::list< ::Test::Variable>& inSeq, - std::list< ::Test::Variable>& outSeq, - const Ice::Current& current) + std::list< ::Test::Variable>& outSeq, + const Ice::Current& current) { outSeq = inSeq; return inSeq; @@ -283,10 +283,10 @@ TestIntfI::opCList(const std::list< ::Test::CPtr>& inSeq, ::Test::ClassStructPtr TestIntfI::opClassStruct(const ::Test::ClassStructPtr& inS, - const ::Test::ClassStructSeq& inSeq, - ::Test::ClassStructPtr& out, - ::Test::ClassStructSeq& outSeq, - const Ice::Current&) + const ::Test::ClassStructSeq& inSeq, + ::Test::ClassStructPtr& out, + ::Test::ClassStructSeq& outSeq, + const Ice::Current&) { outSeq = inSeq; out = inS; diff --git a/cpp/test/Ice/custom/TestI.h b/cpp/test/Ice/custom/TestI.h index c8800c755e4..c0aaa4b4416 100644 --- a/cpp/test/Ice/custom/TestI.h +++ b/cpp/test/Ice/custom/TestI.h @@ -19,92 +19,92 @@ public: TestIntfI(const Ice::CommunicatorPtr&); virtual Test::DoubleSeq opDoubleArray(const std::pair<const Ice::Double*, const Ice::Double*>&, - Test::DoubleSeq&, - const Ice::Current&); + Test::DoubleSeq&, + const Ice::Current&); virtual Test::BoolSeq opBoolArray(const std::pair<const bool*, const bool*>&, - Test::BoolSeq&, - const Ice::Current&); + Test::BoolSeq&, + const Ice::Current&); virtual Test::ByteList opByteArray(const std::pair<const Ice::Byte*, const Ice::Byte*>&, - Test::ByteList&, - const Ice::Current&); + Test::ByteList&, + const Ice::Current&); virtual Test::VariableList opVariableArray(const std::pair<const Test::Variable*, const Test::Variable*>&, - Test::VariableList&, - const Ice::Current&); + Test::VariableList&, + const Ice::Current&); virtual Test::BoolSeq opBoolRange(const std::pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>&, - Test::BoolSeq&, - const Ice::Current&); + Test::BoolSeq&, + const Ice::Current&); virtual Test::ByteList opByteRange(const std::pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>&, - Test::ByteList&, - const Ice::Current&); + Test::ByteList&, + const Ice::Current&); virtual Test::VariableList opVariableRange(const std::pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>&, - Test::VariableList&, - const Ice::Current&); + Test::VariableList&, + const Ice::Current&); virtual Test::BoolSeq opBoolRangeType(const std::pair<const bool*, const bool*>&, - Test::BoolSeq&, - const Ice::Current&); + Test::BoolSeq&, + const Ice::Current&); virtual Test::ByteList opByteRangeType(const std::pair<Test::ByteList::const_iterator, - Test::ByteList::const_iterator>&, - Test::ByteList&, - const Ice::Current&); + Test::ByteList::const_iterator>&, + Test::ByteList&, + const Ice::Current&); virtual Test::VariableList opVariableRangeType(const std::pair<std::deque<Test::Variable>::const_iterator, - std::deque<Test::Variable>::const_iterator>&, - Test::VariableList&, - const Ice::Current&); + std::deque<Test::Variable>::const_iterator>&, + Test::VariableList&, + const Ice::Current&); virtual std::deque<bool> opBoolSeq(const std::deque<bool>&, - std::deque<bool>&, - const Ice::Current&); + std::deque<bool>&, + const Ice::Current&); virtual std::list<bool> opBoolList(const std::list<bool>&, - std::list<bool>&, - const Ice::Current&); + std::list<bool>&, + const Ice::Current&); virtual std::deque< ::Ice::Byte> opByteSeq(const std::deque< ::Ice::Byte>&, - std::deque< ::Ice::Byte>&, - const Ice::Current&); + std::deque< ::Ice::Byte>&, + const Ice::Current&); virtual std::list< ::Ice::Byte> opByteList(const std::list< ::Ice::Byte>&, - std::list< ::Ice::Byte>&, - const Ice::Current&); + std::list< ::Ice::Byte>&, + const Ice::Current&); virtual MyByteSeq opMyByteSeq(const MyByteSeq&, - MyByteSeq&, - const Ice::Current&); + MyByteSeq&, + const Ice::Current&); virtual std::deque< ::std::string> opStringSeq(const std::deque< ::std::string>&, - std::deque< ::std::string>&, - const Ice::Current&); + std::deque< ::std::string>&, + const Ice::Current&); virtual std::list< ::std::string> opStringList(const std::list< ::std::string>&, - std::list< ::std::string>&, - const Ice::Current&); + std::list< ::std::string>&, + const Ice::Current&); virtual std::deque< ::Test::Fixed> opFixedSeq(const std::deque< ::Test::Fixed>&, - std::deque< ::Test::Fixed>&, - const Ice::Current&); + std::deque< ::Test::Fixed>&, + const Ice::Current&); virtual std::list< ::Test::Fixed> opFixedList(const std::list< ::Test::Fixed>&, - std::list< ::Test::Fixed>&, - const Ice::Current&); + std::list< ::Test::Fixed>&, + const Ice::Current&); virtual std::deque< ::Test::Variable> opVariableSeq(const std::deque< ::Test::Variable>&, - std::deque< ::Test::Variable>&, - const Ice::Current&); + std::deque< ::Test::Variable>&, + const Ice::Current&); virtual std::list< ::Test::Variable> opVariableList(const std::list< ::Test::Variable>&, - std::list< ::Test::Variable>&, - const Ice::Current&); + std::list< ::Test::Variable>&, + const Ice::Current&); virtual std::deque< ::Test::StringStringDict> opStringStringDictSeq(const std::deque< ::Test::StringStringDict>&, std::deque< ::Test::StringStringDict>&, @@ -139,10 +139,10 @@ public: const Ice::Current&); virtual ::Test::ClassStructPtr opClassStruct(const ::Test::ClassStructPtr&, - const ::Test::ClassStructSeq&, - ::Test::ClassStructPtr& out, - ::Test::ClassStructSeq& outSeq, - const Ice::Current&); + const ::Test::ClassStructSeq&, + ::Test::ClassStructPtr& out, + ::Test::ClassStructSeq& outSeq, + const Ice::Current&); virtual void shutdown(const Ice::Current&); diff --git a/cpp/test/Ice/custom/WstringAMDI.cpp b/cpp/test/Ice/custom/WstringAMDI.cpp index 9e827b7e870..1663c138aea 100644 --- a/cpp/test/Ice/custom/WstringAMDI.cpp +++ b/cpp/test/Ice/custom/WstringAMDI.cpp @@ -11,24 +11,24 @@ void Test1::WstringClassI::opString_async(const ::Test1::AMD_WstringClass_opStringPtr& opStringCB, - const ::std::wstring& s1, - const Ice::Current& current) + const ::std::wstring& s1, + const Ice::Current& current) { opStringCB->ice_response(s1, s1); } void Test1::WstringClassI::opStruct_async(const ::Test1::AMD_WstringClass_opStructPtr& opStructCB, - const ::Test1::WstringStruct& s1, - const Ice::Current& current) + const ::Test1::WstringStruct& s1, + const Ice::Current& current) { opStructCB->ice_response(s1, s1); } void Test1::WstringClassI::throwExcept_async(const ::Test1::AMD_WstringClass_throwExceptPtr& throwExceptCB, - const ::std::wstring& reason, - const Ice::Current& current) + const ::std::wstring& reason, + const Ice::Current& current) { Test1::WstringException ex; ex.reason = reason; @@ -37,24 +37,24 @@ Test1::WstringClassI::throwExcept_async(const ::Test1::AMD_WstringClass_throwExc void Test2::WstringClassI::opString_async(const ::Test2::AMD_WstringClass_opStringPtr& opStringCB, - const ::std::wstring& s1, - const Ice::Current& current) + const ::std::wstring& s1, + const Ice::Current& current) { opStringCB->ice_response(s1, s1); } void Test2::WstringClassI::opStruct_async(const ::Test2::AMD_WstringClass_opStructPtr& opStructCB, - const ::Test2::WstringStruct& s1, - const Ice::Current& current) + const ::Test2::WstringStruct& s1, + const Ice::Current& current) { opStructCB->ice_response(s1, s1); } void Test2::WstringClassI::throwExcept_async(const ::Test2::AMD_WstringClass_throwExceptPtr& throwExceptCB, - const ::std::wstring& reason, - const Ice::Current& current) + const ::std::wstring& reason, + const Ice::Current& current) { Test2::WstringException ex; ex.reason = reason; diff --git a/cpp/test/Ice/custom/WstringAMDI.h b/cpp/test/Ice/custom/WstringAMDI.h index 2f5058c1f6a..a2eadd58cf4 100644 --- a/cpp/test/Ice/custom/WstringAMDI.h +++ b/cpp/test/Ice/custom/WstringAMDI.h @@ -20,16 +20,16 @@ class WstringClassI : virtual public WstringClass public: virtual void opString_async(const ::Test1::AMD_WstringClass_opStringPtr&, - const ::std::wstring&, - const Ice::Current&); + const ::std::wstring&, + const Ice::Current&); virtual void opStruct_async(const ::Test1::AMD_WstringClass_opStructPtr&, - const ::Test1::WstringStruct&, - const Ice::Current&); + const ::Test1::WstringStruct&, + const Ice::Current&); virtual void throwExcept_async(const ::Test1::AMD_WstringClass_throwExceptPtr&, - const ::std::wstring&, - const Ice::Current&); + const ::std::wstring&, + const Ice::Current&); }; } @@ -42,16 +42,16 @@ class WstringClassI : virtual public WstringClass public: virtual void opString_async(const ::Test2::AMD_WstringClass_opStringPtr&, - const ::std::wstring&, - const Ice::Current&); + const ::std::wstring&, + const Ice::Current&); virtual void opStruct_async(const ::Test2::AMD_WstringClass_opStructPtr&, - const ::Test2::WstringStruct&, - const Ice::Current&); + const ::Test2::WstringStruct&, + const Ice::Current&); virtual void throwExcept_async(const ::Test2::AMD_WstringClass_throwExceptPtr&, - const ::std::wstring&, - const Ice::Current&); + const ::std::wstring&, + const Ice::Current&); }; } diff --git a/cpp/test/Ice/custom/WstringI.cpp b/cpp/test/Ice/custom/WstringI.cpp index 75681f1f195..58af4234727 100644 --- a/cpp/test/Ice/custom/WstringI.cpp +++ b/cpp/test/Ice/custom/WstringI.cpp @@ -11,8 +11,8 @@ ::std::wstring Test1::WstringClassI::opString(const ::std::wstring& s1, - ::std::wstring& s2, - const Ice::Current& current) + ::std::wstring& s2, + const Ice::Current& current) { s2 = s1; return s1; @@ -20,8 +20,8 @@ Test1::WstringClassI::opString(const ::std::wstring& s1, ::Test1::WstringStruct Test1::WstringClassI::opStruct(const ::Test1::WstringStruct& s1, - ::Test1::WstringStruct& s2, - const Ice::Current& current) + ::Test1::WstringStruct& s2, + const Ice::Current& current) { s2 = s1; return s1; @@ -29,7 +29,7 @@ Test1::WstringClassI::opStruct(const ::Test1::WstringStruct& s1, void Test1::WstringClassI::throwExcept(const ::std::wstring& reason, - const Ice::Current& current) + const Ice::Current& current) { Test1::WstringException ex; ex.reason = reason; @@ -38,8 +38,8 @@ Test1::WstringClassI::throwExcept(const ::std::wstring& reason, ::std::wstring Test2::WstringClassI::opString(const ::std::wstring& s1, - ::std::wstring& s2, - const Ice::Current& current) + ::std::wstring& s2, + const Ice::Current& current) { s2 = s1; return s1; @@ -47,8 +47,8 @@ Test2::WstringClassI::opString(const ::std::wstring& s1, ::Test2::WstringStruct Test2::WstringClassI::opStruct(const ::Test2::WstringStruct& s1, - ::Test2::WstringStruct& s2, - const Ice::Current& current) + ::Test2::WstringStruct& s2, + const Ice::Current& current) { s2 = s1; return s1; @@ -56,7 +56,7 @@ Test2::WstringClassI::opStruct(const ::Test2::WstringStruct& s1, void Test2::WstringClassI::throwExcept(const ::std::wstring& reason, - const Ice::Current& current) + const Ice::Current& current) { Test2::WstringException ex; ex.reason = reason; diff --git a/cpp/test/Ice/custom/WstringI.h b/cpp/test/Ice/custom/WstringI.h index e785a8ed33f..87fa6397e38 100644 --- a/cpp/test/Ice/custom/WstringI.h +++ b/cpp/test/Ice/custom/WstringI.h @@ -20,15 +20,15 @@ class WstringClassI : virtual public WstringClass public: virtual ::std::wstring opString(const ::std::wstring&, - ::std::wstring&, - const Ice::Current&); + ::std::wstring&, + const Ice::Current&); virtual ::Test1::WstringStruct opStruct(const ::Test1::WstringStruct&, - ::Test1::WstringStruct&, - const Ice::Current&); + ::Test1::WstringStruct&, + const Ice::Current&); virtual void throwExcept(const ::std::wstring&, - const Ice::Current&); + const Ice::Current&); }; } @@ -41,15 +41,15 @@ class WstringClassI : virtual public WstringClass public: virtual ::std::wstring opString(const ::std::wstring&, - ::std::wstring&, - const Ice::Current&); + ::std::wstring&, + const Ice::Current&); virtual ::Test2::WstringStruct opStruct(const ::Test2::WstringStruct&, - ::Test2::WstringStruct&, - const Ice::Current&); + ::Test2::WstringStruct&, + const Ice::Current&); virtual void throwExcept(const ::std::wstring&, - const Ice::Current&); + const Ice::Current&); }; } diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp index ef140647a36..95009807260 100644 --- a/cpp/test/Ice/exceptions/AllTests.cpp +++ b/cpp/test/Ice/exceptions/AllTests.cpp @@ -39,7 +39,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> public: CallbackBase() : - _called(false) + _called(false) { } @@ -49,26 +49,26 @@ public: bool check() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - while(!_called) - { - if(!timedWait(IceUtil::Time::seconds(5))) - { - return false; - } - } - _called = false; - return true; + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + while(!_called) + { + if(!timedWait(IceUtil::Time::seconds(5))) + { + return false; + } + } + _called = false; + return true; } protected: void called() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - assert(!_called); - _called = true; - notify(); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + assert(!_called); + _called = true; + notify(); } private: @@ -82,24 +82,24 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const A& ex) - { - test(ex.aMem == 1); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const A& ex) + { + test(ex.aMem == 1); + } + catch(...) + { + test(false); + } + called(); } }; @@ -116,25 +116,25 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Ice::ObjectNotExistException& ex) - { - Ice::Identity id = _communicator->stringToIdentity("does not exist"); - test(ex.id == id); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Ice::ObjectNotExistException& ex) + { + Ice::Identity id = _communicator->stringToIdentity("does not exist"); + test(ex.id == id); + } + catch(...) + { + test(false); + } + called(); } private: @@ -150,24 +150,24 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Ice::FacetNotExistException& ex) - { - test(ex.facet == "no such facet"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Ice::FacetNotExistException& ex) + { + test(ex.facet == "no such facet"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -179,28 +179,28 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const A& ex) - { - test(ex.aMem == 1); - } - catch(const D& ex) - { - test(ex.dMem == -1); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const A& ex) + { + test(ex.aMem == 1); + } + catch(const D& ex) + { + test(ex.dMem == -1); + } + catch(...) + { + test(false); + } + called(); } }; @@ -212,25 +212,25 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const B& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const B& ex) + { + test(ex.aMem == 1); + test(ex.bMem == 2); + } + catch(...) + { + test(false); + } + called(); } }; @@ -242,26 +242,26 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const C& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const C& ex) + { + test(ex.aMem == 1); + test(ex.bMem == 2); + test(ex.cMem == 3); + } + catch(...) + { + test(false); + } + called(); } }; @@ -273,25 +273,25 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const B& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const B& ex) + { + test(ex.aMem == 1); + test(ex.bMem == 2); + } + catch(...) + { + test(false); + } + called(); } }; @@ -303,26 +303,26 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const C& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const C& ex) + { + test(ex.aMem == 1); + test(ex.bMem == 2); + test(ex.cMem == 3); + } + catch(...) + { + test(false); + } + called(); } }; @@ -334,26 +334,26 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const C& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const C& ex) + { + test(ex.aMem == 1); + test(ex.bMem == 2); + test(ex.cMem == 3); + } + catch(...) + { + test(false); + } + called(); } }; @@ -366,31 +366,31 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Mod::A& ex) - { - test(ex.aMem == 1); - test(ex.a2Mem == 2); - } + try + { + exc.ice_throw(); + } + catch(const Mod::A& ex) + { + test(ex.aMem == 1); + test(ex.a2Mem == 2); + } catch(const Ice::OperationNotExistException&) { // // This operation is not supported in Java. // } - catch(...) - { - test(false); - } - called(); + catch(...) + { + test(false); + } + called(); } }; @@ -404,23 +404,23 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownUserException&) - { - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Ice::UnknownUserException&) + { + } + catch(...) + { + test(false); + } + called(); } }; @@ -432,23 +432,23 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownUserException&) - { - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Ice::UnknownUserException&) + { + } + catch(...) + { + test(false); + } + called(); } }; @@ -460,23 +460,23 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownUserException&) - { - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Ice::UnknownUserException&) + { + } + catch(...) + { + test(false); + } + called(); } }; @@ -488,23 +488,23 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownLocalException&) - { - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Ice::UnknownLocalException&) + { + } + catch(...) + { + test(false); + } + called(); } }; @@ -516,23 +516,23 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownException&) - { - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Ice::UnknownException&) + { + } + catch(...) + { + test(false); + } + called(); } }; @@ -544,24 +544,24 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Ice::OperationNotExistException& ex) - { - test(ex.operation == "noSuchOperation"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Ice::OperationNotExistException& ex) + { + test(ex.operation == "noSuchOperation"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -572,107 +572,107 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) { cout << "testing object adapter registration exceptions... " << flush; { - Ice::ObjectAdapterPtr first; + Ice::ObjectAdapterPtr first; + try + { + first = communicator->createObjectAdapter("TestAdapter0"); + test(false); + } + catch(const Ice::InitializationException&) + { + // Expected + } + + communicator->getProperties()->setProperty("Ice.OA.TestAdapter0.Endpoints", "default"); + first = communicator->createObjectAdapter("TestAdapter0"); + try + { + Ice::ObjectAdapterPtr second = communicator->createObjectAdapter("TestAdapter0"); + test(false); + } + catch(const Ice::AlreadyRegisteredException&) + { + // Expected + } + try - { - first = communicator->createObjectAdapter("TestAdapter0"); - test(false); - } - catch(const Ice::InitializationException&) - { - // Expected - } - - communicator->getProperties()->setProperty("Ice.OA.TestAdapter0.Endpoints", "default"); - first = communicator->createObjectAdapter("TestAdapter0"); - try - { - Ice::ObjectAdapterPtr second = communicator->createObjectAdapter("TestAdapter0"); - test(false); - } - catch(const Ice::AlreadyRegisteredException&) - { - // Expected - } - - try - { - Ice::ObjectAdapterPtr second = - communicator->createObjectAdapterWithEndpoints("TestAdapter0", "ssl -h foo -p 12011 -t 10000"); - test(false); - } - catch(const Ice::AlreadyRegisteredException&) - { - // Expected. - } - // - // Properties must remain unaffected if an exception occurs. - // - test(communicator->getProperties()->getProperty("Ice.OA.TestAdapter0.Endpoints") == "default"); - first->deactivate(); + { + Ice::ObjectAdapterPtr second = + communicator->createObjectAdapterWithEndpoints("TestAdapter0", "ssl -h foo -p 12011 -t 10000"); + test(false); + } + catch(const Ice::AlreadyRegisteredException&) + { + // Expected. + } + // + // Properties must remain unaffected if an exception occurs. + // + test(communicator->getProperties()->getProperty("Ice.OA.TestAdapter0.Endpoints") == "default"); + first->deactivate(); } cout << "ok" << endl; cout << "testing servant registration exceptions... " << flush; { - communicator->getProperties()->setProperty("Ice.OA.TestAdapter1.Endpoints", "default"); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter1"); - Ice::ObjectPtr obj = new EmptyI; - adapter->add(obj, communicator->stringToIdentity("x")); - try - { - adapter->add(obj, communicator->stringToIdentity("x")); - test(false); - } - catch(const Ice::AlreadyRegisteredException&) - { - } - - adapter->remove(communicator->stringToIdentity("x")); - try - { - adapter->remove(communicator->stringToIdentity("x")); - test(false); - } - catch(const Ice::NotRegisteredException&) - { - } - - adapter->deactivate(); + communicator->getProperties()->setProperty("Ice.OA.TestAdapter1.Endpoints", "default"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter1"); + Ice::ObjectPtr obj = new EmptyI; + adapter->add(obj, communicator->stringToIdentity("x")); + try + { + adapter->add(obj, communicator->stringToIdentity("x")); + test(false); + } + catch(const Ice::AlreadyRegisteredException&) + { + } + + adapter->remove(communicator->stringToIdentity("x")); + try + { + adapter->remove(communicator->stringToIdentity("x")); + test(false); + } + catch(const Ice::NotRegisteredException&) + { + } + + adapter->deactivate(); } cout << "ok" << endl; cout << "testing servant locator registrations exceptions... " << flush; { - communicator->getProperties()->setProperty("Ice.OA.TestAdapter2.Endpoints", "default"); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter2"); - Ice::ServantLocatorPtr loc = new ServantLocatorI; - adapter->addServantLocator(loc, "x"); - try - { - adapter->addServantLocator(loc, "x"); - test(false); - } - catch(const Ice::AlreadyRegisteredException&) - { - } - - adapter->deactivate(); + communicator->getProperties()->setProperty("Ice.OA.TestAdapter2.Endpoints", "default"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter2"); + Ice::ServantLocatorPtr loc = new ServantLocatorI; + adapter->addServantLocator(loc, "x"); + try + { + adapter->addServantLocator(loc, "x"); + test(false); + } + catch(const Ice::AlreadyRegisteredException&) + { + } + + adapter->deactivate(); } cout << "ok" << endl; cout << "testing object factory registration exception... " << flush; { - Ice::ObjectFactoryPtr of = new ObjectFactoryI; - communicator->addObjectFactory(of, "x"); - try - { - communicator->addObjectFactory(of, "x"); - test(false); - } - catch(const Ice::AlreadyRegisteredException&) - { - } + Ice::ObjectFactoryPtr of = new ObjectFactoryI; + communicator->addObjectFactory(of, "x"); + try + { + communicator->addObjectFactory(of, "x"); + test(false); + } + catch(const Ice::AlreadyRegisteredException&) + { + } } cout << "ok" << endl; @@ -692,80 +692,80 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) try { - thrower->throwAasA(1); - test(false); + thrower->throwAasA(1); + test(false); } catch(const A& ex) { - test(ex.aMem == 1); + test(ex.aMem == 1); } catch(const Ice::Exception& ex) { - cout << ex << endl; - test(false); + cout << ex << endl; + test(false); } catch(...) { - test(false); + test(false); } try { - thrower->throwAorDasAorD(1); - test(false); + thrower->throwAorDasAorD(1); + test(false); } catch(const A& ex) { - test(ex.aMem == 1); + test(ex.aMem == 1); } catch(...) { - test(false); + test(false); } try { - thrower->throwAorDasAorD(-1); - test(false); + thrower->throwAorDasAorD(-1); + test(false); } catch(const D& ex) { - test(ex.dMem == -1); + test(ex.dMem == -1); } catch(...) { - test(false); + test(false); } try { - thrower->throwBasB(1, 2); - test(false); + thrower->throwBasB(1, 2); + test(false); } catch(const B& ex) { - test(ex.aMem == 1); - test(ex.bMem == 2); + test(ex.aMem == 1); + test(ex.bMem == 2); } catch(...) { - test(false); + test(false); } try { - thrower->throwCasC(1, 2, 3); - test(false); + thrower->throwCasC(1, 2, 3); + test(false); } catch(const C& ex) { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); + test(ex.aMem == 1); + test(ex.bMem == 2); + test(ex.cMem == 3); } catch(...) { - test(false); + test(false); } #if (!defined(_MSC_VER) || _MSC_VER >= 1300) @@ -774,23 +774,23 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) // try { - thrower->throwModA(1, 2); - test(false); + thrower->throwModA(1, 2); + test(false); } catch(const Mod::A& ex) { - test(ex.aMem == 1); - test(ex.a2Mem == 2); + test(ex.aMem == 1); + test(ex.a2Mem == 2); } catch(const Ice::OperationNotExistException&) { - // + // // This operation is not supported in Java. // } catch(...) { - test(false); + test(false); } #endif @@ -800,31 +800,31 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) try { - thrower->throwBasB(1, 2); - test(false); + thrower->throwBasB(1, 2); + test(false); } catch(const A& ex) { - test(ex.aMem == 1); + test(ex.aMem == 1); } catch(...) { - test(false); + test(false); } try { - thrower->throwCasC(1, 2, 3); - test(false); + thrower->throwCasC(1, 2, 3); + test(false); } catch(const B& ex) { - test(ex.aMem == 1); - test(ex.bMem == 2); + test(ex.aMem == 1); + test(ex.bMem == 2); } catch(...) { - test(false); + test(false); } #if (!defined(_MSC_VER) || _MSC_VER >= 1300) @@ -833,167 +833,167 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) // try { - thrower->throwModA(1, 2); - test(false); + thrower->throwModA(1, 2); + test(false); } catch(const A& ex) { - test(ex.aMem == 1); + test(ex.aMem == 1); } catch(const Ice::OperationNotExistException&) { - // + // // This operation is not supported in Java. // } catch(...) { - test(false); + test(false); } #endif cout << "ok" << endl; cout << "catching derived types... " << flush; - + try { - thrower->throwBasA(1, 2); - test(false); + thrower->throwBasA(1, 2); + test(false); } catch(const B& ex) { - test(ex.aMem == 1); - test(ex.bMem == 2); + test(ex.aMem == 1); + test(ex.bMem == 2); } catch(...) { - test(false); + test(false); } try { - thrower->throwCasA(1, 2, 3); - test(false); + thrower->throwCasA(1, 2, 3); + test(false); } catch(const C& ex) { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); + test(ex.aMem == 1); + test(ex.bMem == 2); + test(ex.cMem == 3); } catch(...) { - test(false); + test(false); } try { - thrower->throwCasB(1, 2, 3); - test(false); + thrower->throwCasB(1, 2, 3); + test(false); } catch(const C& ex) { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); + test(ex.aMem == 1); + test(ex.bMem == 2); + test(ex.cMem == 3); } catch(...) { - test(false); + test(false); } cout << "ok" << endl; if(thrower->supportsUndeclaredExceptions()) { - cout << "catching unknown user exception... " << flush; - - try - { - thrower->throwUndeclaredA(1); - test(false); - } - catch(const A& ex) - { - // - // We get the original exception with collocation - // optimization. - // - test(collocated); - test(ex.aMem == 1); - } - catch(const Ice::UnknownUserException&) - { - // - // We get an unknown user exception without collocation - // optimization. - // - test(!collocated); - } - catch(...) - { - test(false); - } - - try - { - thrower->throwUndeclaredB(1, 2); - test(false); - } - catch(const B& ex) - { - // - // We get the original exception with collocation - // optimization. - // - test(collocated); - test(ex.aMem == 1); - test(ex.bMem == 2); - } - catch(const Ice::UnknownUserException&) - { - // - // We get an unknown user exception without collocation - // optimization. - // - test(!collocated); - } - catch(...) - { - test(false); - } - - try - { - thrower->throwUndeclaredC(1, 2, 3); - test(false); - } - catch(const C& ex) - { - // - // We get the original exception with collocation - // optimization. - // - test(collocated); - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(const Ice::UnknownUserException&) - { - // - // We get an unknown user exception without - // collocation optimization. - // - test(!collocated); - } - catch(...) - { - test(false); - } - - cout << "ok" << endl; + cout << "catching unknown user exception... " << flush; + + try + { + thrower->throwUndeclaredA(1); + test(false); + } + catch(const A& ex) + { + // + // We get the original exception with collocation + // optimization. + // + test(collocated); + test(ex.aMem == 1); + } + catch(const Ice::UnknownUserException&) + { + // + // We get an unknown user exception without collocation + // optimization. + // + test(!collocated); + } + catch(...) + { + test(false); + } + + try + { + thrower->throwUndeclaredB(1, 2); + test(false); + } + catch(const B& ex) + { + // + // We get the original exception with collocation + // optimization. + // + test(collocated); + test(ex.aMem == 1); + test(ex.bMem == 2); + } + catch(const Ice::UnknownUserException&) + { + // + // We get an unknown user exception without collocation + // optimization. + // + test(!collocated); + } + catch(...) + { + test(false); + } + + try + { + thrower->throwUndeclaredC(1, 2, 3); + test(false); + } + catch(const C& ex) + { + // + // We get the original exception with collocation + // optimization. + // + test(collocated); + test(ex.aMem == 1); + test(ex.bMem == 2); + test(ex.cMem == 3); + } + catch(const Ice::UnknownUserException&) + { + // + // We get an unknown user exception without + // collocation optimization. + // + test(!collocated); + } + catch(...) + { + test(false); + } + + cout << "ok" << endl; } cout << "catching object not exist exception... " << flush; @@ -1001,18 +1001,18 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) Ice::Identity id = communicator->stringToIdentity("does not exist"); try { - ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower->ice_identity(id)); - thrower2->throwAasA(1); -// thrower2->ice_ping(); - test(false); + ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower->ice_identity(id)); + thrower2->throwAasA(1); +// thrower2->ice_ping(); + test(false); } catch(const Ice::ObjectNotExistException& ex) { - test(ex.id == id); + test(ex.id == id); } catch(...) { - test(false); + test(false); } cout << "ok" << endl; @@ -1021,20 +1021,20 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) try { - ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower, "no such facet"); - try - { - thrower2->ice_ping(); - test(false); - } - catch(const Ice::FacetNotExistException& ex) - { - test(ex.facet == "no such facet"); - } + ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower, "no such facet"); + try + { + thrower2->ice_ping(); + test(false); + } + catch(const Ice::FacetNotExistException& ex) + { + test(ex.facet == "no such facet"); + } } catch(...) { - test(false); + test(false); } cout << "ok" << endl; @@ -1043,17 +1043,17 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) try { - WrongOperationPrx thrower2 = WrongOperationPrx::uncheckedCast(thrower); - thrower2->noSuchOperation(); - test(false); + WrongOperationPrx thrower2 = WrongOperationPrx::uncheckedCast(thrower); + thrower2->noSuchOperation(); + test(false); } catch(const Ice::OperationNotExistException& ex) { - test(ex.operation == "noSuchOperation"); + test(ex.operation == "noSuchOperation"); } catch(...) { - test(false); + test(false); } cout << "ok" << endl; @@ -1062,28 +1062,28 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) try { - thrower->throwLocalException(); - test(false); + thrower->throwLocalException(); + test(false); } catch(const Ice::TimeoutException&) { - // - // We get the original exception with collocation - // optimization. - // - test(collocated); + // + // We get the original exception with collocation + // optimization. + // + test(collocated); } catch(const Ice::UnknownLocalException&) { - // - // We get an unknown local exception without collocation - // optimization. - // - test(!collocated); + // + // We get an unknown local exception without collocation + // optimization. + // + test(!collocated); } catch(...) { - test(false); + test(false); } cout << "ok" << endl; @@ -1092,180 +1092,180 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) try { - thrower->throwNonIceException(); - test(false); + thrower->throwNonIceException(); + test(false); } catch(const Ice::UnknownException&) { - // - // We get an unknown exception without collocation - // optimization. - // - assert(!collocated); + // + // We get an unknown exception without collocation + // optimization. + // + assert(!collocated); } catch(...) { - // - // We get the original exception with collocation - // optimization. - // - assert(collocated); + // + // We get the original exception with collocation + // optimization. + // + assert(collocated); } cout << "ok" << endl; if(!collocated) { - cout << "catching exact types with AMI... " << flush; - - { - AMI_Thrower_throwAasAIPtr cb = new AMI_Thrower_throwAasAI; - thrower->throwAasA_async(cb, 1); - test(cb->check()); - // Let's check if we can reuse the same callback object for another call. - thrower->throwAasA_async(cb, 1); - test(cb->check()); - } - - { - AMI_Thrower_throwAorDasAorDIPtr cb = new AMI_Thrower_throwAorDasAorDI; - thrower->throwAorDasAorD_async(cb, 1); - test(cb->check()); - } - - { - AMI_Thrower_throwAorDasAorDIPtr cb = new AMI_Thrower_throwAorDasAorDI; - thrower->throwAorDasAorD_async(cb, -1); - test(cb->check()); - } - - { - AMI_Thrower_throwBasBIPtr cb = new AMI_Thrower_throwBasBI; - thrower->throwBasB_async(cb, 1, 2); - test(cb->check()); - } - - { - AMI_Thrower_throwCasCIPtr cb = new AMI_Thrower_throwCasCI; - thrower->throwCasC_async(cb, 1, 2, 3); - test(cb->check()); - // Let's check if we can reuse the same callback object for another call. - thrower->throwCasC_async(cb, 1, 2, 3); - test(cb->check()); - } - + cout << "catching exact types with AMI... " << flush; + + { + AMI_Thrower_throwAasAIPtr cb = new AMI_Thrower_throwAasAI; + thrower->throwAasA_async(cb, 1); + test(cb->check()); + // Let's check if we can reuse the same callback object for another call. + thrower->throwAasA_async(cb, 1); + test(cb->check()); + } + + { + AMI_Thrower_throwAorDasAorDIPtr cb = new AMI_Thrower_throwAorDasAorDI; + thrower->throwAorDasAorD_async(cb, 1); + test(cb->check()); + } + + { + AMI_Thrower_throwAorDasAorDIPtr cb = new AMI_Thrower_throwAorDasAorDI; + thrower->throwAorDasAorD_async(cb, -1); + test(cb->check()); + } + + { + AMI_Thrower_throwBasBIPtr cb = new AMI_Thrower_throwBasBI; + thrower->throwBasB_async(cb, 1, 2); + test(cb->check()); + } + + { + AMI_Thrower_throwCasCIPtr cb = new AMI_Thrower_throwCasCI; + thrower->throwCasC_async(cb, 1, 2, 3); + test(cb->check()); + // Let's check if we can reuse the same callback object for another call. + thrower->throwCasC_async(cb, 1, 2, 3); + test(cb->check()); + } + #if (!defined(_MSC_VER) || _MSC_VER >= 1300) // // With VC6 SP5, there is no way to call ::A::__write from ::Mod::A // - { - AMI_Thrower_throwModAIPtr cb = new AMI_Thrower_throwModAI; - thrower->throwModA_async(cb, 1, 2); - test(cb->check()); - } + { + AMI_Thrower_throwModAIPtr cb = new AMI_Thrower_throwModAI; + thrower->throwModA_async(cb, 1, 2); + test(cb->check()); + } #endif - cout << "ok" << endl; - - cout << "catching derived types... " << flush; - - { - AMI_Thrower_throwBasAIPtr cb = new AMI_Thrower_throwBasAI; - thrower->throwBasA_async(cb, 1, 2); - test(cb->check()); - } - - { - AMI_Thrower_throwCasAIPtr cb = new AMI_Thrower_throwCasAI; - thrower->throwCasA_async(cb, 1, 2, 3); - test(cb->check()); - } - - { - AMI_Thrower_throwCasBIPtr cb = new AMI_Thrower_throwCasBI; - thrower->throwCasB_async(cb, 1, 2, 3); - test(cb->check()); - } - - cout << "ok" << endl; - - if(thrower->supportsUndeclaredExceptions()) - { - cout << "catching unknown user exception with AMI... " << flush; - - { - AMI_Thrower_throwUndeclaredAIPtr cb = new AMI_Thrower_throwUndeclaredAI; - thrower->throwUndeclaredA_async(cb, 1); - test(cb->check()); - } - - { - AMI_Thrower_throwUndeclaredBIPtr cb = new AMI_Thrower_throwUndeclaredBI; - thrower->throwUndeclaredB_async(cb, 1, 2); - test(cb->check()); - } - - { - AMI_Thrower_throwUndeclaredCIPtr cb = new AMI_Thrower_throwUndeclaredCI; - thrower->throwUndeclaredC_async(cb, 1, 2, 3); - test(cb->check()); - } - - cout << "ok" << endl; - } - - cout << "catching object not exist exception with AMI... " << flush; - - { - id = communicator->stringToIdentity("does not exist"); - ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower->ice_identity(id)); - AMI_Thrower_throwAasAObjectNotExistIPtr cb = new AMI_Thrower_throwAasAObjectNotExistI(communicator); - thrower2->throwAasA_async(cb, 1); - test(cb->check()); - } - - cout << "ok" << endl; - - cout << "catching facet not exist exception with AMI... " << flush; - - ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower, "no such facet"); - { - AMI_Thrower_throwAasAFacetNotExistIPtr cb = new AMI_Thrower_throwAasAFacetNotExistI; - thrower2->throwAasA_async(cb, 1); - test(cb->check()); - } - - cout << "ok" << endl; - - cout << "catching operation not exist exception with AMI... " << flush; - - { - AMI_WrongOperation_noSuchOperationIPtr cb = new AMI_WrongOperation_noSuchOperationI; - WrongOperationPrx thrower4 = WrongOperationPrx::uncheckedCast(thrower); - thrower4->noSuchOperation_async(cb); - test(cb->check()); - } - - cout << "ok" << endl; + cout << "ok" << endl; + + cout << "catching derived types... " << flush; + + { + AMI_Thrower_throwBasAIPtr cb = new AMI_Thrower_throwBasAI; + thrower->throwBasA_async(cb, 1, 2); + test(cb->check()); + } + + { + AMI_Thrower_throwCasAIPtr cb = new AMI_Thrower_throwCasAI; + thrower->throwCasA_async(cb, 1, 2, 3); + test(cb->check()); + } + + { + AMI_Thrower_throwCasBIPtr cb = new AMI_Thrower_throwCasBI; + thrower->throwCasB_async(cb, 1, 2, 3); + test(cb->check()); + } + + cout << "ok" << endl; + + if(thrower->supportsUndeclaredExceptions()) + { + cout << "catching unknown user exception with AMI... " << flush; + + { + AMI_Thrower_throwUndeclaredAIPtr cb = new AMI_Thrower_throwUndeclaredAI; + thrower->throwUndeclaredA_async(cb, 1); + test(cb->check()); + } + + { + AMI_Thrower_throwUndeclaredBIPtr cb = new AMI_Thrower_throwUndeclaredBI; + thrower->throwUndeclaredB_async(cb, 1, 2); + test(cb->check()); + } + + { + AMI_Thrower_throwUndeclaredCIPtr cb = new AMI_Thrower_throwUndeclaredCI; + thrower->throwUndeclaredC_async(cb, 1, 2, 3); + test(cb->check()); + } + + cout << "ok" << endl; + } + + cout << "catching object not exist exception with AMI... " << flush; + + { + id = communicator->stringToIdentity("does not exist"); + ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower->ice_identity(id)); + AMI_Thrower_throwAasAObjectNotExistIPtr cb = new AMI_Thrower_throwAasAObjectNotExistI(communicator); + thrower2->throwAasA_async(cb, 1); + test(cb->check()); + } + + cout << "ok" << endl; + + cout << "catching facet not exist exception with AMI... " << flush; + + ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower, "no such facet"); + { + AMI_Thrower_throwAasAFacetNotExistIPtr cb = new AMI_Thrower_throwAasAFacetNotExistI; + thrower2->throwAasA_async(cb, 1); + test(cb->check()); + } + + cout << "ok" << endl; + + cout << "catching operation not exist exception with AMI... " << flush; + + { + AMI_WrongOperation_noSuchOperationIPtr cb = new AMI_WrongOperation_noSuchOperationI; + WrongOperationPrx thrower4 = WrongOperationPrx::uncheckedCast(thrower); + thrower4->noSuchOperation_async(cb); + test(cb->check()); + } + + cout << "ok" << endl; - cout << "catching unknown local exception with AMI... " << flush; - - { - AMI_Thrower_throwLocalExceptionIPtr cb = new AMI_Thrower_throwLocalExceptionI; - thrower->throwLocalException_async(cb); - test(cb->check()); - } - - cout << "ok" << endl; - - cout << "catching unknown non-Ice exception with AMI... " << flush; - - AMI_Thrower_throwNonIceExceptionIPtr cb = new AMI_Thrower_throwNonIceExceptionI; - thrower->throwNonIceException_async(cb); - test(cb->check()); - - cout << "ok" << endl; - + cout << "catching unknown local exception with AMI... " << flush; + + { + AMI_Thrower_throwLocalExceptionIPtr cb = new AMI_Thrower_throwLocalExceptionI; + thrower->throwLocalException_async(cb); + test(cb->check()); + } + + cout << "ok" << endl; + + cout << "catching unknown non-Ice exception with AMI... " << flush; + + AMI_Thrower_throwNonIceExceptionIPtr cb = new AMI_Thrower_throwNonIceExceptionI; + thrower->throwNonIceException_async(cb); + test(cb->check()); + + cout << "ok" << endl; + } return thrower; diff --git a/cpp/test/Ice/exceptions/Client.cpp b/cpp/test/Ice/exceptions/Client.cpp index ddffc3942bc..684fb41d824 100644 --- a/cpp/test/Ice/exceptions/Client.cpp +++ b/cpp/test/Ice/exceptions/Client.cpp @@ -31,26 +31,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/exceptions/Collocated.cpp b/cpp/test/Ice/exceptions/Collocated.cpp index 7f609905298..19b9b0eff09 100644 --- a/cpp/test/Ice/exceptions/Collocated.cpp +++ b/cpp/test/Ice/exceptions/Collocated.cpp @@ -35,26 +35,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/exceptions/Server.cpp b/cpp/test/Ice/exceptions/Server.cpp index 566d3d98fc6..a21d497727d 100644 --- a/cpp/test/Ice/exceptions/Server.cpp +++ b/cpp/test/Ice/exceptions/Server.cpp @@ -34,26 +34,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/exceptions/ServerAMD.cpp b/cpp/test/Ice/exceptions/ServerAMD.cpp index 6e1985d2025..cb58072e087 100644 --- a/cpp/test/Ice/exceptions/ServerAMD.cpp +++ b/cpp/test/Ice/exceptions/ServerAMD.cpp @@ -34,26 +34,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/exceptions/Test.ice b/cpp/test/Ice/exceptions/Test.ice index 0844993df14..296d76f7005 100644 --- a/cpp/test/Ice/exceptions/Test.ice +++ b/cpp/test/Ice/exceptions/Test.ice @@ -43,7 +43,7 @@ module Mod { exception A extends ::Test::A { - int a2Mem; + int a2Mem; }; }; diff --git a/cpp/test/Ice/exceptions/TestAMD.ice b/cpp/test/Ice/exceptions/TestAMD.ice index a3efb41c18e..9c0eb3ad93b 100644 --- a/cpp/test/Ice/exceptions/TestAMD.ice +++ b/cpp/test/Ice/exceptions/TestAMD.ice @@ -39,7 +39,7 @@ module Mod { exception A extends ::Test::A { - int a2Mem; + int a2Mem; }; }; diff --git a/cpp/test/Ice/exceptions/TestAMDI.cpp b/cpp/test/Ice/exceptions/TestAMDI.cpp index 34aef3df1c0..8d2924f270f 100644 --- a/cpp/test/Ice/exceptions/TestAMDI.cpp +++ b/cpp/test/Ice/exceptions/TestAMDI.cpp @@ -19,7 +19,7 @@ ThrowerI::ThrowerI(const Ice::ObjectAdapterPtr& adapter) : void ThrowerI::shutdown_async(const AMD_Thrower_shutdownPtr& cb, - const Ice::Current&) + const Ice::Current&) { _adapter->getCommunicator()->shutdown(); cb->ice_response(); @@ -27,21 +27,21 @@ ThrowerI::shutdown_async(const AMD_Thrower_shutdownPtr& cb, void ThrowerI::supportsUndeclaredExceptions_async(const AMD_Thrower_supportsUndeclaredExceptionsPtr& cb, - const Ice::Current&) + const Ice::Current&) { cb->ice_response(true); } void ThrowerI::supportsAssertException_async(const AMD_Thrower_supportsAssertExceptionPtr& cb, - const Ice::Current&) + const Ice::Current&) { cb->ice_response(false); } void ThrowerI::throwAasA_async(const AMD_Thrower_throwAasAPtr& cb, - Ice::Int a, const Ice::Current&) + Ice::Int a, const Ice::Current&) { A ex; ex.aMem = a; @@ -50,25 +50,25 @@ ThrowerI::throwAasA_async(const AMD_Thrower_throwAasAPtr& cb, void ThrowerI::throwAorDasAorD_async(const AMD_Thrower_throwAorDasAorDPtr& cb, - Ice::Int a, const Ice::Current&) + Ice::Int a, const Ice::Current&) { if(a > 0) { - A ex; - ex.aMem = a; - cb->ice_exception(ex); + A ex; + ex.aMem = a; + cb->ice_exception(ex); } else { - D ex; - ex.dMem = a; - cb->ice_exception(ex); + D ex; + ex.dMem = a; + cb->ice_exception(ex); } } void ThrowerI::throwBasA_async(const AMD_Thrower_throwBasAPtr& cb, - Ice::Int a, Ice::Int b, const Ice::Current& current) + Ice::Int a, Ice::Int b, const Ice::Current& current) { B ex; ex.aMem = a; @@ -79,7 +79,7 @@ ThrowerI::throwBasA_async(const AMD_Thrower_throwBasAPtr& cb, void ThrowerI::throwCasA_async(const AMD_Thrower_throwCasAPtr& cb, - Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current& current) + Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current& current) { C ex; ex.aMem = a; @@ -90,7 +90,7 @@ ThrowerI::throwCasA_async(const AMD_Thrower_throwCasAPtr& cb, void ThrowerI::throwBasB_async(const AMD_Thrower_throwBasBPtr& cb, - Ice::Int a, Ice::Int b, const Ice::Current&) + Ice::Int a, Ice::Int b, const Ice::Current&) { B ex; ex.aMem = a; @@ -101,7 +101,7 @@ ThrowerI::throwBasB_async(const AMD_Thrower_throwBasBPtr& cb, void ThrowerI::throwCasB_async(const AMD_Thrower_throwCasBPtr& cb, - Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current& current) + Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current& current) { C ex; ex.aMem = a; @@ -112,7 +112,7 @@ ThrowerI::throwCasB_async(const AMD_Thrower_throwCasBPtr& cb, void ThrowerI::throwCasC_async(const AMD_Thrower_throwCasCPtr& cb, - Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current&) + Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current&) { C ex; ex.aMem = a; @@ -123,7 +123,7 @@ ThrowerI::throwCasC_async(const AMD_Thrower_throwCasCPtr& cb, void ThrowerI::throwModA_async(const AMD_Thrower_throwModAPtr& cb, - Ice::Int a, Ice::Int a2, const Ice::Current&) + Ice::Int a, Ice::Int a2, const Ice::Current&) { Mod::A ex; ex.aMem = a; @@ -134,7 +134,7 @@ ThrowerI::throwModA_async(const AMD_Thrower_throwModAPtr& cb, void ThrowerI::throwUndeclaredA_async(const AMD_Thrower_throwUndeclaredAPtr& cb, - Ice::Int a, const Ice::Current&) + Ice::Int a, const Ice::Current&) { A ex; ex.aMem = a; @@ -143,7 +143,7 @@ ThrowerI::throwUndeclaredA_async(const AMD_Thrower_throwUndeclaredAPtr& cb, void ThrowerI::throwUndeclaredB_async(const AMD_Thrower_throwUndeclaredBPtr& cb, - Ice::Int a, Ice::Int b, const Ice::Current&) + Ice::Int a, Ice::Int b, const Ice::Current&) { B ex; ex.aMem = a; @@ -154,7 +154,7 @@ ThrowerI::throwUndeclaredB_async(const AMD_Thrower_throwUndeclaredBPtr& cb, void ThrowerI::throwUndeclaredC_async(const AMD_Thrower_throwUndeclaredCPtr& cb, - Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current&) + Ice::Int a, Ice::Int b, Ice::Int c, const Ice::Current&) { C ex; ex.aMem = a; @@ -165,21 +165,21 @@ ThrowerI::throwUndeclaredC_async(const AMD_Thrower_throwUndeclaredCPtr& cb, void ThrowerI::throwLocalException_async(const AMD_Thrower_throwLocalExceptionPtr& cb, - const Ice::Current&) + const Ice::Current&) { cb->ice_exception(Ice::TimeoutException(__FILE__, __LINE__)); } void ThrowerI::throwNonIceException_async(const AMD_Thrower_throwNonIceExceptionPtr&, - const Ice::Current&) + const Ice::Current&) { throw int(12345); } void ThrowerI::throwAssertException_async(const AMD_Thrower_throwAssertExceptionPtr&, - const Ice::Current&) + const Ice::Current&) { assert(false); // Not supported in C++. } diff --git a/cpp/test/Ice/exceptions/TestAMDI.h b/cpp/test/Ice/exceptions/TestAMDI.h index 3b16b849d12..bdd7971b5fa 100644 --- a/cpp/test/Ice/exceptions/TestAMDI.h +++ b/cpp/test/Ice/exceptions/TestAMDI.h @@ -19,42 +19,42 @@ public: ThrowerI(const Ice::ObjectAdapterPtr&); virtual void shutdown_async(const Test::AMD_Thrower_shutdownPtr&, - const Ice::Current&); + const Ice::Current&); virtual void supportsUndeclaredExceptions_async(const Test::AMD_Thrower_supportsUndeclaredExceptionsPtr&, - const Ice::Current&); + const Ice::Current&); virtual void supportsAssertException_async(const Test::AMD_Thrower_supportsAssertExceptionPtr&, - const Ice::Current&); + const Ice::Current&); virtual void throwAasA_async(const Test::AMD_Thrower_throwAasAPtr&, - Ice::Int, const Ice::Current&); + Ice::Int, const Ice::Current&); virtual void throwAorDasAorD_async(const Test::AMD_Thrower_throwAorDasAorDPtr&, - Ice::Int, const Ice::Current&); + Ice::Int, const Ice::Current&); virtual void throwBasA_async(const Test::AMD_Thrower_throwBasAPtr&, - Ice::Int, Ice::Int, const Ice::Current&); + Ice::Int, Ice::Int, const Ice::Current&); virtual void throwCasA_async(const Test::AMD_Thrower_throwCasAPtr&, - Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); + Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); virtual void throwBasB_async(const Test::AMD_Thrower_throwBasBPtr&, - Ice::Int, Ice::Int, const Ice::Current&); + Ice::Int, Ice::Int, const Ice::Current&); virtual void throwCasB_async(const Test::AMD_Thrower_throwCasBPtr&, - Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); + Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); virtual void throwCasC_async(const Test::AMD_Thrower_throwCasCPtr&, - Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); + Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); virtual void throwModA_async(const Test::AMD_Thrower_throwModAPtr&, - Ice::Int, Ice::Int, const Ice::Current&); + Ice::Int, Ice::Int, const Ice::Current&); virtual void throwUndeclaredA_async(const Test::AMD_Thrower_throwUndeclaredAPtr&, - Ice::Int, const Ice::Current&); + Ice::Int, const Ice::Current&); virtual void throwUndeclaredB_async(const Test::AMD_Thrower_throwUndeclaredBPtr&, - Ice::Int, Ice::Int, const Ice::Current&); + Ice::Int, Ice::Int, const Ice::Current&); virtual void throwUndeclaredC_async(const Test::AMD_Thrower_throwUndeclaredCPtr&, - Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); + Ice::Int, Ice::Int, Ice::Int, const Ice::Current&); virtual void throwLocalException_async(const Test::AMD_Thrower_throwLocalExceptionPtr&, - const Ice::Current&); + const Ice::Current&); virtual void throwNonIceException_async(const Test::AMD_Thrower_throwNonIceExceptionPtr&, - const Ice::Current&); + const Ice::Current&); virtual void throwAssertException_async(const Test::AMD_Thrower_throwAssertExceptionPtr&, - const Ice::Current&); + const Ice::Current&); private: diff --git a/cpp/test/Ice/exceptions/TestI.cpp b/cpp/test/Ice/exceptions/TestI.cpp index 2b95046467f..05a1e1d7863 100644 --- a/cpp/test/Ice/exceptions/TestI.cpp +++ b/cpp/test/Ice/exceptions/TestI.cpp @@ -48,15 +48,15 @@ ThrowerI::throwAorDasAorD(Ice::Int a, const Ice::Current&) { if(a > 0) { - A ex; - ex.aMem = a; - throw ex; + A ex; + ex.aMem = a; + throw ex; } else { - D ex; - ex.dMem = a; - throw ex; + D ex; + ex.dMem = a; + throw ex; } } diff --git a/cpp/test/Ice/facets/AllTests.cpp b/cpp/test/Ice/facets/AllTests.cpp index 4122e0cc203..34090065ae0 100644 --- a/cpp/test/Ice/facets/AllTests.cpp +++ b/cpp/test/Ice/facets/AllTests.cpp @@ -29,8 +29,8 @@ allTests(const Ice::CommunicatorPtr& communicator) adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD"); try { - adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD"); - test(false); + adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD"); + test(false); } catch(Ice::AlreadyRegisteredException&) { @@ -38,8 +38,8 @@ allTests(const Ice::CommunicatorPtr& communicator) adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD"); try { - adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD"); - test(false); + adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD"); + test(false); } catch(Ice::NotRegisteredException&) { @@ -61,8 +61,8 @@ allTests(const Ice::CommunicatorPtr& communicator) test(fm["f2"] == obj2); try { - adapter->removeAllFacets(communicator->stringToIdentity("id1")); - test(false); + adapter->removeAllFacets(communicator->stringToIdentity("id1")); + test(false); } catch(Ice::NotRegisteredException&) { diff --git a/cpp/test/Ice/facets/Client.cpp b/cpp/test/Ice/facets/Client.cpp index 4932992110d..769e96f91e7 100644 --- a/cpp/test/Ice/facets/Client.cpp +++ b/cpp/test/Ice/facets/Client.cpp @@ -31,26 +31,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/facets/Collocated.cpp b/cpp/test/Ice/facets/Collocated.cpp index 77ceb993408..f1f5a14040a 100644 --- a/cpp/test/Ice/facets/Collocated.cpp +++ b/cpp/test/Ice/facets/Collocated.cpp @@ -40,26 +40,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/facets/Server.cpp b/cpp/test/Ice/facets/Server.cpp index cb4850bf414..34c8d3a10c7 100644 --- a/cpp/test/Ice/facets/Server.cpp +++ b/cpp/test/Ice/facets/Server.cpp @@ -39,26 +39,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/faultTolerance/AllTests.cpp b/cpp/test/Ice/faultTolerance/AllTests.cpp index abaf9d2ccd1..f450b1d5798 100644 --- a/cpp/test/Ice/faultTolerance/AllTests.cpp +++ b/cpp/test/Ice/faultTolerance/AllTests.cpp @@ -19,7 +19,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> public: CallbackBase() : - _called(false) + _called(false) { } @@ -29,26 +29,26 @@ public: bool check() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - while(!_called) - { - if(!timedWait(IceUtil::Time::seconds(30))) - { - return false; - } - } - _called = false; - return true; + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + while(!_called) + { + if(!timedWait(IceUtil::Time::seconds(30))) + { + return false; + } + } + _called = false; + return true; } protected: void called() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - assert(!_called); - _called = true; - notify(); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + assert(!_called); + _called = true; + notify(); } private: @@ -62,18 +62,18 @@ public: virtual void ice_response(Ice::Int pid) { - _pid = pid; - called(); + _pid = pid; + called(); } virtual void ice_exception(const Ice::Exception& ex) { - test(false); + test(false); } Ice::Int pid() const { - return _pid; + return _pid; } private: @@ -89,12 +89,12 @@ public: virtual void ice_response() { - called(); + called(); } virtual void ice_exception(const Ice::Exception&) { - test(false); + test(false); } }; @@ -106,27 +106,27 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& ex) { - try - { - ex.ice_throw(); - } - catch(const Ice::ConnectionLostException&) - { - } - catch(const Ice::ConnectFailedException&) - { - } - catch(Ice::Exception& ex) - { - cout << ex << endl; - test(false); - } - called(); + try + { + ex.ice_throw(); + } + catch(const Ice::ConnectionLostException&) + { + } + catch(const Ice::ConnectFailedException&) + { + } + catch(Ice::Exception& ex) + { + cout << ex << endl; + test(false); + } + called(); } }; @@ -136,27 +136,27 @@ class AMI_Test_idempotentAbortI : public AMI_TestIntf_idempotentAbort, public Ca { virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& ex) { - try - { - ex.ice_throw(); - } - catch(const Ice::ConnectionLostException&) - { - } - catch(const Ice::ConnectFailedException&) - { - } - catch(Ice::Exception& ex) - { - cout << ex << endl; - test(false); - } - called(); + try + { + ex.ice_throw(); + } + catch(const Ice::ConnectionLostException&) + { + } + catch(const Ice::ConnectFailedException&) + { + } + catch(Ice::Exception& ex) + { + cout << ex << endl; + test(false); + } + called(); } }; @@ -170,7 +170,7 @@ allTests(const Ice::CommunicatorPtr& communicator, const vector<int>& ports) ref << "test"; for(vector<int>::const_iterator p = ports.begin(); p != ports.end(); ++p) { - ref << ":default -t 60000 -p " << *p; + ref << ":default -t 60000 -p " << *p; } Ice::ObjectPrx base = communicator->stringToProxy(ref.str()); test(base); @@ -186,121 +186,121 @@ allTests(const Ice::CommunicatorPtr& communicator, const vector<int>& ports) bool ami = false; for(unsigned int i = 1, j = 0; i <= ports.size(); ++i, ++j) { - if(j > 3) - { - j = 0; - ami = !ami; - } - - if(!ami) - { - cout << "testing server #" << i << "... " << flush; - int pid = obj->pid(); - test(pid != oldPid); - cout << "ok" << endl; - oldPid = pid; - } - else - { - cout << "testing server #" << i << " with AMI... " << flush; - AMI_Test_pidIPtr cb = new AMI_Test_pidI(); - obj->pid_async(cb); - test(cb->check()); - int pid = cb->pid(); - test(pid != oldPid); - cout << "ok" << endl; - oldPid = pid; - } - - if(j == 0) - { - if(!ami) - { - cout << "shutting down server #" << i << "... " << flush; - obj->shutdown(); - cout << "ok" << endl; - } - else - { - cout << "shutting down server #" << i << " with AMI... " << flush; - AMI_Test_shutdownIPtr cb = new AMI_Test_shutdownI; - obj->shutdown_async(cb); - test(cb->check()); - cout << "ok" << endl; - } - } - else if(j == 1 || i + 1 > ports.size()) - { - if(!ami) - { - cout << "aborting server #" << i << "... " << flush; - try - { - obj->abort(); - test(false); - } - catch(const Ice::ConnectionLostException&) - { - cout << "ok" << endl; - } - catch(const Ice::ConnectFailedException&) - { - cout << "ok" << endl; - } - } - else - { - cout << "aborting server #" << i << " with AMI... " << flush; - AMI_Test_abortIPtr cb = new AMI_Test_abortI; - obj->abort_async(cb); - test(cb->check()); - cout << "ok" << endl; - } - } - else if(j == 2 || j == 3) - { - if(!ami) - { - cout << "aborting server #" << i << " and #" << i + 1 << " with idempotent call... " << flush; - try - { - obj->idempotentAbort(); - test(false); - } - catch(const Ice::ConnectionLostException&) - { - cout << "ok" << endl; - } - catch(const Ice::ConnectFailedException&) - { - cout << "ok" << endl; - } - } - else - { - cout << "aborting server #" << i << " and #" << i + 1 << " with idempotent AMI call... " << flush; - AMI_Test_idempotentAbortIPtr cb = new AMI_Test_idempotentAbortI; - obj->idempotentAbort_async(cb); - test(cb->check()); - cout << "ok" << endl; - } - - ++i; - } - else - { - assert(false); - } + if(j > 3) + { + j = 0; + ami = !ami; + } + + if(!ami) + { + cout << "testing server #" << i << "... " << flush; + int pid = obj->pid(); + test(pid != oldPid); + cout << "ok" << endl; + oldPid = pid; + } + else + { + cout << "testing server #" << i << " with AMI... " << flush; + AMI_Test_pidIPtr cb = new AMI_Test_pidI(); + obj->pid_async(cb); + test(cb->check()); + int pid = cb->pid(); + test(pid != oldPid); + cout << "ok" << endl; + oldPid = pid; + } + + if(j == 0) + { + if(!ami) + { + cout << "shutting down server #" << i << "... " << flush; + obj->shutdown(); + cout << "ok" << endl; + } + else + { + cout << "shutting down server #" << i << " with AMI... " << flush; + AMI_Test_shutdownIPtr cb = new AMI_Test_shutdownI; + obj->shutdown_async(cb); + test(cb->check()); + cout << "ok" << endl; + } + } + else if(j == 1 || i + 1 > ports.size()) + { + if(!ami) + { + cout << "aborting server #" << i << "... " << flush; + try + { + obj->abort(); + test(false); + } + catch(const Ice::ConnectionLostException&) + { + cout << "ok" << endl; + } + catch(const Ice::ConnectFailedException&) + { + cout << "ok" << endl; + } + } + else + { + cout << "aborting server #" << i << " with AMI... " << flush; + AMI_Test_abortIPtr cb = new AMI_Test_abortI; + obj->abort_async(cb); + test(cb->check()); + cout << "ok" << endl; + } + } + else if(j == 2 || j == 3) + { + if(!ami) + { + cout << "aborting server #" << i << " and #" << i + 1 << " with idempotent call... " << flush; + try + { + obj->idempotentAbort(); + test(false); + } + catch(const Ice::ConnectionLostException&) + { + cout << "ok" << endl; + } + catch(const Ice::ConnectFailedException&) + { + cout << "ok" << endl; + } + } + else + { + cout << "aborting server #" << i << " and #" << i + 1 << " with idempotent AMI call... " << flush; + AMI_Test_idempotentAbortIPtr cb = new AMI_Test_idempotentAbortI; + obj->idempotentAbort_async(cb); + test(cb->check()); + cout << "ok" << endl; + } + + ++i; + } + else + { + assert(false); + } } cout << "testing whether all servers are gone... " << flush; try { - obj->ice_ping(); - test(false); + obj->ice_ping(); + test(false); } catch(const Ice::LocalException&) { - cout << "ok" << endl; + cout << "ok" << endl; } } diff --git a/cpp/test/Ice/faultTolerance/Client.cpp b/cpp/test/Ice/faultTolerance/Client.cpp index 26332a7b4db..c7a9561d4ae 100644 --- a/cpp/test/Ice/faultTolerance/Client.cpp +++ b/cpp/test/Ice/faultTolerance/Client.cpp @@ -25,32 +25,32 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) vector<int> ports; for(int i = 1; i < argc; ++i) { - if(argv[i][0] == '-') - { - cerr << argv[0] << ": unknown option `" << argv[i] << "'" << endl; - usage(argv[0]); - return EXIT_FAILURE; - } + if(argv[i][0] == '-') + { + cerr << argv[0] << ": unknown option `" << argv[i] << "'" << endl; + usage(argv[0]); + return EXIT_FAILURE; + } - ports.push_back(atoi(argv[i])); + ports.push_back(atoi(argv[i])); } if(ports.empty()) { - cerr << argv[0] << ": no ports specified" << endl; - usage(argv[0]); - return EXIT_FAILURE; + cerr << argv[0] << ": no ports specified" << endl; + usage(argv[0]); + return EXIT_FAILURE; } try { - void allTests(const Ice::CommunicatorPtr&, const vector<int>&); - allTests(communicator, ports); + void allTests(const Ice::CommunicatorPtr&, const vector<int>&); + allTests(communicator, ports); } catch(const Ice::Exception& ex) { - cout << ex << endl; - test(false); + cout << ex << endl; + test(false); } return EXIT_SUCCESS; @@ -64,34 +64,34 @@ main(int argc, char* argv[]) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); - // - // This test aborts servers, so we don't want warnings. - // - initData.properties->setProperty("Ice.Warn.Connections", "0"); + // + // This test aborts servers, so we don't want warnings. + // + initData.properties->setProperty("Ice.Warn.Connections", "0"); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/faultTolerance/Server.cpp b/cpp/test/Ice/faultTolerance/Server.cpp index 90618e949d7..089190cee08 100644 --- a/cpp/test/Ice/faultTolerance/Server.cpp +++ b/cpp/test/Ice/faultTolerance/Server.cpp @@ -24,28 +24,28 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) int port = 0; for(int i = 1; i < argc; ++i) { - if(argv[i][0] == '-') - { - cerr << argv[0] << ": unknown option `" << argv[i] << "'" << endl; - usage(argv[0]); - return EXIT_FAILURE; - } + if(argv[i][0] == '-') + { + cerr << argv[0] << ": unknown option `" << argv[i] << "'" << endl; + usage(argv[0]); + return EXIT_FAILURE; + } - if(port > 0) - { - cerr << argv[0] << ": only one port can be specified" << endl; - usage(argv[0]); - return EXIT_FAILURE; - } + if(port > 0) + { + cerr << argv[0] << ": only one port can be specified" << endl; + usage(argv[0]); + return EXIT_FAILURE; + } - port = atoi(argv[i]); + port = atoi(argv[i]); } if(port <= 0) { - cerr << argv[0] << ": no port specified" << endl; - usage(argv[0]); - return EXIT_FAILURE; + cerr << argv[0] << ": no port specified" << endl; + usage(argv[0]); + return EXIT_FAILURE; } ostringstream endpts; @@ -68,34 +68,34 @@ main(int argc, char* argv[]) try { // - // In this test, we need a longer server idle time, otherwise - // our test servers may time out before they are used in the - // test. - // - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->setProperty("Ice.ServerIdleTime", "120"); // Two minutes. + // In this test, we need a longer server idle time, otherwise + // our test servers may time out before they are used in the + // test. + // + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + initData.properties->setProperty("Ice.ServerIdleTime", "120"); // Two minutes. - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/gc/Client.cpp b/cpp/test/Ice/gc/Client.cpp index 0e0f6fae130..86d599a91fb 100644 --- a/cpp/test/Ice/gc/Client.cpp +++ b/cpp/test/Ice/gc/Client.cpp @@ -45,12 +45,12 @@ struct N : public C { N() { - incNum(); + incNum(); } ~N() { - decNum(); + decNum(); } }; @@ -60,12 +60,12 @@ struct N2 : public C2 { N2() { - incNum(); + incNum(); } ~N2() { - decNum(); + decNum(); } }; @@ -75,12 +75,12 @@ struct NN : public Node { NN() { - incNum(); + incNum(); } ~NN() { - decNum(); + decNum(); } }; @@ -90,12 +90,12 @@ struct NL : public Leaf { NL() { - incNum(); + incNum(); } ~NL() { - decNum(); + decNum(); } }; @@ -107,138 +107,138 @@ public: GarbageProducer() { - _stop = false; + _stop = false; } virtual void run() { - ::IceUtil::ThreadControl t = getThreadControl(); - - while(true) - { - { - ::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); - if(_stop) - { - return; - } - } - - t.yield(); - - { - NPtr n = new N; - n->left = n; - } - - { - NPtr n = new N; - n->left = n; - n->right = n; - } - - { - NPtr n1 = new N; - NPtr n2 = new N; - n1->left = n2; - n2->left = n1; - } - - { - NPtr n1 = new N; - NPtr n2 = new N; - n1->left = n2; - n2->left = n1; - n1->right = n2; - n2->right = n1; - } - - { - NPtr n1 = new N; - NPtr n2 = new N; - n1->left = n2; - n2->left = n1; - n1->right = n1; - n2->right = n2; - } - - { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - n1->left = n2; - n2->left = n3; - n3->left = n1; - } - - { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - n1->left = n2; - n2->left = n3; - n3->left = n1; - n1->right = n2; - n2->right = n3; - n3->right = n1; - } - - { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - n1->left = n2; - n2->left = n3; - n3->left = n1; - n1->right = n3; - n2->right = n1; - n3->right = n2; - } - - { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - NPtr n4 = new N; - n1->left = n2; - n2->left = n1; - n2->right = n3; - n3->left = n4; - } - - { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - NPtr n4 = new N; - NPtr n5 = new N; - NPtr n6 = new N; - n1->left = n2; - n2->left = n1; - n2->right = n3; - n3->left = n4; - n4->right = n5; - n5->right = n6; - n6->right = n5; - } - } + ::IceUtil::ThreadControl t = getThreadControl(); + + while(true) + { + { + ::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); + if(_stop) + { + return; + } + } + + t.yield(); + + { + NPtr n = new N; + n->left = n; + } + + { + NPtr n = new N; + n->left = n; + n->right = n; + } + + { + NPtr n1 = new N; + NPtr n2 = new N; + n1->left = n2; + n2->left = n1; + } + + { + NPtr n1 = new N; + NPtr n2 = new N; + n1->left = n2; + n2->left = n1; + n1->right = n2; + n2->right = n1; + } + + { + NPtr n1 = new N; + NPtr n2 = new N; + n1->left = n2; + n2->left = n1; + n1->right = n1; + n2->right = n2; + } + + { + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + n1->left = n2; + n2->left = n3; + n3->left = n1; + } + + { + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + n1->left = n2; + n2->left = n3; + n3->left = n1; + n1->right = n2; + n2->right = n3; + n3->right = n1; + } + + { + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + n1->left = n2; + n2->left = n3; + n3->left = n1; + n1->right = n3; + n2->right = n1; + n3->right = n2; + } + + { + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + NPtr n4 = new N; + n1->left = n2; + n2->left = n1; + n2->right = n3; + n3->left = n4; + } + + { + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + NPtr n4 = new N; + NPtr n5 = new N; + NPtr n6 = new N; + n1->left = n2; + n2->left = n1; + n2->right = n3; + n3->left = n4; + n4->right = n5; + n5->right = n6; + n6->right = n5; + } + } } void stop() { - { - ::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); - _stop = true; - notify(); - } - getThreadControl().join(); + { + ::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); + _stop = true; + notify(); + } + getThreadControl().join(); } void randomWait() { - ::IceUtil::Time waitTime = ::IceUtil::Time::milliSeconds(10 + rand() % 50); - ::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); - timedWait(waitTime); + ::IceUtil::Time waitTime = ::IceUtil::Time::milliSeconds(10 + rand() % 50); + ::IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); + timedWait(waitTime); } private: @@ -258,10 +258,10 @@ MyApplication::run(int argc, char* argv[]) { cout << "testing single instance... " << flush; { - NPtr n = new N; - test(getNum() == 1); - Ice::collectGarbage(); - test(getNum() == 1); + NPtr n = new N; + test(getNum() == 1); + Ice::collectGarbage(); + test(getNum() == 1); } test(getNum() == 0); Ice::collectGarbage(); @@ -270,11 +270,11 @@ MyApplication::run(int argc, char* argv[]) cout << "testing single instance cycle... " << flush; { - NPtr n = new N; - n->left = n; - test(getNum() == 1); - Ice::collectGarbage(); - test(getNum() == 1); + NPtr n = new N; + n->left = n; + test(getNum() == 1); + Ice::collectGarbage(); + test(getNum() == 1); } test(getNum() == 1); Ice::collectGarbage(); @@ -283,12 +283,12 @@ MyApplication::run(int argc, char* argv[]) cout << "testing single instance cycle with double pointers... " << flush; { - NPtr n = new N; - n->left = n; - n->right = n; - test(getNum() == 1); - Ice::collectGarbage(); - test(getNum() == 1); + NPtr n = new N; + n->left = n; + n->right = n; + test(getNum() == 1); + Ice::collectGarbage(); + test(getNum() == 1); } test(getNum() == 1); Ice::collectGarbage(); @@ -297,13 +297,13 @@ MyApplication::run(int argc, char* argv[]) cout << "testing double instance cycle... " << flush; { - NPtr n1 = new N; - NPtr n2 = new N; - n1->left = n2; - n2->left = n1; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); + NPtr n1 = new N; + NPtr n2 = new N; + n1->left = n2; + n2->left = n1; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); } test(getNum() == 2); Ice::collectGarbage(); @@ -312,15 +312,15 @@ MyApplication::run(int argc, char* argv[]) cout << "testing double instance cycle with double pointers... " << flush; { - NPtr n1 = new N; - NPtr n2 = new N; - n1->left = n2; - n2->left = n1; - n1->right = n2; - n2->right = n1; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); + NPtr n1 = new N; + NPtr n2 = new N; + n1->left = n2; + n2->left = n1; + n1->right = n2; + n2->right = n1; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); } test(getNum() == 2); Ice::collectGarbage(); @@ -329,15 +329,15 @@ MyApplication::run(int argc, char* argv[]) cout << "testing double instance cycle with looped pointers... " << flush; { - NPtr n1 = new N; - NPtr n2 = new N; - n1->left = n2; - n2->left = n1; - n1->right = n1; - n2->right = n2; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); + NPtr n1 = new N; + NPtr n2 = new N; + n1->left = n2; + n2->left = n1; + n1->right = n1; + n2->right = n2; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); } test(getNum() == 2); Ice::collectGarbage(); @@ -346,15 +346,15 @@ MyApplication::run(int argc, char* argv[]) cout << "testing triple instance cycle... " << flush; { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - n1->left = n2; - n2->left = n3; - n3->left = n1; - test(getNum() == 3); - Ice::collectGarbage(); - test(getNum() == 3); + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + n1->left = n2; + n2->left = n3; + n3->left = n1; + test(getNum() == 3); + Ice::collectGarbage(); + test(getNum() == 3); } test(getNum() == 3); Ice::collectGarbage(); @@ -363,18 +363,18 @@ MyApplication::run(int argc, char* argv[]) cout << "testing triple instance cycle with double pointers... " << flush; { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - n1->left = n2; - n2->left = n3; - n3->left = n1; - n1->right = n2; - n2->right = n3; - n3->right = n1; - test(getNum() == 3); - Ice::collectGarbage(); - test(getNum() == 3); + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + n1->left = n2; + n2->left = n3; + n3->left = n1; + n1->right = n2; + n2->right = n3; + n3->right = n1; + test(getNum() == 3); + Ice::collectGarbage(); + test(getNum() == 3); } test(getNum() == 3); Ice::collectGarbage(); @@ -383,18 +383,18 @@ MyApplication::run(int argc, char* argv[]) cout << "testing triple instance cycle with opposing pointers... " << flush; { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - n1->left = n2; - n2->left = n3; - n3->left = n1; - n1->right = n3; - n2->right = n1; - n3->right = n2; - test(getNum() == 3); - Ice::collectGarbage(); - test(getNum() == 3); + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + n1->left = n2; + n2->left = n3; + n3->left = n1; + n1->right = n3; + n2->right = n1; + n3->right = n2; + test(getNum() == 3); + Ice::collectGarbage(); + test(getNum() == 3); } test(getNum() == 3); Ice::collectGarbage(); @@ -404,18 +404,18 @@ MyApplication::run(int argc, char* argv[]) cout << "testing cycle with trailing instances... " << flush; NPtr n; { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - NPtr n4 = new N; - n1->left = n2; - n2->left = n1; - n2->right = n3; - n3->left = n4; - n = n3; - test(getNum() == 4); - Ice::collectGarbage(); - test(getNum() == 4); + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + NPtr n4 = new N; + n1->left = n2; + n2->left = n1; + n2->right = n3; + n3->left = n4; + n = n3; + test(getNum() == 4); + Ice::collectGarbage(); + test(getNum() == 4); } test(getNum() == 4); Ice::collectGarbage(); @@ -428,23 +428,23 @@ MyApplication::run(int argc, char* argv[]) cout << "testing cycle with trailing instances and trailing cycle... " << flush; { - NPtr n1 = new N; - NPtr n2 = new N; - NPtr n3 = new N; - NPtr n4 = new N; - NPtr n5 = new N; - NPtr n6 = new N; - n1->left = n2; - n2->left = n1; - n2->right = n3; - n3->left = n4; - n4->right = n5; - n5->right = n6; - n6->right = n5; - n = n4; - test(getNum() == 6); - Ice::collectGarbage(); - test(getNum() == 6); + NPtr n1 = new N; + NPtr n2 = new N; + NPtr n3 = new N; + NPtr n4 = new N; + NPtr n5 = new N; + NPtr n6 = new N; + n1->left = n2; + n2->left = n1; + n2->right = n3; + n3->left = n4; + n4->right = n5; + n5->right = n6; + n6->right = n5; + n = n4; + test(getNum() == 6); + Ice::collectGarbage(); + test(getNum() == 6); } test(getNum() == 6); Ice::collectGarbage(); @@ -457,14 +457,14 @@ MyApplication::run(int argc, char* argv[]) cout << "testing sequence element cycle... " << flush; { - CSeq cs; - cs.push_back(new N); - cs.push_back(new N); - cs[0]->left = cs[1]; - cs[1]->left = cs[0]; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); + CSeq cs; + cs.push_back(new N); + cs.push_back(new N); + cs[0]->left = cs[1]; + cs[1]->left = cs[0]; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); } Ice::collectGarbage(); test(getNum() == 0); @@ -472,16 +472,16 @@ MyApplication::run(int argc, char* argv[]) cout << "testing dictionary element cycle... " << flush; { - CDict cd; - NPtr n1 = new N; - NPtr n2 = new N; - n1->left = n2; - n2->left = n1; - cd[0] = n1; - cd[1] = n2; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); + CDict cd; + NPtr n1 = new N; + NPtr n2 = new N; + n1->left = n2; + n2->left = n1; + cd[0] = n1; + cd[1] = n2; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); } Ice::collectGarbage(); test(getNum() == 0); @@ -489,18 +489,18 @@ MyApplication::run(int argc, char* argv[]) cout << "testing sequence of struct cycle... " << flush; { - SSeq ss; - S s; + SSeq ss; + S s; - ss.push_back(s); - ss.push_back(s); - ss[0].theC = new N; - ss[1].theC = new N; - ss[0].theC->left = ss[1].theC; - ss[1].theC->left = ss[0].theC; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); + ss.push_back(s); + ss.push_back(s); + ss[0].theC = new N; + ss[1].theC = new N; + ss[0].theC->left = ss[1].theC; + ss[1].theC->left = ss[0].theC; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); } Ice::collectGarbage(); test(getNum() == 0); @@ -508,18 +508,18 @@ MyApplication::run(int argc, char* argv[]) cout << "testing sequence of struct of dictionary cycle... " << flush; { - N2Ptr n2 = new N2; - S2 s2; + N2Ptr n2 = new N2; + S2 s2; - n2->theS2Seq.push_back(s2); - n2->theS2Seq.push_back(s2); - n2->theS2Seq[0].theC2Dict[0] = n2; - n2->theS2Seq[0].theC2Dict[1] = n2; - n2->theS2Seq[1].theC2Dict[0] = n2; - n2->theS2Seq[1].theC2Dict[1] = n2; - test(getNum() == 1); - Ice::collectGarbage(); - test(getNum() == 1); + n2->theS2Seq.push_back(s2); + n2->theS2Seq.push_back(s2); + n2->theS2Seq[0].theC2Dict[0] = n2; + n2->theS2Seq[0].theC2Dict[1] = n2; + n2->theS2Seq[1].theC2Dict[0] = n2; + n2->theS2Seq[1].theC2Dict[1] = n2; + test(getNum() == 1); + Ice::collectGarbage(); + test(getNum() == 1); } Ice::collectGarbage(); test(getNum() == 0); @@ -529,61 +529,61 @@ MyApplication::run(int argc, char* argv[]) { NNPtr nn = new NN; - nn->l = new NL; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); + nn->l = new NL; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); } Ice::collectGarbage(); test(getNum() == 0); { NLPtr p; - { - NNPtr nn = new NN; - p = new NL; - nn->l = p; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); - } - Ice::collectGarbage(); - test(getNum() == 1); + { + NNPtr nn = new NN; + p = new NL; + nn->l = p; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); + } + Ice::collectGarbage(); + test(getNum() == 1); } test(getNum() == 0); { - NNPtr nn = new NN; - NLPtr nl = new NL; - nn->l = nl; - nn->n = nn; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); + NNPtr nn = new NN; + NLPtr nl = new NL; + nn->l = nl; + nn->n = nn; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); } test(getNum() == 2); Ice::collectGarbage(); test(getNum() == 0); { - NNPtr nn1 = new NN; - NNPtr nn2 = new NN; - NLPtr nl = new NL; - nn1->l = nl; - nn1->n = nn2; - nn2->l = nl; - nn2->n = nn1; - test(getNum() == 3); - Ice::collectGarbage(); - test(getNum() == 3); + NNPtr nn1 = new NN; + NNPtr nn2 = new NN; + NLPtr nl = new NL; + nn1->l = nl; + nn1->n = nn2; + nn2->l = nl; + nn2->n = nn1; + test(getNum() == 3); + Ice::collectGarbage(); + test(getNum() == 3); } test(getNum() == 3); Ice::collectGarbage(); test(getNum() == 0); { - NLPtr nl = new NL; - test(getNum() == 1); + NLPtr nl = new NL; + test(getNum() == 1); } test(getNum() == 0); Ice::collectGarbage(); @@ -591,10 +591,10 @@ MyApplication::run(int argc, char* argv[]) { NNPtr nn1 = new NN; - nn1->n = new NN; - test(getNum() == 2); - Ice::collectGarbage(); - test(getNum() == 2); + nn1->n = new NN; + test(getNum() == 2); + Ice::collectGarbage(); + test(getNum() == 2); } test(getNum() == 0); Ice::collectGarbage(); @@ -619,12 +619,12 @@ MyApplication::run(int argc, char* argv[]) for(int i = 0; i < 50; ++i) { - if(interrupted()) - { - break; - } - garbageThread->randomWait(); - Ice::collectGarbage(); + if(interrupted()) + { + break; + } + garbageThread->randomWait(); + Ice::collectGarbage(); } garbageThread->stop(); @@ -632,13 +632,13 @@ MyApplication::run(int argc, char* argv[]) Ice::collectGarbage(); if(!interrupted()) { - test(getNum() == 0); - cout << "ok" << endl; - return EXIT_SUCCESS; + test(getNum() == 0); + cout << "ok" << endl; + return EXIT_SUCCESS; } else { - return 130; // SIGINT + 128 + return 130; // SIGINT + 128 } } diff --git a/cpp/test/Ice/gc/Test.ice b/cpp/test/Ice/gc/Test.ice index e2451aa5ceb..bc367837722 100644 --- a/cpp/test/Ice/gc/Test.ice +++ b/cpp/test/Ice/gc/Test.ice @@ -64,31 +64,31 @@ class Node // Sequence of structs defined above. -sequence<C2Dict> C2DictSeq; // Sequence of dictionary. +sequence<C2Dict> C2DictSeq; // Sequence of dictionary. -sequence<CSeq> CSeqSeq; // Sequence of sequence. +sequence<CSeq> CSeqSeq; // Sequence of sequence. // Struct containing classes defined above. -struct A // Struct containing sequence. +struct A // Struct containing sequence. { SSeq theSSeq; }; // Struct containing dictionary defined above. -struct B // Struct containing struct. +struct B // Struct containing struct. { S theS; }; // Dictionary of classes defined above. -dictionary<int, CSeq> CSeqDict; // Dictionary containing sequence. +dictionary<int, CSeq> CSeqDict; // Dictionary containing sequence. -dictionary<int, S> SDict; // Dictionary containing struct. +dictionary<int, S> SDict; // Dictionary containing struct. -dictionary<int, CDict> CDictDict; // Dictionary containing dictionary. +dictionary<int, CDict> CDictDict; // Dictionary containing dictionary. class CTest { @@ -114,18 +114,18 @@ module AAA dictionary<int, B> BDict; struct BStruct { - B bMem; + B bMem; }; class C { - Object obj1; - Object obj2; + Object obj1; + Object obj2; B b1; B b2; BSeq x; - BDict y; - BStruct z; + BDict y; + BStruct z; }; }; @@ -135,18 +135,18 @@ module AAA dictionary<int, C> CDict; struct CStruct { - C cMem; + C cMem; }; class B { - Object obj1; - Object obj2; - C c1; - C c2; + Object obj1; + Object obj2; + C c1; + C c2; CSeq x; - CDict y; - CStruct z; + CDict y; + CStruct z; }; }; @@ -167,24 +167,24 @@ module DDD { interface I { - void op(); + void op(); }; class C { - void op(); + void op(); }; class C2; class U { - I myI; - I* myIstar; - C myC; - C* myCstar; - C2 myC2; - C2* myC2star; + I myI; + I* myIstar; + C myC; + C* myCstar; + C2 myC2; + C2* myC2star; }; class C2 diff --git a/cpp/test/Ice/hold/AllTests.cpp b/cpp/test/Ice/hold/AllTests.cpp index 656afd3f066..929fdcf53b8 100644 --- a/cpp/test/Ice/hold/AllTests.cpp +++ b/cpp/test/Ice/hold/AllTests.cpp @@ -32,7 +32,7 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "changing state between active and hold rapidly... " << flush; for(int i = 0; i < 100; ++i) { - hold->putOnHold(0); + hold->putOnHold(0); } cout << "ok" << endl; diff --git a/cpp/test/Ice/hold/Client.cpp b/cpp/test/Ice/hold/Client.cpp index aaa0e585955..0162051684d 100644 --- a/cpp/test/Ice/hold/Client.cpp +++ b/cpp/test/Ice/hold/Client.cpp @@ -30,26 +30,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/hold/Server.cpp b/cpp/test/Ice/hold/Server.cpp index 1b4c0a5784e..ba0dfe8fbba 100644 --- a/cpp/test/Ice/hold/Server.cpp +++ b/cpp/test/Ice/hold/Server.cpp @@ -32,26 +32,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/hold/TestI.cpp b/cpp/test/Ice/hold/TestI.cpp index bd5200168e5..63015a458f9 100644 --- a/cpp/test/Ice/hold/TestI.cpp +++ b/cpp/test/Ice/hold/TestI.cpp @@ -15,12 +15,12 @@ HoldI::putOnHold(Ice::Int seconds, const Ice::Current& current) { if(seconds <= 0) { - current.adapter->hold(); - current.adapter->activate(); + current.adapter->hold(); + current.adapter->activate(); } else { - assert(false); // TODO + assert(false); // TODO } } diff --git a/cpp/test/Ice/inheritance/Client.cpp b/cpp/test/Ice/inheritance/Client.cpp index 5e73131b1c9..cd9f5e04e0e 100644 --- a/cpp/test/Ice/inheritance/Client.cpp +++ b/cpp/test/Ice/inheritance/Client.cpp @@ -31,26 +31,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/inheritance/Collocated.cpp b/cpp/test/Ice/inheritance/Collocated.cpp index da1f7d58fe7..215c3a5e3b6 100644 --- a/cpp/test/Ice/inheritance/Collocated.cpp +++ b/cpp/test/Ice/inheritance/Collocated.cpp @@ -35,26 +35,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/inheritance/Server.cpp b/cpp/test/Ice/inheritance/Server.cpp index 20635c31e8f..a28e1fa33a8 100644 --- a/cpp/test/Ice/inheritance/Server.cpp +++ b/cpp/test/Ice/inheritance/Server.cpp @@ -32,26 +32,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/inheritance/TestI.h b/cpp/test/Ice/inheritance/TestI.h index 90cbb433848..72918965061 100644 --- a/cpp/test/Ice/inheritance/TestI.h +++ b/cpp/test/Ice/inheritance/TestI.h @@ -74,7 +74,7 @@ class IB1I : virtual public Test::MB::IB1, virtual public IAI { public: - virtual Test::MB::IB1Prx ib1op(const Test::MB::IB1Prx&, const Ice::Current&); + virtual Test::MB::IB1Prx ib1op(const Test::MB::IB1Prx&, const Ice::Current&); }; class IB2I : virtual public Test::MB::IB2, virtual public IAI diff --git a/cpp/test/Ice/location/AllTests.cpp b/cpp/test/Ice/location/AllTests.cpp index 8250e3c8701..c5993bb19fe 100644 --- a/cpp/test/Ice/location/AllTests.cpp +++ b/cpp/test/Ice/location/AllTests.cpp @@ -23,7 +23,7 @@ public: virtual void sayHello(const Ice::Current& foo) { - // Do nothing, this is just a dummy servant. + // Do nothing, this is just a dummy servant. } }; @@ -101,13 +101,13 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) manager->startServer(); try { - obj2 = TestIntfPrx::checkedCast(base2); - obj2->ice_ping(); + obj2 = TestIntfPrx::checkedCast(base2); + obj2->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } cout << "ok" << endl; @@ -116,13 +116,13 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) manager->startServer(); try { - obj6 = TestIntfPrx::checkedCast(base6); - obj6->ice_ping(); + obj6 = TestIntfPrx::checkedCast(base6); + obj6->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } cout << "ok" << endl; @@ -131,123 +131,123 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) manager->startServer(); try { - obj3 = TestIntfPrx::checkedCast(base3); - obj3->ice_ping(); + obj3 = TestIntfPrx::checkedCast(base3); + obj3->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } try { - obj2 = TestIntfPrx::checkedCast(base2); - obj2->ice_ping(); + obj2 = TestIntfPrx::checkedCast(base2); + obj2->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } obj->shutdown(); manager->startServer(); try { - obj2 = TestIntfPrx::checkedCast(base2); - obj2->ice_ping(); + obj2 = TestIntfPrx::checkedCast(base2); + obj2->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } try { - obj3 = TestIntfPrx::checkedCast(base3); - obj3->ice_ping(); + obj3 = TestIntfPrx::checkedCast(base3); + obj3->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } obj->shutdown(); manager->startServer(); try { - obj2 = TestIntfPrx::checkedCast(base2); - obj2->ice_ping(); + obj2 = TestIntfPrx::checkedCast(base2); + obj2->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } obj->shutdown(); manager->startServer(); try { - obj3 = TestIntfPrx::checkedCast(base3); - obj3->ice_ping(); + obj3 = TestIntfPrx::checkedCast(base3); + obj3->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } obj->shutdown(); manager->startServer(); try { - obj2 = TestIntfPrx::checkedCast(base2); - obj2->ice_ping(); + obj2 = TestIntfPrx::checkedCast(base2); + obj2->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } obj->shutdown(); manager->startServer(); try { - obj5 = TestIntfPrx::checkedCast(base5); - obj5->ice_ping(); + obj5 = TestIntfPrx::checkedCast(base5); + obj5->ice_ping(); } catch(const Ice::LocalException& ex) { - cerr << ex << endl; - test(false); + cerr << ex << endl; + test(false); } cout << "ok" << endl; cout << "testing proxy with unknown identity... " << flush; try { - base = communicator->stringToProxy("unknown/unknown"); - base->ice_ping(); - test(false); + base = communicator->stringToProxy("unknown/unknown"); + base->ice_ping(); + test(false); } catch (const Ice::NotRegisteredException& ex) { - test(ex.kindOfObject == "object"); - test(ex.id == "unknown/unknown"); + test(ex.kindOfObject == "object"); + test(ex.id == "unknown/unknown"); } cout << "ok" << endl; cout << "testing proxy with unknown adapter... " << flush; try { - base = communicator->stringToProxy("test @ TestAdapterUnknown"); - base->ice_ping(); - test(false); + base = communicator->stringToProxy("test @ TestAdapterUnknown"); + base->ice_ping(); + test(false); } catch (const Ice::NotRegisteredException& ex) { - test(ex.kindOfObject == "object adapter"); - test(ex.id == "TestAdapterUnknown"); + test(ex.kindOfObject == "object adapter"); + test(ex.id == "TestAdapterUnknown"); } cout << "ok" << endl; @@ -319,24 +319,24 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) cout << "testing whether server is gone... " << flush; try { - obj2->ice_ping(); - test(false); + obj2->ice_ping(); + test(false); } catch(const Ice::LocalException&) { } try { - obj3->ice_ping(); - test(false); + obj3->ice_ping(); + test(false); } catch(const Ice::LocalException&) { } try { - obj5->ice_ping(); - test(false); + obj5->ice_ping(); + test(false); } catch(const Ice::LocalException&) { @@ -362,9 +362,9 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) try { - HelloPrx helloPrx = HelloPrx::checkedCast(communicator->stringToProxy(communicator->identityToString(id))); - Ice::ConnectionPtr connection = helloPrx->ice_getConnection(); - test(false); + HelloPrx helloPrx = HelloPrx::checkedCast(communicator->stringToProxy(communicator->identityToString(id))); + Ice::ConnectionPtr connection = helloPrx->ice_getConnection(); + test(false); } catch(const Ice::CollocationOptimizationException&) { diff --git a/cpp/test/Ice/location/Client.cpp b/cpp/test/Ice/location/Client.cpp index aa5e1d2d4cc..410164bb3fd 100644 --- a/cpp/test/Ice/location/Client.cpp +++ b/cpp/test/Ice/location/Client.cpp @@ -30,28 +30,28 @@ main(int argc, char* argv[]) try { Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->setProperty("Ice.Default.Locator", "locator:default -p 12010"); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator); + initData.properties = Ice::createProperties(argc, argv); + initData.properties->setProperty("Ice.Default.Locator", "locator:default -p 12010"); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/location/Server.cpp b/cpp/test/Ice/location/Server.cpp index e76326f9e0d..e327819beb1 100644 --- a/cpp/test/Ice/location/Server.cpp +++ b/cpp/test/Ice/location/Server.cpp @@ -39,7 +39,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator, adapter->add(object, communicator->stringToIdentity("ServerManager")); Ice::LocatorRegistryPrx registryPrx = - Ice::LocatorRegistryPrx::uncheckedCast(adapter->add(registry, communicator->stringToIdentity("registry"))); + Ice::LocatorRegistryPrx::uncheckedCast(adapter->add(registry, communicator->stringToIdentity("registry"))); Ice::LocatorPtr locator = new ServerLocator(registry, registryPrx); adapter->add(locator, communicator->stringToIdentity("locator")); @@ -58,30 +58,30 @@ main(int argc, char* argv[]) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - communicator = Ice::initialize(argc, argv, initData); - assert(initData.properties != communicator->getProperties()); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + communicator = Ice::initialize(argc, argv, initData); + assert(initData.properties != communicator->getProperties()); - status = run(argc, argv, communicator, initData); + status = run(argc, argv, communicator, initData); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/location/ServerLocator.cpp b/cpp/test/Ice/location/ServerLocator.cpp index c6fe03a8c1e..b6eb03caba3 100644 --- a/cpp/test/Ice/location/ServerLocator.cpp +++ b/cpp/test/Ice/location/ServerLocator.cpp @@ -19,8 +19,8 @@ ServerLocatorRegistry::ServerLocatorRegistry() void ServerLocatorRegistry::setAdapterDirectProxy_async(const Ice::AMD_LocatorRegistry_setAdapterDirectProxyPtr& cb, - const std::string& adapter, const ::Ice::ObjectPrx& object, - const ::Ice::Current&) + const std::string& adapter, const ::Ice::ObjectPrx& object, + const ::Ice::Current&) { _adapters[adapter] = object; cb->ice_response(); @@ -39,7 +39,7 @@ ServerLocatorRegistry::setReplicatedAdapterDirectProxy_async( void ServerLocatorRegistry::setServerProcessProxy_async(const Ice::AMD_LocatorRegistry_setServerProcessProxyPtr& cb, - const ::std::string&, const Ice::ProcessPrx&, const ::Ice::Current&) + const ::std::string&, const Ice::ProcessPrx&, const ::Ice::Current&) { cb->ice_response(); } @@ -56,7 +56,7 @@ ServerLocatorRegistry::getAdapter(const ::std::string& adapter) const ::std::map< string, ::Ice::ObjectPrx>::const_iterator p = _adapters.find(adapter); if(_adapters.find(adapter) == _adapters.end()) { - throw Ice::AdapterNotFoundException(); + throw Ice::AdapterNotFoundException(); } return p->second; } @@ -67,7 +67,7 @@ ServerLocatorRegistry::getObject(const ::Ice::Identity& id) const ::std::map< ::Ice::Identity, ::Ice::ObjectPrx>::const_iterator p = _objects.find(id); if(p == _objects.end()) { - throw Ice::ObjectNotFoundException(); + throw Ice::ObjectNotFoundException(); } return p->second; @@ -88,7 +88,7 @@ ServerLocator::ServerLocator(const ServerLocatorRegistryPtr& registry, const ::I void ServerLocator::findObjectById_async(const Ice::AMD_Locator_findObjectByIdPtr& response, const Ice::Identity& id, - const Ice::Current& current) const + const Ice::Current& current) const { ++const_cast<int&>(_requestCount); response->ice_response(_registry->getObject(id)); @@ -96,7 +96,7 @@ ServerLocator::findObjectById_async(const Ice::AMD_Locator_findObjectByIdPtr& re void ServerLocator::findAdapterById_async(const Ice::AMD_Locator_findAdapterByIdPtr& response, const string& id, - const Ice::Current& current) const + const Ice::Current& current) const { ++const_cast<int&>(_requestCount); response->ice_response(_registry->getAdapter(id)); diff --git a/cpp/test/Ice/location/ServerLocator.h b/cpp/test/Ice/location/ServerLocator.h index 7b2a7131cd9..73da5c18e8d 100644 --- a/cpp/test/Ice/location/ServerLocator.h +++ b/cpp/test/Ice/location/ServerLocator.h @@ -21,12 +21,12 @@ public: ServerLocatorRegistry(); virtual void setAdapterDirectProxy_async(const Ice::AMD_LocatorRegistry_setAdapterDirectProxyPtr&, - const ::std::string&, const ::Ice::ObjectPrx&, const ::Ice::Current&); + const ::std::string&, const ::Ice::ObjectPrx&, const ::Ice::Current&); virtual void setReplicatedAdapterDirectProxy_async( - const Ice::AMD_LocatorRegistry_setReplicatedAdapterDirectProxyPtr&, - const std::string&, const ::std::string&, const ::Ice::ObjectPrx&, const ::Ice::Current&); + const Ice::AMD_LocatorRegistry_setReplicatedAdapterDirectProxyPtr&, + const std::string&, const ::std::string&, const ::Ice::ObjectPrx&, const ::Ice::Current&); virtual void setServerProcessProxy_async(const Ice::AMD_LocatorRegistry_setServerProcessProxyPtr&, - const ::std::string&, const ::Ice::ProcessPrx&, const ::Ice::Current&); + const ::std::string&, const ::Ice::ProcessPrx&, const ::Ice::Current&); void addObject(const ::Ice::ObjectPrx&, const ::Ice::Current&); // @@ -51,10 +51,10 @@ public: ServerLocator(const ::ServerLocatorRegistryPtr&, const ::Ice::LocatorRegistryPrx&); virtual void findObjectById_async(const ::Ice::AMD_Locator_findObjectByIdPtr&, const ::Ice::Identity&, - const ::Ice::Current&) const; + const ::Ice::Current&) const; virtual void findAdapterById_async(const ::Ice::AMD_Locator_findAdapterByIdPtr&, const ::std::string&, - const ::Ice::Current&) const; + const ::Ice::Current&) const; virtual ::Ice::LocatorRegistryPrx getRegistry(const ::Ice::Current&) const; diff --git a/cpp/test/Ice/location/TestI.cpp b/cpp/test/Ice/location/TestI.cpp index 1eb60dea2bf..d5f22b48672 100644 --- a/cpp/test/Ice/location/TestI.cpp +++ b/cpp/test/Ice/location/TestI.cpp @@ -14,8 +14,8 @@ using namespace Test; ServerManagerI::ServerManagerI(const Ice::ObjectAdapterPtr& adapter, - const ServerLocatorRegistryPtr& registry, - const Ice::InitializationData& initData) : + const ServerLocatorRegistryPtr& registry, + const Ice::InitializationData& initData) : _adapter(adapter), _registry(registry), _initData(initData) { _initData.properties->setProperty("Ice.OA.TestAdapter.Endpoints", "default"); @@ -33,8 +33,8 @@ ServerManagerI::startServer(const Ice::Current& current) { for(::std::vector<Ice::CommunicatorPtr>::const_iterator i = _communicators.begin(); i != _communicators.end(); ++i) { - (*i)->waitForShutdown(); - (*i)->destroy(); + (*i)->waitForShutdown(); + (*i)->destroy(); } _communicators.clear(); @@ -70,15 +70,15 @@ ServerManagerI::shutdown(const Ice::Current&) { for(::std::vector<Ice::CommunicatorPtr>::const_iterator i = _communicators.begin(); i != _communicators.end(); ++i) { - (*i)->destroy(); + (*i)->destroy(); } _adapter->getCommunicator()->shutdown(); } TestI::TestI(const Ice::ObjectAdapterPtr& adapter, - const Ice::ObjectAdapterPtr& adapter2, - const ServerLocatorRegistryPtr& registry) : + const Ice::ObjectAdapterPtr& adapter2, + const ServerLocatorRegistryPtr& registry) : _adapter1(adapter), _adapter2(adapter2), _registry(registry) { _registry->addObject(_adapter1->add(new HelloI(), _adapter1->getCommunicator()->stringToIdentity("hello"))); @@ -94,7 +94,7 @@ HelloPrx TestI::getHello(const Ice::Current&) { return HelloPrx::uncheckedCast(_adapter1->createIndirectProxy( - _adapter1->getCommunicator()->stringToIdentity("hello"))); + _adapter1->getCommunicator()->stringToIdentity("hello"))); } HelloPrx @@ -109,11 +109,11 @@ TestI::migrateHello(const Ice::Current&) const Ice::Identity id = _adapter1->getCommunicator()->stringToIdentity("hello"); try { - _registry->addObject(_adapter2->add(_adapter1->remove(id), id)); + _registry->addObject(_adapter2->add(_adapter1->remove(id), id)); } catch(Ice::NotRegisteredException&) { - _registry->addObject(_adapter1->add(_adapter2->remove(id), id)); + _registry->addObject(_adapter1->add(_adapter2->remove(id), id)); } } diff --git a/cpp/test/Ice/location/TestI.h b/cpp/test/Ice/location/TestI.h index ac03b3970ce..c94a16d5452 100644 --- a/cpp/test/Ice/location/TestI.h +++ b/cpp/test/Ice/location/TestI.h @@ -19,7 +19,7 @@ class ServerManagerI : public Test::ServerManager public: ServerManagerI(const Ice::ObjectAdapterPtr&, const ServerLocatorRegistryPtr&, - const Ice::InitializationData&); + const Ice::InitializationData&); virtual void startServer(const Ice::Current&); virtual void shutdown(const Ice::Current&); diff --git a/cpp/test/Ice/objects/AllTests.cpp b/cpp/test/Ice/objects/AllTests.cpp index 7144ee7e861..91161ac04c2 100644 --- a/cpp/test/Ice/objects/AllTests.cpp +++ b/cpp/test/Ice/objects/AllTests.cpp @@ -140,32 +140,32 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) if(!collocated) { - cout << "testing UnexpectedObjectException... " << flush; - ref = "uoet:default -p 12010 -t 10000"; - base = communicator->stringToProxy(ref); - test(base); - UnexpectedObjectExceptionTestPrx uoet = UnexpectedObjectExceptionTestPrx::uncheckedCast(base); - test(uoet); - try - { - uoet->op(); - test(false); - } - catch(const Ice::UnexpectedObjectException& ex) - { - test(ex.type == "::Test::AlsoEmpty"); - test(ex.expectedType == "::Test::Empty"); - } - catch(const Ice::Exception& ex) - { - cout << ex << endl; - test(false); - } - catch(...) - { - test(false); - } - cout << "ok" << endl; + cout << "testing UnexpectedObjectException... " << flush; + ref = "uoet:default -p 12010 -t 10000"; + base = communicator->stringToProxy(ref); + test(base); + UnexpectedObjectExceptionTestPrx uoet = UnexpectedObjectExceptionTestPrx::uncheckedCast(base); + test(uoet); + try + { + uoet->op(); + test(false); + } + catch(const Ice::UnexpectedObjectException& ex) + { + test(ex.type == "::Test::AlsoEmpty"); + test(ex.expectedType == "::Test::Empty"); + } + catch(const Ice::Exception& ex) + { + cout << ex << endl; + test(false); + } + catch(...) + { + test(false); + } + cout << "ok" << endl; } return initial; diff --git a/cpp/test/Ice/objects/Client.cpp b/cpp/test/Ice/objects/Client.cpp index 3c057524e36..3e7f3fcfa13 100644 --- a/cpp/test/Ice/objects/Client.cpp +++ b/cpp/test/Ice/objects/Client.cpp @@ -20,25 +20,25 @@ public: virtual Ice::ObjectPtr create(const string& type) { - if(type == "::Test::B") - { - return new BI; - } - else if(type == "::Test::C") - { - return new CI; - } - else if(type == "::Test::D") - { - return new DI; - } - assert(false); // Should never be reached - return 0; + if(type == "::Test::B") + { + return new BI; + } + else if(type == "::Test::C") + { + return new CI; + } + else if(type == "::Test::D") + { + return new DI; + } + assert(false); // Should never be reached + return 0; } virtual void destroy() { - // Nothing to do + // Nothing to do } }; @@ -64,26 +64,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/objects/Collocated.cpp b/cpp/test/Ice/objects/Collocated.cpp index a61ce056025..ed26a370e30 100644 --- a/cpp/test/Ice/objects/Collocated.cpp +++ b/cpp/test/Ice/objects/Collocated.cpp @@ -35,26 +35,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/objects/Server.cpp b/cpp/test/Ice/objects/Server.cpp index c5b7d672501..25379cd3be7 100644 --- a/cpp/test/Ice/objects/Server.cpp +++ b/cpp/test/Ice/objects/Server.cpp @@ -35,26 +35,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/objects/TestI.cpp b/cpp/test/Ice/objects/TestI.cpp index 9f141b6a63a..4beaa5477fc 100644 --- a/cpp/test/Ice/objects/TestI.cpp +++ b/cpp/test/Ice/objects/TestI.cpp @@ -162,7 +162,7 @@ InitialI::getAll(BPtr& b1, BPtr& b2, CPtr& c, DPtr& d, const Ice::Current&) bool UnexpectedObjectExceptionTestI::ice_invoke(const std::vector<Ice::Byte>&, std::vector<Ice::Byte>& outParams, - const Ice::Current& current) + const Ice::Current& current) { Ice::CommunicatorPtr communicator = current.adapter->getCommunicator(); Ice::OutputStreamPtr out = Ice::createOutputStream(communicator); diff --git a/cpp/test/Ice/operations/AllTests.cpp b/cpp/test/Ice/operations/AllTests.cpp index 7f592a449fd..15df53511d6 100644 --- a/cpp/test/Ice/operations/AllTests.cpp +++ b/cpp/test/Ice/operations/AllTests.cpp @@ -202,17 +202,17 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) if(!collocated) { - cout << "testing timeout... " << flush; - Test::MyClassPrx clTimeout = Test::MyClassPrx::uncheckedCast(cl->ice_timeout(500)); - try - { - clTimeout->opSleep(2000); - test(false); - } - catch(const Ice::TimeoutException&) - { - } - cout << "ok" << endl; + cout << "testing timeout... " << flush; + Test::MyClassPrx clTimeout = Test::MyClassPrx::uncheckedCast(cl->ice_timeout(500)); + try + { + clTimeout->opSleep(2000); + test(false); + } + catch(const Ice::TimeoutException&) + { + } + cout << "ok" << endl; } cout << "testing twoway operations... " << flush; @@ -224,17 +224,17 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) if(!collocated) { - cout << "testing twoway operations with AMI... " << flush; - void twowaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx&); - twowaysAMI(communicator, cl); - twowaysAMI(communicator, derived); - cout << "ok" << endl; - - cout << "testing batch oneway operations... " << flush; - void batchOneways(const Test::MyClassPrx&); - batchOneways(cl); - batchOneways(derived); - cout << "ok" << endl; + cout << "testing twoway operations with AMI... " << flush; + void twowaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx&); + twowaysAMI(communicator, cl); + twowaysAMI(communicator, derived); + cout << "ok" << endl; + + cout << "testing batch oneway operations... " << flush; + void batchOneways(const Test::MyClassPrx&); + batchOneways(cl); + batchOneways(derived); + cout << "ok" << endl; } return cl; diff --git a/cpp/test/Ice/operations/BatchOneways.cpp b/cpp/test/Ice/operations/BatchOneways.cpp index 0556e8bb722..d0394e5cd51 100644 --- a/cpp/test/Ice/operations/BatchOneways.cpp +++ b/cpp/test/Ice/operations/BatchOneways.cpp @@ -22,32 +22,32 @@ batchOneways(const Test::MyClassPrx& p) try { - p->opByteSOneway(bs1); - test(true); + p->opByteSOneway(bs1); + test(true); } catch(const Ice::MemoryLimitException&) { - test(false); + test(false); } try { - p->opByteSOneway(bs2); - test(true); + p->opByteSOneway(bs2); + test(true); } catch(const Ice::MemoryLimitException&) { - test(false); + test(false); } try { - p->opByteSOneway(bs3); - test(false); + p->opByteSOneway(bs3); + test(false); } catch(const Ice::MemoryLimitException&) { - test(true); + test(true); } Test::MyClassPrx batch = Test::MyClassPrx::uncheckedCast(p->ice_batchOneway()); @@ -56,15 +56,15 @@ batchOneways(const Test::MyClassPrx& p) for(i = 0 ; i < 30 ; ++i) { - try - { - batch->opByteSOneway(bs1); - test(true); - } - catch(const Ice::MemoryLimitException&) - { - test(false); - } + try + { + batch->opByteSOneway(bs1); + test(true); + } + catch(const Ice::MemoryLimitException&) + { + test(false); + } } batch->ice_getConnection()->flushBatchRequests(); diff --git a/cpp/test/Ice/operations/Client.cpp b/cpp/test/Ice/operations/Client.cpp index 7e7cceb914d..b421a629cf5 100644 --- a/cpp/test/Ice/operations/Client.cpp +++ b/cpp/test/Ice/operations/Client.cpp @@ -25,12 +25,12 @@ run(int argc, char* argv[], myClass->shutdown(); try { - myClass->opVoid(); - test(false); + myClass->opVoid(); + test(false); } catch(const Ice::LocalException&) { - cout << "ok" << endl; + cout << "ok" << endl; } return EXIT_SUCCESS; @@ -44,47 +44,47 @@ main(int argc, char* argv[]) try { - // - // In this test, we need at least two threads in the - // client side thread pool for nested AMI. - // - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->setProperty("Ice.ThreadPool.Client.Size", "2"); - initData.properties->setProperty("Ice.ThreadPool.Client.SizeWarn", "0"); + // + // In this test, we need at least two threads in the + // client side thread pool for nested AMI. + // + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + initData.properties->setProperty("Ice.ThreadPool.Client.Size", "2"); + initData.properties->setProperty("Ice.ThreadPool.Client.SizeWarn", "0"); - // - // We must set MessageSizeMax to an explicit values, because - // we run tests to check whether Ice.MemoryLimitException is - // raised as expected. - // - initData.properties->setProperty("Ice.MessageSizeMax", "100"); + // + // We must set MessageSizeMax to an explicit values, because + // we run tests to check whether Ice.MemoryLimitException is + // raised as expected. + // + initData.properties->setProperty("Ice.MessageSizeMax", "100"); - // - // We don't want connection warnings because of the timeout test. - // - initData.properties->setProperty("Ice.Warn.Connections", "0"); + // + // We don't want connection warnings because of the timeout test. + // + initData.properties->setProperty("Ice.Warn.Connections", "0"); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator, initData); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator, initData); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/operations/Collocated.cpp b/cpp/test/Ice/operations/Collocated.cpp index dda296e4cae..784cee66f14 100644 --- a/cpp/test/Ice/operations/Collocated.cpp +++ b/cpp/test/Ice/operations/Collocated.cpp @@ -37,28 +37,28 @@ main(int argc, char* argv[]) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator, initData); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator, initData); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/operations/Server.cpp b/cpp/test/Ice/operations/Server.cpp index 9e4e511dad9..85979d7424f 100644 --- a/cpp/test/Ice/operations/Server.cpp +++ b/cpp/test/Ice/operations/Server.cpp @@ -34,30 +34,30 @@ main(int argc, char* argv[]) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->setProperty("Ice.Warn.Connections", "0"); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + initData.properties->setProperty("Ice.Warn.Connections", "0"); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/operations/ServerAMD.cpp b/cpp/test/Ice/operations/ServerAMD.cpp index 251d5068424..0cac6d02a18 100644 --- a/cpp/test/Ice/operations/ServerAMD.cpp +++ b/cpp/test/Ice/operations/ServerAMD.cpp @@ -34,30 +34,30 @@ main(int argc, char* argv[]) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->setProperty("Ice.Warn.Connections", "0"); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + initData.properties->setProperty("Ice.Warn.Connections", "0"); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/operations/Test.ice b/cpp/test/Ice/operations/Test.ice index d655feb0599..043060a5d93 100644 --- a/cpp/test/Ice/operations/Test.ice +++ b/cpp/test/Ice/operations/Test.ice @@ -75,75 +75,75 @@ dictionary<string, MyEnum> StringMyEnumD; void opSleep(int duration); byte opByte(byte p1, byte p2, - out byte p3); + out byte p3); bool opBool(bool p1, bool p2, - out bool p3); + out bool p3); long opShortIntLong(short p1, int p2, long p3, - out short p4, out int p5, out long p6); + out short p4, out int p5, out long p6); double opFloatDouble(float p1, double p2, - out float p3, out double p4); + out float p3, out double p4); string opString(string p1, string p2, - out string p3); + out string p3); MyEnum opMyEnum(MyEnum p1, out MyEnum p2); MyClass* opMyClass(MyClass* p1, out MyClass* p2, out MyClass* p3); Structure opStruct(Structure p1, Structure p2, - out Structure p3); + out Structure p3); ByteS opByteS(ByteS p1, ByteS p2, - out ByteS p3); + out ByteS p3); BoolS opBoolS(BoolS p1, BoolS p2, - out BoolS p3); + out BoolS p3); LongS opShortIntLongS(Test::ShortS p1, IntS p2, LongS p3, - out ::Test::ShortS p4, out IntS p5, out LongS p6); + out ::Test::ShortS p4, out IntS p5, out LongS p6); DoubleS opFloatDoubleS(FloatS p1, DoubleS p2, - out FloatS p3, out DoubleS p4); + out FloatS p3, out DoubleS p4); StringS opStringS(StringS p1, StringS p2, - out StringS p3); + out StringS p3); ByteSS opByteSS(ByteSS p1, ByteSS p2, - out ByteSS p3); + out ByteSS p3); BoolSS opBoolSS(BoolSS p1, BoolSS p2, - out BoolSS p3); + out BoolSS p3); LongSS opShortIntLongSS(ShortSS p1, IntSS p2, LongSS p3, - out ShortSS p4, out IntSS p5, out LongSS p6); + out ShortSS p4, out IntSS p5, out LongSS p6); DoubleSS opFloatDoubleSS(FloatSS p1, DoubleSS p2, - out FloatSS p3, out DoubleSS p4); + out FloatSS p3, out DoubleSS p4); StringSS opStringSS(StringSS p1, StringSS p2, - out StringSS p3); + out StringSS p3); StringSSS opStringSSS(StringSSS p1, StringSSS p2, - out StringSSS p3); + out StringSSS p3); ByteBoolD opByteBoolD(ByteBoolD p1, ByteBoolD p2, - out ByteBoolD p3); + out ByteBoolD p3); ShortIntD opShortIntD(ShortIntD p1, ShortIntD p2, - out ShortIntD p3); + out ShortIntD p3); LongFloatD opLongFloatD(LongFloatD p1, LongFloatD p2, - out LongFloatD p3); + out LongFloatD p3); StringStringD opStringStringD(StringStringD p1, StringStringD p2, - out StringStringD p3); + out StringStringD p3); StringMyEnumD opStringMyEnumD(StringMyEnumD p1, StringMyEnumD p2, - out StringMyEnumD p3); + out StringMyEnumD p3); IntS opIntS(IntS s); diff --git a/cpp/test/Ice/operations/TestAMD.ice b/cpp/test/Ice/operations/TestAMD.ice index 1d58252d323..9bdc8c6fe3b 100644 --- a/cpp/test/Ice/operations/TestAMD.ice +++ b/cpp/test/Ice/operations/TestAMD.ice @@ -75,75 +75,75 @@ dictionary<string, MyEnum> StringMyEnumD; void opSleep(int duration); byte opByte(byte p1, byte p2, - out byte p3); + out byte p3); bool opBool(bool p1, bool p2, - out bool p3); + out bool p3); long opShortIntLong(short p1, int p2, long p3, - out short p4, out int p5, out long p6); + out short p4, out int p5, out long p6); double opFloatDouble(float p1, double p2, - out float p3, out double p4); + out float p3, out double p4); string opString(string p1, string p2, - out string p3); + out string p3); MyEnum opMyEnum(MyEnum p1, out MyEnum p2); MyClass* opMyClass(MyClass* p1, out MyClass* p2, out MyClass* p3); Structure opStruct(Structure p1, Structure p2, - out Structure p3); + out Structure p3); ByteS opByteS(ByteS p1, ByteS p2, - out ByteS p3); + out ByteS p3); BoolS opBoolS(BoolS p1, BoolS p2, - out BoolS p3); + out BoolS p3); LongS opShortIntLongS(Test::ShortS p1, IntS p2, LongS p3, - out ::Test::ShortS p4, out IntS p5, out LongS p6); + out ::Test::ShortS p4, out IntS p5, out LongS p6); DoubleS opFloatDoubleS(FloatS p1, DoubleS p2, - out FloatS p3, out DoubleS p4); + out FloatS p3, out DoubleS p4); StringS opStringS(StringS p1, StringS p2, - out StringS p3); + out StringS p3); ByteSS opByteSS(ByteSS p1, ByteSS p2, - out ByteSS p3); + out ByteSS p3); BoolSS opBoolSS(BoolSS p1, BoolSS p2, - out BoolSS p3); + out BoolSS p3); LongSS opShortIntLongSS(ShortSS p1, IntSS p2, LongSS p3, - out ShortSS p4, out IntSS p5, out LongSS p6); + out ShortSS p4, out IntSS p5, out LongSS p6); DoubleSS opFloatDoubleSS(FloatSS p1, DoubleSS p2, - out FloatSS p3, out DoubleSS p4); + out FloatSS p3, out DoubleSS p4); StringSS opStringSS(StringSS p1, StringSS p2, - out StringSS p3); + out StringSS p3); StringSSS opStringSSS(StringSSS p1, StringSSS p2, - out StringSSS p3); + out StringSSS p3); ByteBoolD opByteBoolD(ByteBoolD p1, ByteBoolD p2, - out ByteBoolD p3); + out ByteBoolD p3); ShortIntD opShortIntD(ShortIntD p1, ShortIntD p2, - out ShortIntD p3); + out ShortIntD p3); LongFloatD opLongFloatD(LongFloatD p1, LongFloatD p2, - out LongFloatD p3); + out LongFloatD p3); StringStringD opStringStringD(StringStringD p1, StringStringD p2, - out StringStringD p3); + out StringStringD p3); StringMyEnumD opStringMyEnumD(StringMyEnumD p1, StringMyEnumD p2, - out StringMyEnumD p3); + out StringMyEnumD p3); IntS opIntS(IntS s); diff --git a/cpp/test/Ice/operations/TestAMDI.cpp b/cpp/test/Ice/operations/TestAMDI.cpp index 48cb26beeed..028993f910a 100644 --- a/cpp/test/Ice/operations/TestAMDI.cpp +++ b/cpp/test/Ice/operations/TestAMDI.cpp @@ -20,13 +20,13 @@ class Thread_opVoid : public IceUtil::Thread public: Thread_opVoid(const Test::AMD_MyClass_opVoidPtr& cb) : - _cb(cb) + _cb(cb) { } virtual void run() { - _cb->ice_response(); + _cb->ice_response(); } private: @@ -45,8 +45,8 @@ MyDerivedClassI::shutdown_async(const Test::AMD_MyClass_shutdownPtr& cb, const I { if(_opVoidThread) { - _opVoidThread->getThreadControl().join(); - _opVoidThread = 0; + _opVoidThread->getThreadControl().join(); + _opVoidThread = 0; } _adapter->getCommunicator()->shutdown(); @@ -58,8 +58,8 @@ MyDerivedClassI::opVoid_async(const Test::AMD_MyClass_opVoidPtr& cb, const Ice:: { if(_opVoidThread) { - _opVoidThread->getThreadControl().join(); - _opVoidThread = 0; + _opVoidThread->getThreadControl().join(); + _opVoidThread = 0; } _opVoidThread = new Thread_opVoid(cb); @@ -68,8 +68,8 @@ MyDerivedClassI::opVoid_async(const Test::AMD_MyClass_opVoidPtr& cb, const Ice:: void MyDerivedClassI::opSleep_async(const Test::AMD_MyClass_opSleepPtr& cb, - int duration, - const Ice::Current&) + int duration, + const Ice::Current&) { IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(duration)); cb->ice_response(); @@ -77,74 +77,74 @@ MyDerivedClassI::opSleep_async(const Test::AMD_MyClass_opSleepPtr& cb, void MyDerivedClassI::opByte_async(const Test::AMD_MyClass_opBytePtr& cb, - Ice::Byte p1, - Ice::Byte p2, - const Ice::Current&) + Ice::Byte p1, + Ice::Byte p2, + const Ice::Current&) { cb->ice_response(p1, p1 ^ p2); } void MyDerivedClassI::opBool_async(const Test::AMD_MyClass_opBoolPtr& cb, - bool p1, - bool p2, - const Ice::Current&) + bool p1, + bool p2, + const Ice::Current&) { cb->ice_response(p2, p1); } void MyDerivedClassI::opShortIntLong_async(const Test::AMD_MyClass_opShortIntLongPtr& cb, - Ice::Short p1, - Ice::Int p2, - Ice::Long p3, - const Ice::Current&) + Ice::Short p1, + Ice::Int p2, + Ice::Long p3, + const Ice::Current&) { cb->ice_response(p3, p1, p2, p3); } void MyDerivedClassI::opFloatDouble_async(const Test::AMD_MyClass_opFloatDoublePtr& cb, - Ice::Float p1, - Ice::Double p2, - const Ice::Current&) + Ice::Float p1, + Ice::Double p2, + const Ice::Current&) { cb->ice_response(p2, p1, p2); } void MyDerivedClassI::opString_async(const Test::AMD_MyClass_opStringPtr& cb, - const std::string& p1, - const std::string& p2, - const Ice::Current&) + const std::string& p1, + const std::string& p2, + const Ice::Current&) { cb->ice_response(p1 + " " + p2, p2 + " " + p1); } void MyDerivedClassI::opMyEnum_async(const Test::AMD_MyClass_opMyEnumPtr& cb, - Test::MyEnum p1, - const Ice::Current&) + Test::MyEnum p1, + const Ice::Current&) { cb->ice_response(Test::enum3, p1); } void MyDerivedClassI::opMyClass_async(const Test::AMD_MyClass_opMyClassPtr& cb, - const Test::MyClassPrx& p1, - const Ice::Current&) + const Test::MyClassPrx& p1, + const Ice::Current&) { Test::MyClassPrx p2 = p1; Test::MyClassPrx p3 = Test::MyClassPrx::uncheckedCast(_adapter->createProxy( - _adapter->getCommunicator()->stringToIdentity("noSuchIdentity"))); + _adapter->getCommunicator()->stringToIdentity("noSuchIdentity"))); cb->ice_response(Test::MyClassPrx::uncheckedCast(_adapter->createProxy(_identity)), p2, p3); } void MyDerivedClassI::opStruct_async(const Test::AMD_MyClass_opStructPtr& cb, - const Test::Structure& p1, - const Test::Structure& p2, - const Ice::Current&) + const Test::Structure& p1, + const Test::Structure& p2, + const Ice::Current&) { Test::Structure p3 = p1; p3.s.s = "a new string"; @@ -153,9 +153,9 @@ MyDerivedClassI::opStruct_async(const Test::AMD_MyClass_opStructPtr& cb, void MyDerivedClassI::opByteS_async(const Test::AMD_MyClass_opByteSPtr& cb, - const Test::ByteS& p1, - const Test::ByteS& p2, - const Ice::Current&) + const Test::ByteS& p1, + const Test::ByteS& p2, + const Ice::Current&) { Test::ByteS p3; p3.resize(p1.size()); @@ -167,9 +167,9 @@ MyDerivedClassI::opByteS_async(const Test::AMD_MyClass_opByteSPtr& cb, void MyDerivedClassI::opBoolS_async(const Test::AMD_MyClass_opBoolSPtr& cb, - const Test::BoolS& p1, - const Test::BoolS& p2, - const Ice::Current&) + const Test::BoolS& p1, + const Test::BoolS& p2, + const Ice::Current&) { Test::BoolS p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -181,10 +181,10 @@ MyDerivedClassI::opBoolS_async(const Test::AMD_MyClass_opBoolSPtr& cb, void MyDerivedClassI::opShortIntLongS_async(const Test::AMD_MyClass_opShortIntLongSPtr& cb, - const Test::ShortS& p1, - const Test::IntS& p2, - const Test::LongS& p3, - const Ice::Current&) + const Test::ShortS& p1, + const Test::IntS& p2, + const Test::LongS& p3, + const Ice::Current&) { Test::ShortS p4 = p1; Test::IntS p5; @@ -197,9 +197,9 @@ MyDerivedClassI::opShortIntLongS_async(const Test::AMD_MyClass_opShortIntLongSPt void MyDerivedClassI::opFloatDoubleS_async(const Test::AMD_MyClass_opFloatDoubleSPtr& cb, - const Test::FloatS& p1, - const Test::DoubleS& p2, - const Ice::Current&) + const Test::FloatS& p1, + const Test::DoubleS& p2, + const Ice::Current&) { Test::FloatS p3 = p1; Test::DoubleS p4; @@ -212,9 +212,9 @@ MyDerivedClassI::opFloatDoubleS_async(const Test::AMD_MyClass_opFloatDoubleSPtr& void MyDerivedClassI::opStringS_async(const Test::AMD_MyClass_opStringSPtr& cb, - const Test::StringS& p1, - const Test::StringS& p2, - const Ice::Current&) + const Test::StringS& p1, + const Test::StringS& p2, + const Ice::Current&) { Test::StringS p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -226,9 +226,9 @@ MyDerivedClassI::opStringS_async(const Test::AMD_MyClass_opStringSPtr& cb, void MyDerivedClassI::opByteSS_async(const Test::AMD_MyClass_opByteSSPtr& cb, - const Test::ByteSS& p1, - const Test::ByteSS& p2, - const Ice::Current&) + const Test::ByteSS& p1, + const Test::ByteSS& p2, + const Ice::Current&) { Test::ByteSS p3; p3.resize(p1.size()); @@ -240,9 +240,9 @@ MyDerivedClassI::opByteSS_async(const Test::AMD_MyClass_opByteSSPtr& cb, void MyDerivedClassI::opBoolSS_async(const Test::AMD_MyClass_opBoolSSPtr& cb, - const Test::BoolSS& p1, - const Test::BoolSS& p2, - const Ice::Current&) + const Test::BoolSS& p1, + const Test::BoolSS& p2, + const Ice::Current&) { Test::BoolSS p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -254,10 +254,10 @@ MyDerivedClassI::opBoolSS_async(const Test::AMD_MyClass_opBoolSSPtr& cb, void MyDerivedClassI::opShortIntLongSS_async(const Test::AMD_MyClass_opShortIntLongSSPtr& cb, - const Test::ShortSS& p1, - const Test::IntSS& p2, - const Test::LongSS& p3, - const Ice::Current&) + const Test::ShortSS& p1, + const Test::IntSS& p2, + const Test::LongSS& p3, + const Ice::Current&) { Test::ShortSS p4 = p1; Test::IntSS p5; @@ -270,9 +270,9 @@ MyDerivedClassI::opShortIntLongSS_async(const Test::AMD_MyClass_opShortIntLongSS void MyDerivedClassI::opFloatDoubleSS_async(const Test::AMD_MyClass_opFloatDoubleSSPtr& cb, - const Test::FloatSS& p1, - const Test::DoubleSS& p2, - const Ice::Current&) + const Test::FloatSS& p1, + const Test::DoubleSS& p2, + const Ice::Current&) { Test::FloatSS p3 = p1; Test::DoubleSS p4; @@ -285,9 +285,9 @@ MyDerivedClassI::opFloatDoubleSS_async(const Test::AMD_MyClass_opFloatDoubleSSPt void MyDerivedClassI::opStringSS_async(const Test::AMD_MyClass_opStringSSPtr& cb, - const Test::StringSS& p1, - const Test::StringSS& p2, - const Ice::Current&) + const Test::StringSS& p1, + const Test::StringSS& p2, + const Ice::Current&) { Test::StringSS p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -299,9 +299,9 @@ MyDerivedClassI::opStringSS_async(const Test::AMD_MyClass_opStringSSPtr& cb, void MyDerivedClassI::opStringSSS_async(const Test::AMD_MyClass_opStringSSSPtr& cb, - const Test::StringSSS& p1, - const Test::StringSSS& p2, - const Ice::Current&) + const Test::StringSSS& p1, + const Test::StringSSS& p2, + const Ice::Current&) { Test::StringSSS p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -313,9 +313,9 @@ MyDerivedClassI::opStringSSS_async(const Test::AMD_MyClass_opStringSSSPtr& cb, void MyDerivedClassI::opByteBoolD_async(const Test::AMD_MyClass_opByteBoolDPtr& cb, - const Test::ByteBoolD& p1, - const Test::ByteBoolD& p2, - const Ice::Current&) + const Test::ByteBoolD& p1, + const Test::ByteBoolD& p2, + const Ice::Current&) { Test::ByteBoolD p3 = p1; Test::ByteBoolD r = p1; @@ -325,9 +325,9 @@ MyDerivedClassI::opByteBoolD_async(const Test::AMD_MyClass_opByteBoolDPtr& cb, void MyDerivedClassI::opShortIntD_async(const Test::AMD_MyClass_opShortIntDPtr& cb, - const Test::ShortIntD& p1, - const Test::ShortIntD& p2, - const Ice::Current&) + const Test::ShortIntD& p1, + const Test::ShortIntD& p2, + const Ice::Current&) { Test::ShortIntD p3 = p1; Test::ShortIntD r = p1; @@ -337,9 +337,9 @@ MyDerivedClassI::opShortIntD_async(const Test::AMD_MyClass_opShortIntDPtr& cb, void MyDerivedClassI::opLongFloatD_async(const Test::AMD_MyClass_opLongFloatDPtr& cb, - const Test::LongFloatD& p1, - const Test::LongFloatD& p2, - const Ice::Current&) + const Test::LongFloatD& p1, + const Test::LongFloatD& p2, + const Ice::Current&) { Test::LongFloatD p3 = p1; Test::LongFloatD r = p1; @@ -349,9 +349,9 @@ MyDerivedClassI::opLongFloatD_async(const Test::AMD_MyClass_opLongFloatDPtr& cb, void MyDerivedClassI::opStringStringD_async(const Test::AMD_MyClass_opStringStringDPtr& cb, - const Test::StringStringD& p1, - const Test::StringStringD& p2, - const Ice::Current&) + const Test::StringStringD& p1, + const Test::StringStringD& p2, + const Ice::Current&) { Test::StringStringD p3 = p1; Test::StringStringD r = p1; @@ -361,9 +361,9 @@ MyDerivedClassI::opStringStringD_async(const Test::AMD_MyClass_opStringStringDPt void MyDerivedClassI::opStringMyEnumD_async(const Test::AMD_MyClass_opStringMyEnumDPtr& cb, - const Test::StringMyEnumD& p1, - const Test::StringMyEnumD& p2, - const Ice::Current&) + const Test::StringMyEnumD& p1, + const Test::StringMyEnumD& p2, + const Ice::Current&) { Test::StringMyEnumD p3 = p1; Test::StringMyEnumD r = p1; @@ -381,7 +381,7 @@ MyDerivedClassI::opIntS_async(const Test::AMD_MyClass_opIntSPtr& cb, const Test: void MyDerivedClassI::opByteSOneway_async(const Test::AMD_MyClass_opByteSOnewayPtr& cb, const Test::ByteS& s, - const Ice::Current&) + const Ice::Current&) { cb->ice_response(); } @@ -395,7 +395,7 @@ MyDerivedClassI::opContext_async(const Test::AMD_MyClass_opContextPtr& cb, const void MyDerivedClassI::opDoubleMarshaling_async(const Test::AMD_MyClass_opDoubleMarshalingPtr& cb, - Ice::Double p1, const Test::DoubleS& p2, const Ice::Current&) + Ice::Double p1, const Test::DoubleS& p2, const Ice::Current&) { Ice::Double d = 1278312346.0 / 13.0; test(p1 == d); diff --git a/cpp/test/Ice/operations/TestAMDI.h b/cpp/test/Ice/operations/TestAMDI.h index 19c3313bfdb..87098048a1e 100644 --- a/cpp/test/Ice/operations/TestAMDI.h +++ b/cpp/test/Ice/operations/TestAMDI.h @@ -20,123 +20,123 @@ public: MyDerivedClassI(const Ice::ObjectAdapterPtr&, const Ice::Identity&); virtual void shutdown_async(const Test::AMD_MyClass_shutdownPtr&, - const Ice::Current&); + const Ice::Current&); virtual void opVoid_async(const Test::AMD_MyClass_opVoidPtr&, - const Ice::Current&); + const Ice::Current&); virtual void opSleep_async(const Test::AMD_MyClass_opSleepPtr&, - int, - const Ice::Current&); + int, + const Ice::Current&); virtual void opByte_async(const Test::AMD_MyClass_opBytePtr&, - Ice::Byte, Ice::Byte, - const Ice::Current&); + Ice::Byte, Ice::Byte, + const Ice::Current&); virtual void opBool_async(const Test::AMD_MyClass_opBoolPtr&, - bool, bool, - const Ice::Current&); + bool, bool, + const Ice::Current&); virtual void opShortIntLong_async(const Test::AMD_MyClass_opShortIntLongPtr&, - Ice::Short, Ice::Int, Ice::Long, - const Ice::Current&); + Ice::Short, Ice::Int, Ice::Long, + const Ice::Current&); virtual void opFloatDouble_async(const Test::AMD_MyClass_opFloatDoublePtr&, - Ice::Float, Ice::Double, - const Ice::Current&); + Ice::Float, Ice::Double, + const Ice::Current&); virtual void opString_async(const Test::AMD_MyClass_opStringPtr&, - const std::string&, const std::string&, - const Ice::Current&); + const std::string&, const std::string&, + const Ice::Current&); virtual void opMyEnum_async(const Test::AMD_MyClass_opMyEnumPtr&, - Test::MyEnum, - const Ice::Current&); + Test::MyEnum, + const Ice::Current&); virtual void opMyClass_async(const Test::AMD_MyClass_opMyClassPtr&, - const Test::MyClassPrx&, - const Ice::Current&); + const Test::MyClassPrx&, + const Ice::Current&); virtual void opStruct_async(const Test::AMD_MyClass_opStructPtr&, - const Test::Structure&, const Test::Structure&, - const Ice::Current&); + const Test::Structure&, const Test::Structure&, + const Ice::Current&); virtual void opByteS_async(const Test::AMD_MyClass_opByteSPtr&, - const Test::ByteS&, const Test::ByteS&, - const Ice::Current&); + const Test::ByteS&, const Test::ByteS&, + const Ice::Current&); virtual void opBoolS_async(const Test::AMD_MyClass_opBoolSPtr&, - const Test::BoolS&, const Test::BoolS&, - const Ice::Current&); + const Test::BoolS&, const Test::BoolS&, + const Ice::Current&); virtual void opShortIntLongS_async(const Test::AMD_MyClass_opShortIntLongSPtr&, - const Test::ShortS&, const Test::IntS&, const Test::LongS&, - const Ice::Current&); + const Test::ShortS&, const Test::IntS&, const Test::LongS&, + const Ice::Current&); virtual void opFloatDoubleS_async(const Test::AMD_MyClass_opFloatDoubleSPtr&, - const Test::FloatS&, const Test::DoubleS&, - const Ice::Current&); + const Test::FloatS&, const Test::DoubleS&, + const Ice::Current&); virtual void opStringS_async(const Test::AMD_MyClass_opStringSPtr&, - const Test::StringS&, const Test::StringS&, - const Ice::Current&); + const Test::StringS&, const Test::StringS&, + const Ice::Current&); virtual void opByteSS_async(const Test::AMD_MyClass_opByteSSPtr&, - const Test::ByteSS&, const Test::ByteSS&, - const Ice::Current&); + const Test::ByteSS&, const Test::ByteSS&, + const Ice::Current&); virtual void opBoolSS_async(const Test::AMD_MyClass_opBoolSSPtr&, - const Test::BoolSS&, const Test::BoolSS&, - const Ice::Current&); + const Test::BoolSS&, const Test::BoolSS&, + const Ice::Current&); virtual void opShortIntLongSS_async(const Test::AMD_MyClass_opShortIntLongSSPtr&, - const Test::ShortSS&, const Test::IntSS&, const Test::LongSS&, - const Ice::Current&); + const Test::ShortSS&, const Test::IntSS&, const Test::LongSS&, + const Ice::Current&); virtual void opFloatDoubleSS_async(const Test::AMD_MyClass_opFloatDoubleSSPtr&, - const Test::FloatSS&, const Test::DoubleSS&, - const Ice::Current&); + const Test::FloatSS&, const Test::DoubleSS&, + const Ice::Current&); virtual void opStringSS_async(const Test::AMD_MyClass_opStringSSPtr&, - const Test::StringSS&, const Test::StringSS&, - const Ice::Current&); + const Test::StringSS&, const Test::StringSS&, + const Ice::Current&); virtual void opStringSSS_async(const Test::AMD_MyClass_opStringSSSPtr&, - const Test::StringSSS&, const Test::StringSSS&, - const Ice::Current&); + const Test::StringSSS&, const Test::StringSSS&, + const Ice::Current&); virtual void opByteBoolD_async(const Test::AMD_MyClass_opByteBoolDPtr&, - const Test::ByteBoolD&, const Test::ByteBoolD&, - const Ice::Current&); + const Test::ByteBoolD&, const Test::ByteBoolD&, + const Ice::Current&); virtual void opShortIntD_async(const Test::AMD_MyClass_opShortIntDPtr&, - const Test::ShortIntD&, const Test::ShortIntD&, - const Ice::Current&); + const Test::ShortIntD&, const Test::ShortIntD&, + const Ice::Current&); virtual void opLongFloatD_async(const Test::AMD_MyClass_opLongFloatDPtr&, - const Test::LongFloatD&, const Test::LongFloatD&, - const Ice::Current&); + const Test::LongFloatD&, const Test::LongFloatD&, + const Ice::Current&); virtual void opStringStringD_async(const Test::AMD_MyClass_opStringStringDPtr&, - const Test::StringStringD&, const Test::StringStringD&, - const Ice::Current&); + const Test::StringStringD&, const Test::StringStringD&, + const Ice::Current&); virtual void opStringMyEnumD_async(const Test::AMD_MyClass_opStringMyEnumDPtr&, - const Test::StringMyEnumD&, const Test::StringMyEnumD&, - const Ice::Current&); + const Test::StringMyEnumD&, const Test::StringMyEnumD&, + const Ice::Current&); virtual void opIntS_async(const Test::AMD_MyClass_opIntSPtr&, const Test::IntS&, const Ice::Current&); virtual void opByteSOneway_async(const Test::AMD_MyClass_opByteSOnewayPtr&, const Test::ByteS&, - const Ice::Current&); + const Ice::Current&); virtual void opContext_async(const Test::AMD_MyClass_opContextPtr&, const Ice::Current&); virtual void opDoubleMarshaling_async(const Test::AMD_MyClass_opDoubleMarshalingPtr&, - Ice::Double, const Test::DoubleS&, const Ice::Current&); + Ice::Double, const Test::DoubleS&, const Ice::Current&); virtual void opDerived_async(const Test::AMD_MyDerivedClass_opDerivedPtr&, - const Ice::Current&); + const Ice::Current&); private: diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index 77b275b5ae7..e6415f93a87 100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp @@ -41,9 +41,9 @@ MyDerivedClassI::opSleep(int duration, const Ice::Current&) Ice::Byte MyDerivedClassI::opByte(Ice::Byte p1, - Ice::Byte p2, - Ice::Byte& p3, - const Ice::Current&) + Ice::Byte p2, + Ice::Byte& p3, + const Ice::Current&) { p3 = p1 ^ p2; return p1; @@ -51,9 +51,9 @@ MyDerivedClassI::opByte(Ice::Byte p1, bool MyDerivedClassI::opBool(bool p1, - bool p2, - bool& p3, - const Ice::Current&) + bool p2, + bool& p3, + const Ice::Current&) { p3 = p1; return p2; @@ -61,12 +61,12 @@ MyDerivedClassI::opBool(bool p1, Ice::Long MyDerivedClassI::opShortIntLong(Ice::Short p1, - Ice::Int p2, - Ice::Long p3, - Ice::Short& p4, - Ice::Int& p5, - Ice::Long& p6, - const Ice::Current&) + Ice::Int p2, + Ice::Long p3, + Ice::Short& p4, + Ice::Int& p5, + Ice::Long& p6, + const Ice::Current&) { p4 = p1; p5 = p2; @@ -76,10 +76,10 @@ MyDerivedClassI::opShortIntLong(Ice::Short p1, Ice::Double MyDerivedClassI::opFloatDouble(Ice::Float p1, - Ice::Double p2, - Ice::Float& p3, - Ice::Double& p4, - const Ice::Current&) + Ice::Double p2, + Ice::Float& p3, + Ice::Double& p4, + const Ice::Current&) { p3 = p1; p4 = p2; @@ -88,9 +88,9 @@ MyDerivedClassI::opFloatDouble(Ice::Float p1, std::string MyDerivedClassI::opString(const std::string& p1, - const std::string& p2, - std::string& p3, - const Ice::Current&) + const std::string& p2, + std::string& p3, + const Ice::Current&) { p3 = p2 + " " + p1; return p1 + " " + p2; @@ -98,8 +98,8 @@ MyDerivedClassI::opString(const std::string& p1, Test::MyEnum MyDerivedClassI::opMyEnum(Test::MyEnum p1, - Test::MyEnum& p2, - const Ice::Current&) + Test::MyEnum& p2, + const Ice::Current&) { p2 = p1; return Test::enum3; @@ -107,21 +107,21 @@ MyDerivedClassI::opMyEnum(Test::MyEnum p1, Test::MyClassPrx MyDerivedClassI::opMyClass(const Test::MyClassPrx& p1, - Test::MyClassPrx& p2, - Test::MyClassPrx& p3, - const Ice::Current&) + Test::MyClassPrx& p2, + Test::MyClassPrx& p3, + const Ice::Current&) { p2 = p1; p3 = Test::MyClassPrx::uncheckedCast(_adapter->createProxy( - _adapter->getCommunicator()->stringToIdentity("noSuchIdentity"))); + _adapter->getCommunicator()->stringToIdentity("noSuchIdentity"))); return Test::MyClassPrx::uncheckedCast(_adapter->createProxy(_identity)); } Test::Structure MyDerivedClassI::opStruct(const Test::Structure& p1, - const ::Test::Structure& p2, - ::Test::Structure& p3, - const Ice::Current&) + const ::Test::Structure& p2, + ::Test::Structure& p3, + const Ice::Current&) { p3 = p1; p3.s.s = "a new string"; @@ -130,9 +130,9 @@ MyDerivedClassI::opStruct(const Test::Structure& p1, Test::ByteS MyDerivedClassI::opByteS(const Test::ByteS& p1, - const Test::ByteS& p2, - Test::ByteS& p3, - const Ice::Current&) + const Test::ByteS& p2, + Test::ByteS& p3, + const Ice::Current&) { p3.resize(p1.size()); std::reverse_copy(p1.begin(), p1.end(), p3.begin()); @@ -143,9 +143,9 @@ MyDerivedClassI::opByteS(const Test::ByteS& p1, Test::BoolS MyDerivedClassI::opBoolS(const Test::BoolS& p1, - const Test::BoolS& p2, - Test::BoolS& p3, - const Ice::Current&) + const Test::BoolS& p2, + Test::BoolS& p3, + const Ice::Current&) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -157,12 +157,12 @@ MyDerivedClassI::opBoolS(const Test::BoolS& p1, Test::LongS MyDerivedClassI::opShortIntLongS(const Test::ShortS& p1, - const Test::IntS& p2, - const Test::LongS& p3, - Test::ShortS& p4, - Test::IntS& p5, - Test::LongS& p6, - const Ice::Current&) + const Test::IntS& p2, + const Test::LongS& p3, + Test::ShortS& p4, + Test::IntS& p5, + Test::LongS& p6, + const Ice::Current&) { p4 = p1; p5.resize(p2.size()); @@ -174,10 +174,10 @@ MyDerivedClassI::opShortIntLongS(const Test::ShortS& p1, Test::DoubleS MyDerivedClassI::opFloatDoubleS(const Test::FloatS& p1, - const Test::DoubleS& p2, - Test::FloatS& p3, - Test::DoubleS& p4, - const Ice::Current&) + const Test::DoubleS& p2, + Test::FloatS& p3, + Test::DoubleS& p4, + const Ice::Current&) { p3 = p1; p4.resize(p2.size()); @@ -189,9 +189,9 @@ MyDerivedClassI::opFloatDoubleS(const Test::FloatS& p1, Test::StringS MyDerivedClassI::opStringS(const Test::StringS& p1, - const Test::StringS& p2, - Test::StringS& p3, - const Ice::Current&) + const Test::StringS& p2, + Test::StringS& p3, + const Ice::Current&) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -203,9 +203,9 @@ MyDerivedClassI::opStringS(const Test::StringS& p1, Test::ByteSS MyDerivedClassI::opByteSS(const Test::ByteSS& p1, - const Test::ByteSS& p2, - Test::ByteSS& p3, - const Ice::Current&) + const Test::ByteSS& p2, + Test::ByteSS& p3, + const Ice::Current&) { p3.resize(p1.size()); std::reverse_copy(p1.begin(), p1.end(), p3.begin()); @@ -216,9 +216,9 @@ MyDerivedClassI::opByteSS(const Test::ByteSS& p1, Test::BoolSS MyDerivedClassI::opBoolSS(const Test::BoolSS& p1, - const Test::BoolSS& p2, - Test::BoolSS& p3, - const Ice::Current&) + const Test::BoolSS& p2, + Test::BoolSS& p3, + const Ice::Current&) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -230,12 +230,12 @@ MyDerivedClassI::opBoolSS(const Test::BoolSS& p1, Test::LongSS MyDerivedClassI::opShortIntLongSS(const Test::ShortSS& p1, - const Test::IntSS& p2, - const Test::LongSS& p3, - Test::ShortSS& p4, - Test::IntSS& p5, - Test::LongSS& p6, - const Ice::Current&) + const Test::IntSS& p2, + const Test::LongSS& p3, + Test::ShortSS& p4, + Test::IntSS& p5, + Test::LongSS& p6, + const Ice::Current&) { p4 = p1; p5.resize(p2.size()); @@ -247,10 +247,10 @@ MyDerivedClassI::opShortIntLongSS(const Test::ShortSS& p1, Test::DoubleSS MyDerivedClassI::opFloatDoubleSS(const Test::FloatSS& p1, - const Test::DoubleSS& p2, - Test::FloatSS& p3, - Test::DoubleSS& p4, - const Ice::Current&) + const Test::DoubleSS& p2, + Test::FloatSS& p3, + Test::DoubleSS& p4, + const Ice::Current&) { p3 = p1; p4.resize(p2.size()); @@ -262,9 +262,9 @@ MyDerivedClassI::opFloatDoubleSS(const Test::FloatSS& p1, Test::StringSS MyDerivedClassI::opStringSS(const Test::StringSS& p1, - const Test::StringSS& p2, - Test::StringSS& p3, - const Ice::Current&) + const Test::StringSS& p2, + Test::StringSS& p3, + const Ice::Current&) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -276,9 +276,9 @@ MyDerivedClassI::opStringSS(const Test::StringSS& p1, Test::StringSSS MyDerivedClassI::opStringSSS(const Test::StringSSS& p1, - const Test::StringSSS& p2, - Test::StringSSS& p3, - const ::Ice::Current&) + const Test::StringSSS& p2, + Test::StringSSS& p3, + const ::Ice::Current&) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); @@ -290,9 +290,9 @@ MyDerivedClassI::opStringSSS(const Test::StringSSS& p1, Test::ByteBoolD MyDerivedClassI::opByteBoolD(const Test::ByteBoolD& p1, - const Test::ByteBoolD& p2, - Test::ByteBoolD& p3, - const Ice::Current&) + const Test::ByteBoolD& p2, + Test::ByteBoolD& p3, + const Ice::Current&) { p3 = p1; Test::ByteBoolD r = p1; @@ -302,9 +302,9 @@ MyDerivedClassI::opByteBoolD(const Test::ByteBoolD& p1, Test::ShortIntD MyDerivedClassI::opShortIntD(const Test::ShortIntD& p1, - const Test::ShortIntD& p2, - Test::ShortIntD& p3, - const Ice::Current&) + const Test::ShortIntD& p2, + Test::ShortIntD& p3, + const Ice::Current&) { p3 = p1; Test::ShortIntD r = p1; @@ -314,9 +314,9 @@ MyDerivedClassI::opShortIntD(const Test::ShortIntD& p1, Test::LongFloatD MyDerivedClassI::opLongFloatD(const Test::LongFloatD& p1, - const Test::LongFloatD& p2, - Test::LongFloatD& p3, - const Ice::Current&) + const Test::LongFloatD& p2, + Test::LongFloatD& p3, + const Ice::Current&) { p3 = p1; Test::LongFloatD r = p1; @@ -326,9 +326,9 @@ MyDerivedClassI::opLongFloatD(const Test::LongFloatD& p1, Test::StringStringD MyDerivedClassI::opStringStringD(const Test::StringStringD& p1, - const Test::StringStringD& p2, - Test::StringStringD& p3, - const Ice::Current&) + const Test::StringStringD& p2, + Test::StringStringD& p3, + const Ice::Current&) { p3 = p1; Test::StringStringD r = p1; @@ -338,9 +338,9 @@ MyDerivedClassI::opStringStringD(const Test::StringStringD& p1, Test::StringMyEnumD MyDerivedClassI::opStringMyEnumD(const Test::StringMyEnumD& p1, - const Test::StringMyEnumD& p2, - Test::StringMyEnumD& p3, - const Ice::Current&) + const Test::StringMyEnumD& p2, + Test::StringMyEnumD& p3, + const Ice::Current&) { p3 = p1; Test::StringMyEnumD r = p1; diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h index 5a396df41e9..d5f8be15477 100644 --- a/cpp/test/Ice/operations/TestI.h +++ b/cpp/test/Ice/operations/TestI.h @@ -25,128 +25,128 @@ public: virtual void opSleep(int, const Ice::Current&); virtual Ice::Byte opByte(Ice::Byte, - Ice::Byte, - Ice::Byte&, - const Ice::Current&); + Ice::Byte, + Ice::Byte&, + const Ice::Current&); virtual bool opBool(bool, - bool, - bool&, - const Ice::Current&); + bool, + bool&, + const Ice::Current&); virtual Ice::Long opShortIntLong(Ice::Short, - Ice::Int, - Ice::Long, - Ice::Short&, - Ice::Int&, - Ice::Long&, - const Ice::Current&); + Ice::Int, + Ice::Long, + Ice::Short&, + Ice::Int&, + Ice::Long&, + const Ice::Current&); virtual Ice::Double opFloatDouble(Ice::Float, - Ice::Double, - Ice::Float&, - Ice::Double&, - const Ice::Current&); + Ice::Double, + Ice::Float&, + Ice::Double&, + const Ice::Current&); virtual std::string opString(const std::string&, - const std::string&, - std::string&, - const Ice::Current&); + const std::string&, + std::string&, + const Ice::Current&); virtual Test::MyEnum opMyEnum(Test::MyEnum, - Test::MyEnum&, - const Ice::Current&); + Test::MyEnum&, + const Ice::Current&); virtual Test::MyClassPrx opMyClass(const Test::MyClassPrx&, - Test::MyClassPrx&, Test::MyClassPrx&, - const Ice::Current&); + Test::MyClassPrx&, Test::MyClassPrx&, + const Ice::Current&); virtual Test::Structure opStruct(const Test::Structure&, const Test::Structure&, - Test::Structure&, - const Ice::Current&); + Test::Structure&, + const Ice::Current&); virtual Test::ByteS opByteS(const Test::ByteS&, - const Test::ByteS&, - Test::ByteS&, - const Ice::Current&); + const Test::ByteS&, + Test::ByteS&, + const Ice::Current&); virtual Test::BoolS opBoolS(const Test::BoolS&, - const Test::BoolS&, - Test::BoolS&, - const Ice::Current&); + const Test::BoolS&, + Test::BoolS&, + const Ice::Current&); virtual Test::LongS opShortIntLongS(const Test::ShortS&, - const Test::IntS&, - const Test::LongS&, - Test::ShortS&, - Test::IntS&, - Test::LongS&, - const Ice::Current&); + const Test::IntS&, + const Test::LongS&, + Test::ShortS&, + Test::IntS&, + Test::LongS&, + const Ice::Current&); virtual Test::DoubleS opFloatDoubleS(const Test::FloatS&, - const Test::DoubleS&, - Test::FloatS&, - Test::DoubleS&, - const Ice::Current&); + const Test::DoubleS&, + Test::FloatS&, + Test::DoubleS&, + const Ice::Current&); virtual Test::StringS opStringS(const Test::StringS&, - const Test::StringS&, - Test::StringS&, - const Ice::Current&); + const Test::StringS&, + Test::StringS&, + const Ice::Current&); virtual Test::ByteSS opByteSS(const Test::ByteSS&, - const Test::ByteSS&, - Test::ByteSS&, - const Ice::Current&); + const Test::ByteSS&, + Test::ByteSS&, + const Ice::Current&); virtual Test::BoolSS opBoolSS(const Test::BoolSS&, - const Test::BoolSS&, - Test::BoolSS&, - const Ice::Current&); + const Test::BoolSS&, + Test::BoolSS&, + const Ice::Current&); virtual Test::LongSS opShortIntLongSS(const Test::ShortSS&, - const Test::IntSS&, - const Test::LongSS&, - Test::ShortSS&, - Test::IntSS&, - Test::LongSS&, - const Ice::Current&); + const Test::IntSS&, + const Test::LongSS&, + Test::ShortSS&, + Test::IntSS&, + Test::LongSS&, + const Ice::Current&); virtual Test::DoubleSS opFloatDoubleSS(const Test::FloatSS&, - const Test::DoubleSS&, - Test::FloatSS&, - Test::DoubleSS&, - const Ice::Current&); + const Test::DoubleSS&, + Test::FloatSS&, + Test::DoubleSS&, + const Ice::Current&); virtual Test::StringSS opStringSS(const Test::StringSS&, - const Test::StringSS&, - Test::StringSS&, - const Ice::Current&); + const Test::StringSS&, + Test::StringSS&, + const Ice::Current&); virtual Test::StringSSS opStringSSS(const Test::StringSSS&, - const Test::StringSSS&, - Test::StringSSS&, - const ::Ice::Current&); + const Test::StringSSS&, + Test::StringSSS&, + const ::Ice::Current&); virtual Test::ByteBoolD opByteBoolD(const Test::ByteBoolD&, const Test::ByteBoolD&, - Test::ByteBoolD&, - const Ice::Current&); + Test::ByteBoolD&, + const Ice::Current&); virtual Test::ShortIntD opShortIntD(const Test::ShortIntD&, const Test::ShortIntD&, - Test::ShortIntD&, - const Ice::Current&); + Test::ShortIntD&, + const Ice::Current&); virtual Test::LongFloatD opLongFloatD(const Test::LongFloatD&, const Test::LongFloatD&, - Test::LongFloatD&, - const Ice::Current&); + Test::LongFloatD&, + const Ice::Current&); virtual Test::StringStringD opStringStringD(const Test::StringStringD&, const Test::StringStringD&, - Test::StringStringD&, - const Ice::Current&); + Test::StringStringD&, + const Ice::Current&); virtual Test::StringMyEnumD opStringMyEnumD(const Test::StringMyEnumD&, const Test::StringMyEnumD&, - Test::StringMyEnumD&, - const Ice::Current&); + Test::StringMyEnumD&, + const Ice::Current&); virtual Test::IntS opIntS(const Test::IntS&, const Ice::Current&); diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index 107e198a5d6..27f7133b622 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -28,723 +28,723 @@ void twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) { { - p->opVoid(); + p->opVoid(); } { - Ice::Byte b; - Ice::Byte r; + Ice::Byte b; + Ice::Byte r; - r = p->opByte(Ice::Byte(0xff), Ice::Byte(0x0f), b); - test(b == Ice::Byte(0xf0)); - test(r == Ice::Byte(0xff)); + r = p->opByte(Ice::Byte(0xff), Ice::Byte(0x0f), b); + test(b == Ice::Byte(0xf0)); + test(r == Ice::Byte(0xff)); } { - bool b; - bool r; + bool b; + bool r; - r = p->opBool(true, false, b); - test(b); - test(!r); + r = p->opBool(true, false, b); + test(b); + test(!r); } { - Ice::Short s; - Ice::Int i; - Ice::Long l; - Ice::Long r; - - r = p->opShortIntLong(10, 11, 12, s, i, l); - test(s == 10); - test(i == 11); - test(l == 12); - test(r == 12); - - r = p->opShortIntLong(numeric_limits<Ice::Short>::min(), numeric_limits<Ice::Int>::min(), - numeric_limits<Ice::Long>::min(), s, i, l); - test(s == numeric_limits<Ice::Short>::min()); - test(i == numeric_limits<Ice::Int>::min()); - test(l == numeric_limits<Ice::Long>::min()); - test(r == numeric_limits<Ice::Long>::min()); - - r = p->opShortIntLong(numeric_limits<Ice::Short>::max(), numeric_limits<Ice::Int>::max(), - numeric_limits<Ice::Long>::max(), s, i, l); - test(s == numeric_limits<Ice::Short>::max()); - test(i == numeric_limits<Ice::Int>::max()); - test(l == numeric_limits<Ice::Long>::max()); - test(r == numeric_limits<Ice::Long>::max()); + Ice::Short s; + Ice::Int i; + Ice::Long l; + Ice::Long r; + + r = p->opShortIntLong(10, 11, 12, s, i, l); + test(s == 10); + test(i == 11); + test(l == 12); + test(r == 12); + + r = p->opShortIntLong(numeric_limits<Ice::Short>::min(), numeric_limits<Ice::Int>::min(), + numeric_limits<Ice::Long>::min(), s, i, l); + test(s == numeric_limits<Ice::Short>::min()); + test(i == numeric_limits<Ice::Int>::min()); + test(l == numeric_limits<Ice::Long>::min()); + test(r == numeric_limits<Ice::Long>::min()); + + r = p->opShortIntLong(numeric_limits<Ice::Short>::max(), numeric_limits<Ice::Int>::max(), + numeric_limits<Ice::Long>::max(), s, i, l); + test(s == numeric_limits<Ice::Short>::max()); + test(i == numeric_limits<Ice::Int>::max()); + test(l == numeric_limits<Ice::Long>::max()); + test(r == numeric_limits<Ice::Long>::max()); } { - Ice::Float f; - Ice::Double d; - Ice::Double r; - - r = p->opFloatDouble(Ice::Float(3.14), Ice::Double(1.1E10), f, d); - test(f == Ice::Float(3.14)); - test(d == Ice::Double(1.1E10)); - test(r == Ice::Double(1.1E10)); - - r = p->opFloatDouble(numeric_limits<Ice::Float>::min(), numeric_limits<Ice::Double>::min(), f, d); - test(f == numeric_limits<Ice::Float>::min()); - test(d == numeric_limits<Ice::Double>::min()); - test(r == numeric_limits<Ice::Double>::min()); - - r = p->opFloatDouble(numeric_limits<Ice::Float>::max(), numeric_limits<Ice::Double>::max(), f, d); - test(f == numeric_limits<Ice::Float>::max()); - test(d == numeric_limits<Ice::Double>::max()); - test(r == numeric_limits<Ice::Double>::max()); + Ice::Float f; + Ice::Double d; + Ice::Double r; + + r = p->opFloatDouble(Ice::Float(3.14), Ice::Double(1.1E10), f, d); + test(f == Ice::Float(3.14)); + test(d == Ice::Double(1.1E10)); + test(r == Ice::Double(1.1E10)); + + r = p->opFloatDouble(numeric_limits<Ice::Float>::min(), numeric_limits<Ice::Double>::min(), f, d); + test(f == numeric_limits<Ice::Float>::min()); + test(d == numeric_limits<Ice::Double>::min()); + test(r == numeric_limits<Ice::Double>::min()); + + r = p->opFloatDouble(numeric_limits<Ice::Float>::max(), numeric_limits<Ice::Double>::max(), f, d); + test(f == numeric_limits<Ice::Float>::max()); + test(d == numeric_limits<Ice::Double>::max()); + test(r == numeric_limits<Ice::Double>::max()); } { - string s; - string r; + string s; + string r; - r = p->opString("hello", "world", s); - test(s == "world hello"); - test(r == "hello world"); + r = p->opString("hello", "world", s); + test(s == "world hello"); + test(r == "hello world"); } { - Test::MyEnum e; - Test::MyEnum r; - - r = p->opMyEnum(Test::enum2, e); - test(e == Test::enum2); - test(r == Test::enum3); + Test::MyEnum e; + Test::MyEnum r; + + r = p->opMyEnum(Test::enum2, e); + test(e == Test::enum2); + test(r == Test::enum3); } { - Test::MyClassPrx c1; - Test::MyClassPrx c2; - Test::MyClassPrx r; - - r = p->opMyClass(p, c1, c2); - test(Ice::proxyIdentityAndFacetEqual(c1, p)); - test(!Ice::proxyIdentityAndFacetEqual(c2, p)); - test(Ice::proxyIdentityAndFacetEqual(r, p)); - test(c1->ice_getIdentity() == communicator->stringToIdentity("test")); - test(c2->ice_getIdentity() == communicator->stringToIdentity("noSuchIdentity")); - test(r->ice_getIdentity() == communicator->stringToIdentity("test")); - r->opVoid(); - c1->opVoid(); - try - { - c2->opVoid(); - test(false); - } - catch(const Ice::ObjectNotExistException&) - { - } - - r = p->opMyClass(0, c1, c2); - test(c1 == 0); - test(c2 != 0); - test(Ice::proxyIdentityAndFacetEqual(r, p)); - r->opVoid(); + Test::MyClassPrx c1; + Test::MyClassPrx c2; + Test::MyClassPrx r; + + r = p->opMyClass(p, c1, c2); + test(Ice::proxyIdentityAndFacetEqual(c1, p)); + test(!Ice::proxyIdentityAndFacetEqual(c2, p)); + test(Ice::proxyIdentityAndFacetEqual(r, p)); + test(c1->ice_getIdentity() == communicator->stringToIdentity("test")); + test(c2->ice_getIdentity() == communicator->stringToIdentity("noSuchIdentity")); + test(r->ice_getIdentity() == communicator->stringToIdentity("test")); + r->opVoid(); + c1->opVoid(); + try + { + c2->opVoid(); + test(false); + } + catch(const Ice::ObjectNotExistException&) + { + } + + r = p->opMyClass(0, c1, c2); + test(c1 == 0); + test(c2 != 0); + test(Ice::proxyIdentityAndFacetEqual(r, p)); + r->opVoid(); } { - Test::Structure si1; - si1.p = p; - si1.e = Test::enum3; - si1.s.s = "abc"; - Test::Structure si2; - si2.p = 0; - si2.e = Test::enum2; - si2.s.s = "def"; - - Test::Structure so; - Test::Structure rso = p->opStruct(si1, si2, so); - test(rso.p == 0); - test(rso.e == Test::enum2); - test(rso.s.s == "def"); - test(so.p == p); - test(so.e == Test::enum3); - test(so.s.s == "a new string"); - so.p->opVoid(); + Test::Structure si1; + si1.p = p; + si1.e = Test::enum3; + si1.s.s = "abc"; + Test::Structure si2; + si2.p = 0; + si2.e = Test::enum2; + si2.s.s = "def"; + + Test::Structure so; + Test::Structure rso = p->opStruct(si1, si2, so); + test(rso.p == 0); + test(rso.e == Test::enum2); + test(rso.s.s == "def"); + test(so.p == p); + test(so.e == Test::enum3); + test(so.s.s == "a new string"); + so.p->opVoid(); } { - Test::ByteS bsi1; - Test::ByteS bsi2; - - bsi1.push_back(Ice::Byte(0x01)); - bsi1.push_back(Ice::Byte(0x11)); - bsi1.push_back(Ice::Byte(0x12)); - bsi1.push_back(Ice::Byte(0x22)); - - bsi2.push_back(Ice::Byte(0xf1)); - bsi2.push_back(Ice::Byte(0xf2)); - bsi2.push_back(Ice::Byte(0xf3)); - bsi2.push_back(Ice::Byte(0xf4)); - - Test::ByteS bso; - Test::ByteS rso; - - rso = p->opByteS(bsi1, bsi2, bso); - test(bso.size() == 4); - test(bso[0] == Ice::Byte(0x22)); - test(bso[1] == Ice::Byte(0x12)); - test(bso[2] == Ice::Byte(0x11)); - test(bso[3] == Ice::Byte(0x01)); - test(rso.size() == 8); - test(rso[0] == Ice::Byte(0x01)); - test(rso[1] == Ice::Byte(0x11)); - test(rso[2] == Ice::Byte(0x12)); - test(rso[3] == Ice::Byte(0x22)); - test(rso[4] == Ice::Byte(0xf1)); - test(rso[5] == Ice::Byte(0xf2)); - test(rso[6] == Ice::Byte(0xf3)); - test(rso[7] == Ice::Byte(0xf4)); + Test::ByteS bsi1; + Test::ByteS bsi2; + + bsi1.push_back(Ice::Byte(0x01)); + bsi1.push_back(Ice::Byte(0x11)); + bsi1.push_back(Ice::Byte(0x12)); + bsi1.push_back(Ice::Byte(0x22)); + + bsi2.push_back(Ice::Byte(0xf1)); + bsi2.push_back(Ice::Byte(0xf2)); + bsi2.push_back(Ice::Byte(0xf3)); + bsi2.push_back(Ice::Byte(0xf4)); + + Test::ByteS bso; + Test::ByteS rso; + + rso = p->opByteS(bsi1, bsi2, bso); + test(bso.size() == 4); + test(bso[0] == Ice::Byte(0x22)); + test(bso[1] == Ice::Byte(0x12)); + test(bso[2] == Ice::Byte(0x11)); + test(bso[3] == Ice::Byte(0x01)); + test(rso.size() == 8); + test(rso[0] == Ice::Byte(0x01)); + test(rso[1] == Ice::Byte(0x11)); + test(rso[2] == Ice::Byte(0x12)); + test(rso[3] == Ice::Byte(0x22)); + test(rso[4] == Ice::Byte(0xf1)); + test(rso[5] == Ice::Byte(0xf2)); + test(rso[6] == Ice::Byte(0xf3)); + test(rso[7] == Ice::Byte(0xf4)); } { - Test::BoolS bsi1; - Test::BoolS bsi2; - - bsi1.push_back(true); - bsi1.push_back(true); - bsi1.push_back(false); - - bsi2.push_back(false); - - Test::BoolS bso; - Test::BoolS rso; - - rso = p->opBoolS(bsi1, bsi2, bso); - test(bso.size() == 4); - test(bso[0]); - test(bso[1]); - test(!bso[2]); - test(!bso[3]); - test(rso.size() == 3); - test(!rso[0]); - test(rso[1]); - test(rso[2]); + Test::BoolS bsi1; + Test::BoolS bsi2; + + bsi1.push_back(true); + bsi1.push_back(true); + bsi1.push_back(false); + + bsi2.push_back(false); + + Test::BoolS bso; + Test::BoolS rso; + + rso = p->opBoolS(bsi1, bsi2, bso); + test(bso.size() == 4); + test(bso[0]); + test(bso[1]); + test(!bso[2]); + test(!bso[3]); + test(rso.size() == 3); + test(!rso[0]); + test(rso[1]); + test(rso[2]); } { - Test::ShortS ssi; - Test::IntS isi; - Test::LongS lsi; - - ssi.push_back(1); - ssi.push_back(2); - ssi.push_back(3); - - isi.push_back(5); - isi.push_back(6); - isi.push_back(7); - isi.push_back(8); - - lsi.push_back(10); - lsi.push_back(30); - lsi.push_back(20); - - Test::ShortS sso; - Test::IntS iso; - Test::LongS lso; - Test::LongS rso; - - rso = p->opShortIntLongS(ssi, isi, lsi, sso, iso, lso); - test(sso.size() == 3); - test(sso[0] == 1); - test(sso[1] == 2); - test(sso[2] == 3); - test(iso.size() == 4); - test(iso[0] == 8); - test(iso[1] == 7); - test(iso[2] == 6); - test(iso[3] == 5); - test(lso.size() == 6); - test(lso[0] == 10); - test(lso[1] == 30); - test(lso[2] == 20); - test(lso[3] == 10); - test(lso[4] == 30); - test(lso[5] == 20); - test(rso.size() == 3); - test(rso[0] == 10); - test(rso[1] == 30); - test(rso[2] == 20); + Test::ShortS ssi; + Test::IntS isi; + Test::LongS lsi; + + ssi.push_back(1); + ssi.push_back(2); + ssi.push_back(3); + + isi.push_back(5); + isi.push_back(6); + isi.push_back(7); + isi.push_back(8); + + lsi.push_back(10); + lsi.push_back(30); + lsi.push_back(20); + + Test::ShortS sso; + Test::IntS iso; + Test::LongS lso; + Test::LongS rso; + + rso = p->opShortIntLongS(ssi, isi, lsi, sso, iso, lso); + test(sso.size() == 3); + test(sso[0] == 1); + test(sso[1] == 2); + test(sso[2] == 3); + test(iso.size() == 4); + test(iso[0] == 8); + test(iso[1] == 7); + test(iso[2] == 6); + test(iso[3] == 5); + test(lso.size() == 6); + test(lso[0] == 10); + test(lso[1] == 30); + test(lso[2] == 20); + test(lso[3] == 10); + test(lso[4] == 30); + test(lso[5] == 20); + test(rso.size() == 3); + test(rso[0] == 10); + test(rso[1] == 30); + test(rso[2] == 20); } { - Test::FloatS fsi; - Test::DoubleS dsi; - - fsi.push_back(Ice::Float(3.14)); - fsi.push_back(Ice::Float(1.11)); - - dsi.push_back(Ice::Double(1.1E10)); - dsi.push_back(Ice::Double(1.2E10)); - dsi.push_back(Ice::Double(1.3E10)); - - Test::FloatS fso; - Test::DoubleS dso; - Test::DoubleS rso; - - rso = p->opFloatDoubleS(fsi, dsi, fso, dso); - test(fso.size() == 2); - test(fso[0] == ::Ice::Float(3.14)); - test(fso[1] == ::Ice::Float(1.11)); - test(dso.size() == 3); - test(dso[0] == ::Ice::Double(1.3E10)); - test(dso[1] == ::Ice::Double(1.2E10)); - test(dso[2] == ::Ice::Double(1.1E10)); - test(rso.size() == 5); - test(rso[0] == ::Ice::Double(1.1E10)); - test(rso[1] == ::Ice::Double(1.2E10)); - test(rso[2] == ::Ice::Double(1.3E10)); - test(::Ice::Float(rso[3]) == ::Ice::Float(3.14)); - test(::Ice::Float(rso[4]) == ::Ice::Float(1.11)); + Test::FloatS fsi; + Test::DoubleS dsi; + + fsi.push_back(Ice::Float(3.14)); + fsi.push_back(Ice::Float(1.11)); + + dsi.push_back(Ice::Double(1.1E10)); + dsi.push_back(Ice::Double(1.2E10)); + dsi.push_back(Ice::Double(1.3E10)); + + Test::FloatS fso; + Test::DoubleS dso; + Test::DoubleS rso; + + rso = p->opFloatDoubleS(fsi, dsi, fso, dso); + test(fso.size() == 2); + test(fso[0] == ::Ice::Float(3.14)); + test(fso[1] == ::Ice::Float(1.11)); + test(dso.size() == 3); + test(dso[0] == ::Ice::Double(1.3E10)); + test(dso[1] == ::Ice::Double(1.2E10)); + test(dso[2] == ::Ice::Double(1.1E10)); + test(rso.size() == 5); + test(rso[0] == ::Ice::Double(1.1E10)); + test(rso[1] == ::Ice::Double(1.2E10)); + test(rso[2] == ::Ice::Double(1.3E10)); + test(::Ice::Float(rso[3]) == ::Ice::Float(3.14)); + test(::Ice::Float(rso[4]) == ::Ice::Float(1.11)); } { - Test::StringS ssi1; - Test::StringS ssi2; - - ssi1.push_back("abc"); - ssi1.push_back("de"); - ssi1.push_back("fghi"); - - ssi2.push_back("xyz"); - - Test::StringS sso; - Test::StringS rso; - - rso = p->opStringS(ssi1, ssi2, sso); - test(sso.size() == 4); - test(sso[0] == "abc"); - test(sso[1] == "de"); - test(sso[2] == "fghi"); - test(sso[3] == "xyz"); - test(rso.size() == 3); - test(rso[0] == "fghi"); - test(rso[1] == "de"); - test(rso[2] == "abc"); + Test::StringS ssi1; + Test::StringS ssi2; + + ssi1.push_back("abc"); + ssi1.push_back("de"); + ssi1.push_back("fghi"); + + ssi2.push_back("xyz"); + + Test::StringS sso; + Test::StringS rso; + + rso = p->opStringS(ssi1, ssi2, sso); + test(sso.size() == 4); + test(sso[0] == "abc"); + test(sso[1] == "de"); + test(sso[2] == "fghi"); + test(sso[3] == "xyz"); + test(rso.size() == 3); + test(rso[0] == "fghi"); + test(rso[1] == "de"); + test(rso[2] == "abc"); } { - Test::ByteSS bsi1; - bsi1.resize(2); - Test::ByteSS bsi2; - bsi2.resize(2); - - bsi1[0].push_back(Ice::Byte(0x01)); - bsi1[0].push_back(Ice::Byte(0x11)); - bsi1[0].push_back(Ice::Byte(0x12)); - bsi1[1].push_back(Ice::Byte(0xff)); - - bsi2[0].push_back(Ice::Byte(0x0e)); - bsi2[1].push_back(Ice::Byte(0xf2)); - bsi2[1].push_back(Ice::Byte(0xf1)); - - Test::ByteSS bso; - Test::ByteSS rso; - - rso = p->opByteSS(bsi1, bsi2, bso); - test(bso.size() == 2); - test(bso[0].size() == 1); - test(bso[0][0] == Ice::Byte(0xff)); - test(bso[1].size() == 3); - test(bso[1][0] == Ice::Byte(0x01)); - test(bso[1][1] == Ice::Byte(0x11)); - test(bso[1][2] == Ice::Byte(0x12)); - test(rso.size() == 4); - test(rso[0].size() == 3); - test(rso[0][0] == Ice::Byte(0x01)); - test(rso[0][1] == Ice::Byte(0x11)); - test(rso[0][2] == Ice::Byte(0x12)); - test(rso[1].size() == 1); - test(rso[1][0] == Ice::Byte(0xff)); - test(rso[2].size() == 1); - test(rso[2][0] == Ice::Byte(0x0e)); - test(rso[3].size() == 2); - test(rso[3][0] == Ice::Byte(0xf2)); - test(rso[3][1] == Ice::Byte(0xf1)); + Test::ByteSS bsi1; + bsi1.resize(2); + Test::ByteSS bsi2; + bsi2.resize(2); + + bsi1[0].push_back(Ice::Byte(0x01)); + bsi1[0].push_back(Ice::Byte(0x11)); + bsi1[0].push_back(Ice::Byte(0x12)); + bsi1[1].push_back(Ice::Byte(0xff)); + + bsi2[0].push_back(Ice::Byte(0x0e)); + bsi2[1].push_back(Ice::Byte(0xf2)); + bsi2[1].push_back(Ice::Byte(0xf1)); + + Test::ByteSS bso; + Test::ByteSS rso; + + rso = p->opByteSS(bsi1, bsi2, bso); + test(bso.size() == 2); + test(bso[0].size() == 1); + test(bso[0][0] == Ice::Byte(0xff)); + test(bso[1].size() == 3); + test(bso[1][0] == Ice::Byte(0x01)); + test(bso[1][1] == Ice::Byte(0x11)); + test(bso[1][2] == Ice::Byte(0x12)); + test(rso.size() == 4); + test(rso[0].size() == 3); + test(rso[0][0] == Ice::Byte(0x01)); + test(rso[0][1] == Ice::Byte(0x11)); + test(rso[0][2] == Ice::Byte(0x12)); + test(rso[1].size() == 1); + test(rso[1][0] == Ice::Byte(0xff)); + test(rso[2].size() == 1); + test(rso[2][0] == Ice::Byte(0x0e)); + test(rso[3].size() == 2); + test(rso[3][0] == Ice::Byte(0xf2)); + test(rso[3][1] == Ice::Byte(0xf1)); } { - Test::FloatSS fsi; - fsi.resize(3); - Test::DoubleSS dsi; - dsi.resize(1); - - fsi[0].push_back(Ice::Float(3.14)); - fsi[1].push_back(Ice::Float(1.11)); - - dsi[0].push_back(Ice::Double(1.1E10)); - dsi[0].push_back(Ice::Double(1.2E10)); - dsi[0].push_back(Ice::Double(1.3E10)); - - Test::FloatSS fso; - Test::DoubleSS dso; - Test::DoubleSS rso; - - rso = p->opFloatDoubleSS(fsi, dsi, fso, dso); - test(fso.size() == 3); - test(fso[0].size() == 1); - test(fso[0][0] == ::Ice::Float(3.14)); - test(fso[1].size() == 1); - test(fso[1][0] == ::Ice::Float(1.11)); - test(fso[2].size() == 0); - test(dso.size() == 1); - test(dso[0].size() == 3); - test(dso[0][0] == ::Ice::Double(1.1E10)); - test(dso[0][1] == ::Ice::Double(1.2E10)); - test(dso[0][2] == ::Ice::Double(1.3E10)); - test(rso.size() == 2); - test(rso[0].size() == 3); - test(rso[0][0] == ::Ice::Double(1.1E10)); - test(rso[0][1] == ::Ice::Double(1.2E10)); - test(rso[0][2] == ::Ice::Double(1.3E10)); - test(rso[1].size() == 3); - test(rso[1][0] == ::Ice::Double(1.1E10)); - test(rso[1][1] == ::Ice::Double(1.2E10)); - test(rso[1][2] == ::Ice::Double(1.3E10)); + Test::FloatSS fsi; + fsi.resize(3); + Test::DoubleSS dsi; + dsi.resize(1); + + fsi[0].push_back(Ice::Float(3.14)); + fsi[1].push_back(Ice::Float(1.11)); + + dsi[0].push_back(Ice::Double(1.1E10)); + dsi[0].push_back(Ice::Double(1.2E10)); + dsi[0].push_back(Ice::Double(1.3E10)); + + Test::FloatSS fso; + Test::DoubleSS dso; + Test::DoubleSS rso; + + rso = p->opFloatDoubleSS(fsi, dsi, fso, dso); + test(fso.size() == 3); + test(fso[0].size() == 1); + test(fso[0][0] == ::Ice::Float(3.14)); + test(fso[1].size() == 1); + test(fso[1][0] == ::Ice::Float(1.11)); + test(fso[2].size() == 0); + test(dso.size() == 1); + test(dso[0].size() == 3); + test(dso[0][0] == ::Ice::Double(1.1E10)); + test(dso[0][1] == ::Ice::Double(1.2E10)); + test(dso[0][2] == ::Ice::Double(1.3E10)); + test(rso.size() == 2); + test(rso[0].size() == 3); + test(rso[0][0] == ::Ice::Double(1.1E10)); + test(rso[0][1] == ::Ice::Double(1.2E10)); + test(rso[0][2] == ::Ice::Double(1.3E10)); + test(rso[1].size() == 3); + test(rso[1][0] == ::Ice::Double(1.1E10)); + test(rso[1][1] == ::Ice::Double(1.2E10)); + test(rso[1][2] == ::Ice::Double(1.3E10)); } { - Test::StringSS ssi1; - ssi1.resize(2); - Test::StringSS ssi2; - ssi2.resize(3); - - ssi1[0].push_back("abc"); - ssi1[1].push_back("de"); - ssi1[1].push_back("fghi"); - - ssi2[2].push_back("xyz"); - - Test::StringSS sso; - Test::StringSS rso; - - rso = p->opStringSS(ssi1, ssi2, sso); - test(sso.size() == 5); - test(sso[0].size() == 1); - test(sso[0][0] == "abc"); - test(sso[1].size() == 2); - test(sso[1][0] == "de"); - test(sso[1][1] == "fghi"); - test(sso[2].size() == 0); - test(sso[3].size() == 0); - test(sso[4].size() == 1); - test(sso[4][0] == "xyz"); - test(rso.size() == 3); - test(rso[0].size() == 1); - test(rso[0][0] == "xyz"); - test(rso[1].size() == 0); - test(rso[2].size() == 0); + Test::StringSS ssi1; + ssi1.resize(2); + Test::StringSS ssi2; + ssi2.resize(3); + + ssi1[0].push_back("abc"); + ssi1[1].push_back("de"); + ssi1[1].push_back("fghi"); + + ssi2[2].push_back("xyz"); + + Test::StringSS sso; + Test::StringSS rso; + + rso = p->opStringSS(ssi1, ssi2, sso); + test(sso.size() == 5); + test(sso[0].size() == 1); + test(sso[0][0] == "abc"); + test(sso[1].size() == 2); + test(sso[1][0] == "de"); + test(sso[1][1] == "fghi"); + test(sso[2].size() == 0); + test(sso[3].size() == 0); + test(sso[4].size() == 1); + test(sso[4][0] == "xyz"); + test(rso.size() == 3); + test(rso[0].size() == 1); + test(rso[0][0] == "xyz"); + test(rso[1].size() == 0); + test(rso[2].size() == 0); } { - Test::StringSSS sssi1; - sssi1.resize(2); - sssi1[0].resize(2); - sssi1[0][0].push_back("abc"); - sssi1[0][0].push_back("de"); - sssi1[0][1].push_back("xyz"); - sssi1[1].resize(1); - sssi1[1][0].push_back("hello"); - - Test::StringSSS sssi2; - sssi2.resize(3); - sssi2[0].resize(2); - sssi2[0][0].push_back(""); - sssi2[0][0].push_back(""); - sssi2[0][1].push_back("abcd"); - sssi2[1].resize(1); - sssi2[1][0].push_back(""); - - Test::StringSSS ssso; - Test::StringSSS rsso; - - rsso = p->opStringSSS(sssi1, sssi2, ssso); - test(ssso.size() == 5); - test(ssso[0].size() == 2); - test(ssso[0][0].size() == 2); - test(ssso[0][1].size() == 1); - test(ssso[1].size() == 1); - test(ssso[1][0].size() == 1); - test(ssso[2].size() == 2); - test(ssso[2][0].size() == 2); - test(ssso[2][1].size() == 1); - test(ssso[3].size() == 1); - test(ssso[3][0].size() == 1); - test(ssso[4].size() == 0); - test(ssso[0][0][0] == "abc"); - test(ssso[0][0][1] == "de"); - test(ssso[0][1][0] == "xyz"); - test(ssso[1][0][0] == "hello"); - test(ssso[2][0][0] == ""); - test(ssso[2][0][1] == ""); - test(ssso[2][1][0] == "abcd"); - test(ssso[3][0][0] == ""); - - test(rsso.size() == 3); - test(rsso[0].size() == 0); - test(rsso[1].size() == 1); - test(rsso[1][0].size() == 1); - test(rsso[2].size() == 2); - test(rsso[2][0].size() == 2); - test(rsso[2][1].size() == 1); - test(rsso[1][0][0] == ""); - test(rsso[2][0][0] == ""); - test(rsso[2][0][1] == ""); - test(rsso[2][1][0] == "abcd"); + Test::StringSSS sssi1; + sssi1.resize(2); + sssi1[0].resize(2); + sssi1[0][0].push_back("abc"); + sssi1[0][0].push_back("de"); + sssi1[0][1].push_back("xyz"); + sssi1[1].resize(1); + sssi1[1][0].push_back("hello"); + + Test::StringSSS sssi2; + sssi2.resize(3); + sssi2[0].resize(2); + sssi2[0][0].push_back(""); + sssi2[0][0].push_back(""); + sssi2[0][1].push_back("abcd"); + sssi2[1].resize(1); + sssi2[1][0].push_back(""); + + Test::StringSSS ssso; + Test::StringSSS rsso; + + rsso = p->opStringSSS(sssi1, sssi2, ssso); + test(ssso.size() == 5); + test(ssso[0].size() == 2); + test(ssso[0][0].size() == 2); + test(ssso[0][1].size() == 1); + test(ssso[1].size() == 1); + test(ssso[1][0].size() == 1); + test(ssso[2].size() == 2); + test(ssso[2][0].size() == 2); + test(ssso[2][1].size() == 1); + test(ssso[3].size() == 1); + test(ssso[3][0].size() == 1); + test(ssso[4].size() == 0); + test(ssso[0][0][0] == "abc"); + test(ssso[0][0][1] == "de"); + test(ssso[0][1][0] == "xyz"); + test(ssso[1][0][0] == "hello"); + test(ssso[2][0][0] == ""); + test(ssso[2][0][1] == ""); + test(ssso[2][1][0] == "abcd"); + test(ssso[3][0][0] == ""); + + test(rsso.size() == 3); + test(rsso[0].size() == 0); + test(rsso[1].size() == 1); + test(rsso[1][0].size() == 1); + test(rsso[2].size() == 2); + test(rsso[2][0].size() == 2); + test(rsso[2][1].size() == 1); + test(rsso[1][0][0] == ""); + test(rsso[2][0][0] == ""); + test(rsso[2][0][1] == ""); + test(rsso[2][1][0] == "abcd"); } { - Test::ByteBoolD di1; - di1[10] = true; - di1[100] = false; - Test::ByteBoolD di2; - di2[10] = true; - di2[11] = false; - di2[101] = true; - - Test::ByteBoolD _do; - Test::ByteBoolD ro = p->opByteBoolD(di1, di2, _do); - - test(_do == di1); - test(ro.size() == 4); - test(ro[10] == true); - test(ro[11] == false); - test(ro[100] == false); - test(ro[101] == true); + Test::ByteBoolD di1; + di1[10] = true; + di1[100] = false; + Test::ByteBoolD di2; + di2[10] = true; + di2[11] = false; + di2[101] = true; + + Test::ByteBoolD _do; + Test::ByteBoolD ro = p->opByteBoolD(di1, di2, _do); + + test(_do == di1); + test(ro.size() == 4); + test(ro[10] == true); + test(ro[11] == false); + test(ro[100] == false); + test(ro[101] == true); } { - Test::ShortIntD di1; - di1[110] = -1; - di1[1100] = 123123; - Test::ShortIntD di2; - di2[110] = -1; - di2[111] = -100; - di2[1101] = 0; - - Test::ShortIntD _do; - Test::ShortIntD ro = p->opShortIntD(di1, di2, _do); - - test(_do == di1); - test(ro.size() == 4); - test(ro[110] == -1); - test(ro[111] == -100); - test(ro[1100] == 123123); - test(ro[1101] == 0); + Test::ShortIntD di1; + di1[110] = -1; + di1[1100] = 123123; + Test::ShortIntD di2; + di2[110] = -1; + di2[111] = -100; + di2[1101] = 0; + + Test::ShortIntD _do; + Test::ShortIntD ro = p->opShortIntD(di1, di2, _do); + + test(_do == di1); + test(ro.size() == 4); + test(ro[110] == -1); + test(ro[111] == -100); + test(ro[1100] == 123123); + test(ro[1101] == 0); } { - Test::LongFloatD di1; - di1[999999110] = Ice::Float(-1.1); - di1[999999111] = Ice::Float(123123.2); - Test::LongFloatD di2; - di2[999999110] = Ice::Float(-1.1); - di2[999999120] = Ice::Float(-100.4); - di2[999999130] = Ice::Float(0.5); - - Test::LongFloatD _do; - Test::LongFloatD ro = p->opLongFloatD(di1, di2, _do); - - test(_do == di1); - test(ro.size() == 4); - test(ro[999999110] == Ice::Float(-1.1)); - test(ro[999999120] == Ice::Float(-100.4)); - test(ro[999999111] == Ice::Float(123123.2)); - test(ro[999999130] == Ice::Float(0.5)); + Test::LongFloatD di1; + di1[999999110] = Ice::Float(-1.1); + di1[999999111] = Ice::Float(123123.2); + Test::LongFloatD di2; + di2[999999110] = Ice::Float(-1.1); + di2[999999120] = Ice::Float(-100.4); + di2[999999130] = Ice::Float(0.5); + + Test::LongFloatD _do; + Test::LongFloatD ro = p->opLongFloatD(di1, di2, _do); + + test(_do == di1); + test(ro.size() == 4); + test(ro[999999110] == Ice::Float(-1.1)); + test(ro[999999120] == Ice::Float(-100.4)); + test(ro[999999111] == Ice::Float(123123.2)); + test(ro[999999130] == Ice::Float(0.5)); } { - Test::StringStringD di1; - di1["foo"] = "abc -1.1"; - di1["bar"] = "abc 123123.2"; - Test::StringStringD di2; - di2["foo"] = "abc -1.1"; - di2["FOO"] = "abc -100.4"; - di2["BAR"] = "abc 0.5"; - - Test::StringStringD _do; - Test::StringStringD ro = p->opStringStringD(di1, di2, _do); - - test(_do == di1); - test(ro.size() == 4); - test(ro["foo"] == "abc -1.1"); - test(ro["FOO"] == "abc -100.4"); - test(ro["bar"] == "abc 123123.2"); - test(ro["BAR"] == "abc 0.5"); + Test::StringStringD di1; + di1["foo"] = "abc -1.1"; + di1["bar"] = "abc 123123.2"; + Test::StringStringD di2; + di2["foo"] = "abc -1.1"; + di2["FOO"] = "abc -100.4"; + di2["BAR"] = "abc 0.5"; + + Test::StringStringD _do; + Test::StringStringD ro = p->opStringStringD(di1, di2, _do); + + test(_do == di1); + test(ro.size() == 4); + test(ro["foo"] == "abc -1.1"); + test(ro["FOO"] == "abc -100.4"); + test(ro["bar"] == "abc 123123.2"); + test(ro["BAR"] == "abc 0.5"); } { - Test::StringMyEnumD di1; - di1["abc"] = Test::enum1; - di1[""] = Test::enum2; - Test::StringMyEnumD di2; - di2["abc"] = Test::enum1; - di2["qwerty"] = Test::enum3; - di2["Hello!!"] = Test::enum2; - - Test::StringMyEnumD _do; - Test::StringMyEnumD ro = p->opStringMyEnumD(di1, di2, _do); - - test(_do == di1); - test(ro.size() == 4); - test(ro["abc"] == Test::enum1); - test(ro["qwerty"] == Test::enum3); - test(ro[""] == Test::enum2); - test(ro["Hello!!"] == Test::enum2); + Test::StringMyEnumD di1; + di1["abc"] = Test::enum1; + di1[""] = Test::enum2; + Test::StringMyEnumD di2; + di2["abc"] = Test::enum1; + di2["qwerty"] = Test::enum3; + di2["Hello!!"] = Test::enum2; + + Test::StringMyEnumD _do; + Test::StringMyEnumD ro = p->opStringMyEnumD(di1, di2, _do); + + test(_do == di1); + test(ro.size() == 4); + test(ro["abc"] == Test::enum1); + test(ro["qwerty"] == Test::enum3); + test(ro[""] == Test::enum2); + test(ro["Hello!!"] == Test::enum2); } { - const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 }; - - for(int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l) - { - Test::IntS s; - for(int i = 0; i < lengths[l]; ++i) - { - s.push_back(i); - } - Test::IntS r = p->opIntS(s); - test(r.size() == static_cast<size_t>(lengths[l])); - for(int j = 0; j < static_cast<int>(r.size()); ++j) - { - test(r[j] == -j); - } - } + const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 }; + + for(int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l) + { + Test::IntS s; + for(int i = 0; i < lengths[l]; ++i) + { + s.push_back(i); + } + Test::IntS r = p->opIntS(s); + test(r.size() == static_cast<size_t>(lengths[l])); + for(int j = 0; j < static_cast<int>(r.size()); ++j) + { + test(r[j] == -j); + } + } } { - Ice::Context ctx; - ctx["one"] = "ONE"; - ctx["two"] = "TWO"; - ctx["three"] = "THREE"; - { - Test::StringStringD r = p->opContext(); - test(p->ice_getContext().empty()); - test(r != ctx); - } - { - Test::StringStringD r = p->opContext(ctx); - test(p->ice_getContext().empty()); - test(r == ctx); - } - { - Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); - test(p2->ice_getContext() == ctx); - Test::StringStringD r = p2->opContext(); - test(r == ctx); - r = p2->opContext(ctx); - test(r == ctx); - } - - { - // - // Test that default context is obtained correctly from communicator. - // + Ice::Context ctx; + ctx["one"] = "ONE"; + ctx["two"] = "TWO"; + ctx["three"] = "THREE"; + { + Test::StringStringD r = p->opContext(); + test(p->ice_getContext().empty()); + test(r != ctx); + } + { + Test::StringStringD r = p->opContext(ctx); + test(p->ice_getContext().empty()); + test(r == ctx); + } + { + Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); + test(p2->ice_getContext() == ctx); + Test::StringStringD r = p2->opContext(); + test(r == ctx); + r = p2->opContext(ctx); + test(r == ctx); + } + + { + // + // Test that default context is obtained correctly from communicator. + // /* DEPRECATED - Ice::Context dflt; - dflt["a"] = "b"; - communicator->setDefaultContext(dflt); - test(p->opContext() != dflt); + Ice::Context dflt; + dflt["a"] = "b"; + communicator->setDefaultContext(dflt); + test(p->opContext() != dflt); - Test::MyClassPrx p2 = Test::MyClassPrx::uncheckedCast(p->ice_context(Ice::Context())); - test(p2->opContext().empty()); + Test::MyClassPrx p2 = Test::MyClassPrx::uncheckedCast(p->ice_context(Ice::Context())); + test(p2->opContext().empty()); - p2 = Test::MyClassPrx::uncheckedCast(p->ice_defaultContext()); - test(p2->opContext() == dflt); + p2 = Test::MyClassPrx::uncheckedCast(p->ice_defaultContext()); + test(p2->opContext() == dflt); - communicator->setDefaultContext(Ice::Context()); - test(!p2->opContext().empty()); + communicator->setDefaultContext(Ice::Context()); + test(!p2->opContext().empty()); - communicator->setDefaultContext(dflt); - Test::MyClassPrx c = Test::MyClassPrx::checkedCast( - communicator->stringToProxy("test:default -p 12010 -t 10000")); - test(c->opContext() == dflt); + communicator->setDefaultContext(dflt); + Test::MyClassPrx c = Test::MyClassPrx::checkedCast( + communicator->stringToProxy("test:default -p 12010 -t 10000")); + test(c->opContext() == dflt); - dflt["a"] = "c"; - Test::MyClassPrx c2 = Test::MyClassPrx::uncheckedCast(c->ice_context(dflt)); - test(c2->opContext()["a"] == "c"); + dflt["a"] = "c"; + Test::MyClassPrx c2 = Test::MyClassPrx::uncheckedCast(c->ice_context(dflt)); + test(c2->opContext()["a"] == "c"); - dflt.clear(); - Test::MyClassPrx c3 = Test::MyClassPrx::uncheckedCast(c2->ice_context(dflt)); - Ice::Context tmp = c3->opContext(); - test(tmp.find("a") == tmp.end()); + dflt.clear(); + Test::MyClassPrx c3 = Test::MyClassPrx::uncheckedCast(c2->ice_context(dflt)); + Ice::Context tmp = c3->opContext(); + test(tmp.find("a") == tmp.end()); - Test::MyClassPrx c4 = Test::MyClassPrx::uncheckedCast(c2->ice_defaultContext()); - test(c4->opContext()["a"] == "b"); + Test::MyClassPrx c4 = Test::MyClassPrx::uncheckedCast(c2->ice_defaultContext()); + test(c4->opContext()["a"] == "b"); - dflt["a"] = "d"; - communicator->setDefaultContext(dflt); + dflt["a"] = "d"; + communicator->setDefaultContext(dflt); - Test::MyClassPrx c5 = Test::MyClassPrx::uncheckedCast(c->ice_defaultContext()); - test(c5->opContext()["a"] == "d"); + Test::MyClassPrx c5 = Test::MyClassPrx::uncheckedCast(c->ice_defaultContext()); + test(c5->opContext()["a"] == "d"); - communicator->setDefaultContext(Ice::Context()); + communicator->setDefaultContext(Ice::Context()); */ - } - - { - // - // Test implicit context propagation - // - - string impls[] = {"Shared", "SharedWithoutLocking", "PerThread"}; - for(int i = 0; i < 3; i++) - { - Ice::InitializationData initData; - initData.properties = communicator->getProperties()->clone(); - initData.properties->setProperty("Ice.ImplicitContext", impls[i]); - - Ice::CommunicatorPtr ic = Ice::initialize(initData); - - Ice::Context ctx; - ctx["one"] = "ONE"; - ctx["two"] = "TWO"; - ctx["three"] = "THREE"; - - Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast( - ic->stringToProxy("test:default -p 12010 -t 10000")); - - ic->getImplicitContext()->setContext(ctx); - test(ic->getImplicitContext()->getContext() == ctx); - test(p->opContext() == ctx); - - ic->getImplicitContext()->set("zero", "ZERO"); - test(ic->getImplicitContext()->get("zero") == "ZERO"); - test(ic->getImplicitContext()->getWithDefault("foobar", "foo") == "foo"); - - ctx = ic->getImplicitContext()->getContext(); - test(p->opContext() == ctx); - - Ice::Context prxContext; - prxContext["one"] = "UN"; - prxContext["four"] = "QUATRE"; - - Ice::Context combined = prxContext; - combined.insert(ctx.begin(), ctx.end()); - test(combined["one"] == "UN"); - - p = Test::MyClassPrx::uncheckedCast(p->ice_context(prxContext)); - - ic->getImplicitContext()->setContext(Ice::Context()); - test(p->opContext() == prxContext); - - ic->getImplicitContext()->setContext(ctx); - test(p->opContext() == combined); - - ic->destroy(); - } - } - + } + + { + // + // Test implicit context propagation + // + + string impls[] = {"Shared", "SharedWithoutLocking", "PerThread"}; + for(int i = 0; i < 3; i++) + { + Ice::InitializationData initData; + initData.properties = communicator->getProperties()->clone(); + initData.properties->setProperty("Ice.ImplicitContext", impls[i]); + + Ice::CommunicatorPtr ic = Ice::initialize(initData); + + Ice::Context ctx; + ctx["one"] = "ONE"; + ctx["two"] = "TWO"; + ctx["three"] = "THREE"; + + Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast( + ic->stringToProxy("test:default -p 12010 -t 10000")); + + ic->getImplicitContext()->setContext(ctx); + test(ic->getImplicitContext()->getContext() == ctx); + test(p->opContext() == ctx); + + ic->getImplicitContext()->set("zero", "ZERO"); + test(ic->getImplicitContext()->get("zero") == "ZERO"); + test(ic->getImplicitContext()->getWithDefault("foobar", "foo") == "foo"); + + ctx = ic->getImplicitContext()->getContext(); + test(p->opContext() == ctx); + + Ice::Context prxContext; + prxContext["one"] = "UN"; + prxContext["four"] = "QUATRE"; + + Ice::Context combined = prxContext; + combined.insert(ctx.begin(), ctx.end()); + test(combined["one"] == "UN"); + + p = Test::MyClassPrx::uncheckedCast(p->ice_context(prxContext)); + + ic->getImplicitContext()->setContext(Ice::Context()); + test(p->opContext() == prxContext); + + ic->getImplicitContext()->setContext(ctx); + test(p->opContext() == combined); + + ic->destroy(); + } + } + } { Ice::Double d = 1278312346.0 / 13.0; - Test::DoubleS ds(5, d); - p->opDoubleMarshaling(d, ds); + Test::DoubleS ds(5, d); + p->opDoubleMarshaling(d, ds); } } diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index 55cfdaf9841..37bdf2895b4 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -29,7 +29,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> public: CallbackBase() : - _called(false) + _called(false) { } @@ -39,26 +39,26 @@ public: bool check() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - while(!_called) - { - if(!timedWait(IceUtil::Time::seconds(5))) - { - return false; - } - } - _called = false; - return true; + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + while(!_called) + { + if(!timedWait(IceUtil::Time::seconds(5))) + { + return false; + } + } + _called = false; + return true; } protected: void called() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - assert(!_called); - _called = true; - notify(); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + assert(!_called); + _called = true; + notify(); } private: @@ -72,12 +72,12 @@ public: virtual void ice_response() { - called(); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -89,12 +89,12 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(dynamic_cast<const ::Ice::TwowayOnlyException*>(&ex)); + test(dynamic_cast<const ::Ice::TwowayOnlyException*>(&ex)); called(); } }; @@ -107,14 +107,14 @@ public: virtual void ice_response(::Ice::Byte r, ::Ice::Byte b) { - test(b == Ice::Byte(0xf0)); - test(r == Ice::Byte(0xff)); - called(); + test(b == Ice::Byte(0xf0)); + test(r == Ice::Byte(0xff)); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -126,12 +126,12 @@ public: virtual void ice_response(::Ice::Byte r, ::Ice::Byte b) { - test(false); + test(false); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(dynamic_cast<const ::Ice::TwowayOnlyException*>(&ex)); + test(dynamic_cast<const ::Ice::TwowayOnlyException*>(&ex)); called(); } }; @@ -145,14 +145,14 @@ public: virtual void ice_response(bool r, bool b) { - test(b); - test(!r); - called(); + test(b); + test(!r); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -164,16 +164,16 @@ public: virtual void ice_response(::Ice::Long r, ::Ice::Short s, ::Ice::Int i, ::Ice::Long l) { - test(s == 10); - test(i == 11); - test(l == 12); - test(r == 12); - called(); + test(s == 10); + test(i == 11); + test(l == 12); + test(r == 12); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -185,15 +185,15 @@ public: virtual void ice_response(::Ice::Double r, ::Ice::Float f, ::Ice::Double d) { - test(f == Ice::Float(3.14)); - test(d == Ice::Double(1.1E10)); - test(r == Ice::Double(1.1E10)); - called(); + test(f == Ice::Float(3.14)); + test(d == Ice::Double(1.1E10)); + test(r == Ice::Double(1.1E10)); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -205,14 +205,14 @@ public: virtual void ice_response(const ::std::string& r, const ::std::string& s) { - test(s == "world hello"); - test(r == "hello world"); - called(); + test(s == "world hello"); + test(r == "hello world"); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -224,14 +224,14 @@ public: virtual void ice_response(::Test::MyEnum r, ::Test::MyEnum e) { - test(e == Test::enum2); - test(r == Test::enum3); - called(); + test(e == Test::enum2); + test(r == Test::enum3); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -248,29 +248,29 @@ public: virtual void ice_response(const ::Test::MyClassPrx& r, const ::Test::MyClassPrx& c1, const ::Test::MyClassPrx& c2) { - test(c1->ice_getIdentity() == _communicator->stringToIdentity("test")); - test(c2->ice_getIdentity() == _communicator->stringToIdentity("noSuchIdentity")); - test(r->ice_getIdentity() == _communicator->stringToIdentity("test")); - // We can't do the callbacks below in thread per connection mode. - if(!_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPerConnection")) - { - r->opVoid(); - c1->opVoid(); - try - { - c2->opVoid(); - test(false); - } - catch(const Ice::ObjectNotExistException&) - { - } - } - called(); + test(c1->ice_getIdentity() == _communicator->stringToIdentity("test")); + test(c2->ice_getIdentity() == _communicator->stringToIdentity("noSuchIdentity")); + test(r->ice_getIdentity() == _communicator->stringToIdentity("test")); + // We can't do the callbacks below in thread per connection mode. + if(!_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPerConnection")) + { + r->opVoid(); + c1->opVoid(); + try + { + c2->opVoid(); + test(false); + } + catch(const Ice::ObjectNotExistException&) + { + } + } + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } private: @@ -291,22 +291,22 @@ public: virtual void ice_response(const ::Test::Structure& rso, const ::Test::Structure& so) { - test(rso.p == 0); - test(rso.e == Test::enum2); - test(rso.s.s == "def"); - test(so.e == Test::enum3); - test(so.s.s == "a new string"); - // We can't do the callbacks below in thread per connection mode. - if(!_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPerConnection")) - { - so.p->opVoid(); - } - called(); + test(rso.p == 0); + test(rso.e == Test::enum2); + test(rso.s.s == "def"); + test(so.e == Test::enum3); + test(so.s.s == "a new string"); + // We can't do the callbacks below in thread per connection mode. + if(!_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPerConnection")) + { + so.p->opVoid(); + } + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } private: @@ -322,26 +322,26 @@ public: virtual void ice_response(const ::Test::ByteS& rso, const ::Test::ByteS& bso) { - test(bso.size() == 4); - test(bso[0] == Ice::Byte(0x22)); - test(bso[1] == Ice::Byte(0x12)); - test(bso[2] == Ice::Byte(0x11)); - test(bso[3] == Ice::Byte(0x01)); - test(rso.size() == 8); - test(rso[0] == Ice::Byte(0x01)); - test(rso[1] == Ice::Byte(0x11)); - test(rso[2] == Ice::Byte(0x12)); - test(rso[3] == Ice::Byte(0x22)); - test(rso[4] == Ice::Byte(0xf1)); - test(rso[5] == Ice::Byte(0xf2)); - test(rso[6] == Ice::Byte(0xf3)); - test(rso[7] == Ice::Byte(0xf4)); - called(); + test(bso.size() == 4); + test(bso[0] == Ice::Byte(0x22)); + test(bso[1] == Ice::Byte(0x12)); + test(bso[2] == Ice::Byte(0x11)); + test(bso[3] == Ice::Byte(0x01)); + test(rso.size() == 8); + test(rso[0] == Ice::Byte(0x01)); + test(rso[1] == Ice::Byte(0x11)); + test(rso[2] == Ice::Byte(0x12)); + test(rso[3] == Ice::Byte(0x22)); + test(rso[4] == Ice::Byte(0xf1)); + test(rso[5] == Ice::Byte(0xf2)); + test(rso[6] == Ice::Byte(0xf3)); + test(rso[7] == Ice::Byte(0xf4)); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -353,21 +353,21 @@ public: virtual void ice_response(const ::Test::BoolS& rso, const ::Test::BoolS& bso) { - test(bso.size() == 4); - test(bso[0]); - test(bso[1]); - test(!bso[2]); - test(!bso[3]); - test(rso.size() == 3); - test(!rso[0]); - test(rso[1]); - test(rso[2]); - called(); + test(bso.size() == 4); + test(bso[0]); + test(bso[1]); + test(!bso[2]); + test(!bso[3]); + test(rso.size() == 3); + test(!rso[0]); + test(rso[1]); + test(rso[2]); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -378,34 +378,34 @@ class AMI_MyClass_opShortIntLongSI : public Test::AMI_MyClass_opShortIntLongS, p public: virtual void ice_response(const ::Test::LongS& rso, const ::Test::ShortS& sso, const ::Test::IntS& iso, - const ::Test::LongS& lso) - { - test(sso.size() == 3); - test(sso[0] == 1); - test(sso[1] == 2); - test(sso[2] == 3); - test(iso.size() == 4); - test(iso[0] == 8); - test(iso[1] == 7); - test(iso[2] == 6); - test(iso[3] == 5); - test(lso.size() == 6); - test(lso[0] == 10); - test(lso[1] == 30); - test(lso[2] == 20); - test(lso[3] == 10); - test(lso[4] == 30); - test(lso[5] == 20); - test(rso.size() == 3); - test(rso[0] == 10); - test(rso[1] == 30); - test(rso[2] == 20); - called(); + const ::Test::LongS& lso) + { + test(sso.size() == 3); + test(sso[0] == 1); + test(sso[1] == 2); + test(sso[2] == 3); + test(iso.size() == 4); + test(iso[0] == 8); + test(iso[1] == 7); + test(iso[2] == 6); + test(iso[3] == 5); + test(lso.size() == 6); + test(lso[0] == 10); + test(lso[1] == 30); + test(lso[2] == 20); + test(lso[3] == 10); + test(lso[4] == 30); + test(lso[5] == 20); + test(rso.size() == 3); + test(rso[0] == 10); + test(rso[1] == 30); + test(rso[2] == 20); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -417,25 +417,25 @@ public: virtual void ice_response(const ::Test::DoubleS& rso, const ::Test::FloatS& fso, const ::Test::DoubleS& dso) { - test(fso.size() == 2); - test(fso[0] == ::Ice::Float(3.14)); - test(fso[1] == ::Ice::Float(1.11)); - test(dso.size() == 3); - test(dso[0] == ::Ice::Double(1.3E10)); - test(dso[1] == ::Ice::Double(1.2E10)); - test(dso[2] == ::Ice::Double(1.1E10)); - test(rso.size() == 5); - test(rso[0] == ::Ice::Double(1.1E10)); - test(rso[1] == ::Ice::Double(1.2E10)); - test(rso[2] == ::Ice::Double(1.3E10)); - test(::Ice::Float(rso[3]) == ::Ice::Float(3.14)); - test(::Ice::Float(rso[4]) == ::Ice::Float(1.11)); - called(); + test(fso.size() == 2); + test(fso[0] == ::Ice::Float(3.14)); + test(fso[1] == ::Ice::Float(1.11)); + test(dso.size() == 3); + test(dso[0] == ::Ice::Double(1.3E10)); + test(dso[1] == ::Ice::Double(1.2E10)); + test(dso[2] == ::Ice::Double(1.1E10)); + test(rso.size() == 5); + test(rso[0] == ::Ice::Double(1.1E10)); + test(rso[1] == ::Ice::Double(1.2E10)); + test(rso[2] == ::Ice::Double(1.3E10)); + test(::Ice::Float(rso[3]) == ::Ice::Float(3.14)); + test(::Ice::Float(rso[4]) == ::Ice::Float(1.11)); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -447,21 +447,21 @@ public: virtual void ice_response(const ::Test::StringS& rso, const ::Test::StringS& sso) { - test(sso.size() == 4); - test(sso[0] == "abc"); - test(sso[1] == "de"); - test(sso[2] == "fghi"); - test(sso[3] == "xyz"); - test(rso.size() == 3); - test(rso[0] == "fghi"); - test(rso[1] == "de"); - test(rso[2] == "abc"); - called(); + test(sso.size() == 4); + test(sso[0] == "abc"); + test(sso[1] == "de"); + test(sso[2] == "fghi"); + test(sso[3] == "xyz"); + test(rso.size() == 3); + test(rso[0] == "fghi"); + test(rso[1] == "de"); + test(rso[2] == "abc"); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -473,31 +473,31 @@ public: virtual void ice_response(const ::Test::ByteSS& rso, const ::Test::ByteSS& bso) { - test(bso.size() == 2); - test(bso[0].size() == 1); - test(bso[0][0] == Ice::Byte(0xff)); - test(bso[1].size() == 3); - test(bso[1][0] == Ice::Byte(0x01)); - test(bso[1][1] == Ice::Byte(0x11)); - test(bso[1][2] == Ice::Byte(0x12)); - test(rso.size() == 4); - test(rso[0].size() == 3); - test(rso[0][0] == Ice::Byte(0x01)); - test(rso[0][1] == Ice::Byte(0x11)); - test(rso[0][2] == Ice::Byte(0x12)); - test(rso[1].size() == 1); - test(rso[1][0] == Ice::Byte(0xff)); - test(rso[2].size() == 1); - test(rso[2][0] == Ice::Byte(0x0e)); - test(rso[3].size() == 2); - test(rso[3][0] == Ice::Byte(0xf2)); - test(rso[3][1] == Ice::Byte(0xf1)); - called(); + test(bso.size() == 2); + test(bso[0].size() == 1); + test(bso[0][0] == Ice::Byte(0xff)); + test(bso[1].size() == 3); + test(bso[1][0] == Ice::Byte(0x01)); + test(bso[1][1] == Ice::Byte(0x11)); + test(bso[1][2] == Ice::Byte(0x12)); + test(rso.size() == 4); + test(rso[0].size() == 3); + test(rso[0][0] == Ice::Byte(0x01)); + test(rso[0][1] == Ice::Byte(0x11)); + test(rso[0][2] == Ice::Byte(0x12)); + test(rso[1].size() == 1); + test(rso[1][0] == Ice::Byte(0xff)); + test(rso[2].size() == 1); + test(rso[2][0] == Ice::Byte(0x0e)); + test(rso[3].size() == 2); + test(rso[3][0] == Ice::Byte(0xf2)); + test(rso[3][1] == Ice::Byte(0xf1)); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -509,12 +509,12 @@ public: virtual void ice_response(const ::Test::BoolSS&, const ::Test::BoolSS& bso) { - called(); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -525,14 +525,14 @@ class AMI_MyClass_opShortIntLongSSI : public Test::AMI_MyClass_opShortIntLongSS, public: virtual void ice_response(const ::Test::LongSS&, const ::Test::ShortSS&, const ::Test::IntSS&, - const ::Test::LongSS&) + const ::Test::LongSS&) { - called(); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -544,32 +544,32 @@ public: virtual void ice_response(const ::Test::DoubleSS& rso, const ::Test::FloatSS& fso, const ::Test::DoubleSS& dso) { - test(fso.size() == 3); - test(fso[0].size() == 1); - test(fso[0][0] == ::Ice::Float(3.14)); - test(fso[1].size() == 1); - test(fso[1][0] == ::Ice::Float(1.11)); - test(fso[2].size() == 0); - test(dso.size() == 1); - test(dso[0].size() == 3); - test(dso[0][0] == ::Ice::Double(1.1E10)); - test(dso[0][1] == ::Ice::Double(1.2E10)); - test(dso[0][2] == ::Ice::Double(1.3E10)); - test(rso.size() == 2); - test(rso[0].size() == 3); - test(rso[0][0] == ::Ice::Double(1.1E10)); - test(rso[0][1] == ::Ice::Double(1.2E10)); - test(rso[0][2] == ::Ice::Double(1.3E10)); - test(rso[1].size() == 3); - test(rso[1][0] == ::Ice::Double(1.1E10)); - test(rso[1][1] == ::Ice::Double(1.2E10)); - test(rso[1][2] == ::Ice::Double(1.3E10)); - called(); + test(fso.size() == 3); + test(fso[0].size() == 1); + test(fso[0][0] == ::Ice::Float(3.14)); + test(fso[1].size() == 1); + test(fso[1][0] == ::Ice::Float(1.11)); + test(fso[2].size() == 0); + test(dso.size() == 1); + test(dso[0].size() == 3); + test(dso[0][0] == ::Ice::Double(1.1E10)); + test(dso[0][1] == ::Ice::Double(1.2E10)); + test(dso[0][2] == ::Ice::Double(1.3E10)); + test(rso.size() == 2); + test(rso[0].size() == 3); + test(rso[0][0] == ::Ice::Double(1.1E10)); + test(rso[0][1] == ::Ice::Double(1.2E10)); + test(rso[0][2] == ::Ice::Double(1.3E10)); + test(rso[1].size() == 3); + test(rso[1][0] == ::Ice::Double(1.1E10)); + test(rso[1][1] == ::Ice::Double(1.2E10)); + test(rso[1][2] == ::Ice::Double(1.3E10)); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -581,27 +581,27 @@ public: virtual void ice_response(const ::Test::StringSS& rso, const ::Test::StringSS& sso) { - test(sso.size() == 5); - test(sso[0].size() == 1); - test(sso[0][0] == "abc"); - test(sso[1].size() == 2); - test(sso[1][0] == "de"); - test(sso[1][1] == "fghi"); - test(sso[2].size() == 0); - test(sso[3].size() == 0); - test(sso[4].size() == 1); - test(sso[4][0] == "xyz"); - test(rso.size() == 3); - test(rso[0].size() == 1); - test(rso[0][0] == "xyz"); - test(rso[1].size() == 0); - test(rso[2].size() == 0); - called(); + test(sso.size() == 5); + test(sso[0].size() == 1); + test(sso[0][0] == "abc"); + test(sso[1].size() == 2); + test(sso[1][0] == "de"); + test(sso[1][1] == "fghi"); + test(sso[2].size() == 0); + test(sso[3].size() == 0); + test(sso[4].size() == 1); + test(sso[4][0] == "xyz"); + test(rso.size() == 3); + test(rso[0].size() == 1); + test(rso[0][0] == "xyz"); + test(rso[1].size() == 0); + test(rso[2].size() == 0); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -613,25 +613,25 @@ public: virtual void ice_response(const ::Test::ByteBoolD& ro, const ::Test::ByteBoolD& _do) { - Test::ByteBoolD di1; - di1[10] = true; - di1[100] = false; - test(_do == di1); - test(ro.size() == 4); - test(ro.find(10) != ro.end()); - test(ro.find(10)->second == true); - test(ro.find(11) != ro.end()); - test(ro.find(11)->second == false); - test(ro.find(100) != ro.end()); - test(ro.find(100)->second == false); - test(ro.find(101) != ro.end()); - test(ro.find(101)->second == true); - called(); + Test::ByteBoolD di1; + di1[10] = true; + di1[100] = false; + test(_do == di1); + test(ro.size() == 4); + test(ro.find(10) != ro.end()); + test(ro.find(10)->second == true); + test(ro.find(11) != ro.end()); + test(ro.find(11)->second == false); + test(ro.find(100) != ro.end()); + test(ro.find(100)->second == false); + test(ro.find(101) != ro.end()); + test(ro.find(101)->second == true); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -643,25 +643,25 @@ public: virtual void ice_response(const ::Test::ShortIntD& ro, const ::Test::ShortIntD& _do) { - Test::ShortIntD di1; - di1[110] = -1; - di1[1100] = 123123; - test(_do == di1); - test(ro.size() == 4); - test(ro.find(110) != ro.end()); - test(ro.find(110)->second == -1); - test(ro.find(111) != ro.end()); - test(ro.find(111)->second == -100); - test(ro.find(1100) != ro.end()); - test(ro.find(1100)->second == 123123); - test(ro.find(1101) != ro.end()); - test(ro.find(1101)->second == 0); - called(); + Test::ShortIntD di1; + di1[110] = -1; + di1[1100] = 123123; + test(_do == di1); + test(ro.size() == 4); + test(ro.find(110) != ro.end()); + test(ro.find(110)->second == -1); + test(ro.find(111) != ro.end()); + test(ro.find(111)->second == -100); + test(ro.find(1100) != ro.end()); + test(ro.find(1100)->second == 123123); + test(ro.find(1101) != ro.end()); + test(ro.find(1101)->second == 0); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -673,25 +673,25 @@ public: virtual void ice_response(const ::Test::LongFloatD& ro, const ::Test::LongFloatD& _do) { - Test::LongFloatD di1; - di1[999999110] = Ice::Float(-1.1); - di1[999999111] = Ice::Float(123123.2); - test(_do == di1); - test(ro.size() == 4); - test(ro.find(999999110) != ro.end()); - test(ro.find(999999110)->second == Ice::Float(-1.1)); - test(ro.find(999999120) != ro.end()); - test(ro.find(999999120)->second == Ice::Float(-100.4)); - test(ro.find(999999111) != ro.end()); - test(ro.find(999999111)->second == Ice::Float(123123.2)); - test(ro.find(999999130) != ro.end()); - test(ro.find(999999130)->second == Ice::Float(0.5)); - called(); + Test::LongFloatD di1; + di1[999999110] = Ice::Float(-1.1); + di1[999999111] = Ice::Float(123123.2); + test(_do == di1); + test(ro.size() == 4); + test(ro.find(999999110) != ro.end()); + test(ro.find(999999110)->second == Ice::Float(-1.1)); + test(ro.find(999999120) != ro.end()); + test(ro.find(999999120)->second == Ice::Float(-100.4)); + test(ro.find(999999111) != ro.end()); + test(ro.find(999999111)->second == Ice::Float(123123.2)); + test(ro.find(999999130) != ro.end()); + test(ro.find(999999130)->second == Ice::Float(0.5)); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -703,25 +703,25 @@ public: virtual void ice_response(const ::Test::StringStringD& ro, const ::Test::StringStringD& _do) { - Test::StringStringD di1; - di1["foo"] = "abc -1.1"; - di1["bar"] = "abc 123123.2"; - test(_do == di1); - test(ro.size() == 4); - test(ro.find("foo") != ro.end()); - test(ro.find("foo")->second == "abc -1.1"); - test(ro.find("FOO") != ro.end()); - test(ro.find("FOO")->second == "abc -100.4"); - test(ro.find("bar") != ro.end()); - test(ro.find("bar")->second == "abc 123123.2"); - test(ro.find("BAR") != ro.end()); - test(ro.find("BAR")->second == "abc 0.5"); - called(); + Test::StringStringD di1; + di1["foo"] = "abc -1.1"; + di1["bar"] = "abc 123123.2"; + test(_do == di1); + test(ro.size() == 4); + test(ro.find("foo") != ro.end()); + test(ro.find("foo")->second == "abc -1.1"); + test(ro.find("FOO") != ro.end()); + test(ro.find("FOO")->second == "abc -100.4"); + test(ro.find("bar") != ro.end()); + test(ro.find("bar")->second == "abc 123123.2"); + test(ro.find("BAR") != ro.end()); + test(ro.find("BAR")->second == "abc 0.5"); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -733,25 +733,25 @@ public: virtual void ice_response(const ::Test::StringMyEnumD& ro, const ::Test::StringMyEnumD& _do) { - Test::StringMyEnumD di1; - di1["abc"] = Test::enum1; - di1[""] = Test::enum2; - test(_do == di1); - test(ro.size() == 4); - test(ro.find("abc") != ro.end()); - test(ro.find("abc")->second == Test::enum1); - test(ro.find("qwerty") != ro.end()); - test(ro.find("qwerty")->second == Test::enum3); - test(ro.find("") != ro.end()); - test(ro.find("")->second == Test::enum2); - test(ro.find("Hello!!") != ro.end()); - test(ro.find("Hello!!")->second == Test::enum2); - called(); + Test::StringMyEnumD di1; + di1["abc"] = Test::enum1; + di1[""] = Test::enum2; + test(_do == di1); + test(ro.size() == 4); + test(ro.find("abc") != ro.end()); + test(ro.find("abc")->second == Test::enum1); + test(ro.find("qwerty") != ro.end()); + test(ro.find("qwerty")->second == Test::enum3); + test(ro.find("") != ro.end()); + test(ro.find("")->second == Test::enum2); + test(ro.find("Hello!!") != ro.end()); + test(ro.find("Hello!!")->second == Test::enum2); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -765,17 +765,17 @@ public: virtual void ice_response(const Test::IntS& r) { - test(r.size() == static_cast<size_t>(_l)); - for(int j = 0; j < _l; ++j) - { - test(r[j] == -j); - } - called(); + test(r.size() == static_cast<size_t>(_l)); + for(int j = 0; j < _l; ++j) + { + test(r[j] == -j); + } + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } private: @@ -795,13 +795,13 @@ public: virtual void ice_response(const Test::StringStringD& r) { - test(r == _d); - called(); + test(r == _d); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } private: @@ -821,13 +821,13 @@ public: virtual void ice_response(const Test::StringStringD& r) { - test(r != _d); - called(); + test(r != _d); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } private: @@ -843,12 +843,12 @@ public: virtual void ice_response() { - called(); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -860,12 +860,12 @@ public: virtual void ice_response() { - called(); + called(); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(false); + test(false); } }; @@ -876,541 +876,541 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) { { // Check that a call to a void operation raises TwowayOnlyException - // in the ice_exception() callback instead of at the point of call. - Test::MyClassPrx oneway = Test::MyClassPrx::uncheckedCast(p->ice_oneway()); - AMI_MyClass_opVoidExIPtr cb = new AMI_MyClass_opVoidExI; - try { - oneway->opVoid_async(cb); - } - catch(const Ice::Exception&) - { - test(false); - } - test(cb->check()); + // in the ice_exception() callback instead of at the point of call. + Test::MyClassPrx oneway = Test::MyClassPrx::uncheckedCast(p->ice_oneway()); + AMI_MyClass_opVoidExIPtr cb = new AMI_MyClass_opVoidExI; + try { + oneway->opVoid_async(cb); + } + catch(const Ice::Exception&) + { + test(false); + } + test(cb->check()); } { // Check that a call to a twoway operation raises TwowayOnlyException - // in the ice_exception() callback instead of at the point of call. - Test::MyClassPrx oneway = Test::MyClassPrx::uncheckedCast(p->ice_oneway()); - AMI_MyClass_opByteExIPtr cb = new AMI_MyClass_opByteExI; - try - { - oneway->opByte_async(cb, 0, 0); - } - catch(const Ice::Exception&) - { - test(false); - } - test(cb->check()); + // in the ice_exception() callback instead of at the point of call. + Test::MyClassPrx oneway = Test::MyClassPrx::uncheckedCast(p->ice_oneway()); + AMI_MyClass_opByteExIPtr cb = new AMI_MyClass_opByteExI; + try + { + oneway->opByte_async(cb, 0, 0); + } + catch(const Ice::Exception&) + { + test(false); + } + test(cb->check()); } { - AMI_MyClass_opVoidIPtr cb = new AMI_MyClass_opVoidI; - p->opVoid_async(cb); - test(cb->check()); - // Let's check if we can reuse the same callback object for another call. - p->opVoid_async(cb); - test(cb->check()); + AMI_MyClass_opVoidIPtr cb = new AMI_MyClass_opVoidI; + p->opVoid_async(cb); + test(cb->check()); + // Let's check if we can reuse the same callback object for another call. + p->opVoid_async(cb); + test(cb->check()); } { - AMI_MyClass_opByteIPtr cb = new AMI_MyClass_opByteI; - p->opByte_async(cb, Ice::Byte(0xff), Ice::Byte(0x0f)); - test(cb->check()); + AMI_MyClass_opByteIPtr cb = new AMI_MyClass_opByteI; + p->opByte_async(cb, Ice::Byte(0xff), Ice::Byte(0x0f)); + test(cb->check()); } { - AMI_MyClass_opBoolIPtr cb = new AMI_MyClass_opBoolI; - p->opBool_async(cb, true, false); - test(cb->check()); + AMI_MyClass_opBoolIPtr cb = new AMI_MyClass_opBoolI; + p->opBool_async(cb, true, false); + test(cb->check()); } { - AMI_MyClass_opShortIntLongIPtr cb = new AMI_MyClass_opShortIntLongI; - p->opShortIntLong_async(cb, 10, 11, 12); - test(cb->check()); + AMI_MyClass_opShortIntLongIPtr cb = new AMI_MyClass_opShortIntLongI; + p->opShortIntLong_async(cb, 10, 11, 12); + test(cb->check()); } { - AMI_MyClass_opFloatDoubleIPtr cb = new AMI_MyClass_opFloatDoubleI; - p->opFloatDouble_async(cb, Ice::Float(3.14), Ice::Double(1.1E10)); - test(cb->check()); - // Let's check if we can reuse the same callback object for another call. - p->opFloatDouble_async(cb, Ice::Float(3.14), Ice::Double(1.1E10)); - test(cb->check()); + AMI_MyClass_opFloatDoubleIPtr cb = new AMI_MyClass_opFloatDoubleI; + p->opFloatDouble_async(cb, Ice::Float(3.14), Ice::Double(1.1E10)); + test(cb->check()); + // Let's check if we can reuse the same callback object for another call. + p->opFloatDouble_async(cb, Ice::Float(3.14), Ice::Double(1.1E10)); + test(cb->check()); } { - AMI_MyClass_opStringIPtr cb = new AMI_MyClass_opStringI; - p->opString_async(cb, "hello", "world"); - test(cb->check()); + AMI_MyClass_opStringIPtr cb = new AMI_MyClass_opStringI; + p->opString_async(cb, "hello", "world"); + test(cb->check()); } { - AMI_MyClass_opMyEnumIPtr cb = new AMI_MyClass_opMyEnumI; - p->opMyEnum_async(cb, Test::enum2); - test(cb->check()); + AMI_MyClass_opMyEnumIPtr cb = new AMI_MyClass_opMyEnumI; + p->opMyEnum_async(cb, Test::enum2); + test(cb->check()); } { - AMI_MyClass_opMyClassIPtr cb = new AMI_MyClass_opMyClassI(communicator); - p->opMyClass_async(cb, p); - test(cb->check()); + AMI_MyClass_opMyClassIPtr cb = new AMI_MyClass_opMyClassI(communicator); + p->opMyClass_async(cb, p); + test(cb->check()); } { - Test::Structure si1; - si1.p = p; - si1.e = Test::enum3; - si1.s.s = "abc"; - Test::Structure si2; - si2.p = 0; - si2.e = Test::enum2; - si2.s.s = "def"; - - AMI_MyClass_opStructIPtr cb = new AMI_MyClass_opStructI(communicator); - p->opStruct_async(cb, si1, si2); - test(cb->check()); + Test::Structure si1; + si1.p = p; + si1.e = Test::enum3; + si1.s.s = "abc"; + Test::Structure si2; + si2.p = 0; + si2.e = Test::enum2; + si2.s.s = "def"; + + AMI_MyClass_opStructIPtr cb = new AMI_MyClass_opStructI(communicator); + p->opStruct_async(cb, si1, si2); + test(cb->check()); } { - Test::ByteS bsi1; - Test::ByteS bsi2; + Test::ByteS bsi1; + Test::ByteS bsi2; - bsi1.push_back(Ice::Byte(0x01)); - bsi1.push_back(Ice::Byte(0x11)); - bsi1.push_back(Ice::Byte(0x12)); - bsi1.push_back(Ice::Byte(0x22)); + bsi1.push_back(Ice::Byte(0x01)); + bsi1.push_back(Ice::Byte(0x11)); + bsi1.push_back(Ice::Byte(0x12)); + bsi1.push_back(Ice::Byte(0x22)); - bsi2.push_back(Ice::Byte(0xf1)); - bsi2.push_back(Ice::Byte(0xf2)); - bsi2.push_back(Ice::Byte(0xf3)); - bsi2.push_back(Ice::Byte(0xf4)); + bsi2.push_back(Ice::Byte(0xf1)); + bsi2.push_back(Ice::Byte(0xf2)); + bsi2.push_back(Ice::Byte(0xf3)); + bsi2.push_back(Ice::Byte(0xf4)); - AMI_MyClass_opByteSIPtr cb = new AMI_MyClass_opByteSI; - p->opByteS_async(cb, bsi1, bsi2); - test(cb->check()); + AMI_MyClass_opByteSIPtr cb = new AMI_MyClass_opByteSI; + p->opByteS_async(cb, bsi1, bsi2); + test(cb->check()); } { - Test::BoolS bsi1; - Test::BoolS bsi2; + Test::BoolS bsi1; + Test::BoolS bsi2; - bsi1.push_back(true); - bsi1.push_back(true); - bsi1.push_back(false); + bsi1.push_back(true); + bsi1.push_back(true); + bsi1.push_back(false); - bsi2.push_back(false); + bsi2.push_back(false); - AMI_MyClass_opBoolSIPtr cb = new AMI_MyClass_opBoolSI; - p->opBoolS_async(cb, bsi1, bsi2); - test(cb->check()); + AMI_MyClass_opBoolSIPtr cb = new AMI_MyClass_opBoolSI; + p->opBoolS_async(cb, bsi1, bsi2); + test(cb->check()); } { - Test::ShortS ssi; - Test::IntS isi; - Test::LongS lsi; + Test::ShortS ssi; + Test::IntS isi; + Test::LongS lsi; - ssi.push_back(1); - ssi.push_back(2); - ssi.push_back(3); + ssi.push_back(1); + ssi.push_back(2); + ssi.push_back(3); - isi.push_back(5); - isi.push_back(6); - isi.push_back(7); - isi.push_back(8); + isi.push_back(5); + isi.push_back(6); + isi.push_back(7); + isi.push_back(8); - lsi.push_back(10); - lsi.push_back(30); - lsi.push_back(20); + lsi.push_back(10); + lsi.push_back(30); + lsi.push_back(20); - AMI_MyClass_opShortIntLongSIPtr cb = new AMI_MyClass_opShortIntLongSI; - p->opShortIntLongS_async(cb, ssi, isi, lsi); - test(cb->check()); + AMI_MyClass_opShortIntLongSIPtr cb = new AMI_MyClass_opShortIntLongSI; + p->opShortIntLongS_async(cb, ssi, isi, lsi); + test(cb->check()); } { - Test::FloatS fsi; - Test::DoubleS dsi; + Test::FloatS fsi; + Test::DoubleS dsi; - fsi.push_back(Ice::Float(3.14)); - fsi.push_back(Ice::Float(1.11)); + fsi.push_back(Ice::Float(3.14)); + fsi.push_back(Ice::Float(1.11)); - dsi.push_back(Ice::Double(1.1E10)); - dsi.push_back(Ice::Double(1.2E10)); - dsi.push_back(Ice::Double(1.3E10)); + dsi.push_back(Ice::Double(1.1E10)); + dsi.push_back(Ice::Double(1.2E10)); + dsi.push_back(Ice::Double(1.3E10)); - AMI_MyClass_opFloatDoubleSIPtr cb = new AMI_MyClass_opFloatDoubleSI; - p->opFloatDoubleS_async(cb, fsi, dsi); - test(cb->check()); + AMI_MyClass_opFloatDoubleSIPtr cb = new AMI_MyClass_opFloatDoubleSI; + p->opFloatDoubleS_async(cb, fsi, dsi); + test(cb->check()); } { - Test::StringS ssi1; - Test::StringS ssi2; + Test::StringS ssi1; + Test::StringS ssi2; - ssi1.push_back("abc"); - ssi1.push_back("de"); - ssi1.push_back("fghi"); + ssi1.push_back("abc"); + ssi1.push_back("de"); + ssi1.push_back("fghi"); - ssi2.push_back("xyz"); + ssi2.push_back("xyz"); - AMI_MyClass_opStringSIPtr cb = new AMI_MyClass_opStringSI; - p->opStringS_async(cb, ssi1, ssi2); - test(cb->check()); + AMI_MyClass_opStringSIPtr cb = new AMI_MyClass_opStringSI; + p->opStringS_async(cb, ssi1, ssi2); + test(cb->check()); } { - Test::ByteSS bsi1; - bsi1.resize(2); - Test::ByteSS bsi2; - bsi2.resize(2); + Test::ByteSS bsi1; + bsi1.resize(2); + Test::ByteSS bsi2; + bsi2.resize(2); - bsi1[0].push_back(Ice::Byte(0x01)); - bsi1[0].push_back(Ice::Byte(0x11)); - bsi1[0].push_back(Ice::Byte(0x12)); - bsi1[1].push_back(Ice::Byte(0xff)); + bsi1[0].push_back(Ice::Byte(0x01)); + bsi1[0].push_back(Ice::Byte(0x11)); + bsi1[0].push_back(Ice::Byte(0x12)); + bsi1[1].push_back(Ice::Byte(0xff)); - bsi2[0].push_back(Ice::Byte(0x0e)); - bsi2[1].push_back(Ice::Byte(0xf2)); - bsi2[1].push_back(Ice::Byte(0xf1)); + bsi2[0].push_back(Ice::Byte(0x0e)); + bsi2[1].push_back(Ice::Byte(0xf2)); + bsi2[1].push_back(Ice::Byte(0xf1)); - AMI_MyClass_opByteSSIPtr cb = new AMI_MyClass_opByteSSI; - p->opByteSS_async(cb, bsi1, bsi2); - test(cb->check()); + AMI_MyClass_opByteSSIPtr cb = new AMI_MyClass_opByteSSI; + p->opByteSS_async(cb, bsi1, bsi2); + test(cb->check()); } { - Test::FloatSS fsi; - fsi.resize(3); - Test::DoubleSS dsi; - dsi.resize(1); + Test::FloatSS fsi; + fsi.resize(3); + Test::DoubleSS dsi; + dsi.resize(1); - fsi[0].push_back(Ice::Float(3.14)); - fsi[1].push_back(Ice::Float(1.11)); + fsi[0].push_back(Ice::Float(3.14)); + fsi[1].push_back(Ice::Float(1.11)); - dsi[0].push_back(Ice::Double(1.1E10)); - dsi[0].push_back(Ice::Double(1.2E10)); - dsi[0].push_back(Ice::Double(1.3E10)); + dsi[0].push_back(Ice::Double(1.1E10)); + dsi[0].push_back(Ice::Double(1.2E10)); + dsi[0].push_back(Ice::Double(1.3E10)); - AMI_MyClass_opFloatDoubleSSIPtr cb = new AMI_MyClass_opFloatDoubleSSI; - p->opFloatDoubleSS_async(cb, fsi, dsi); - test(cb->check()); + AMI_MyClass_opFloatDoubleSSIPtr cb = new AMI_MyClass_opFloatDoubleSSI; + p->opFloatDoubleSS_async(cb, fsi, dsi); + test(cb->check()); } { - Test::StringSS ssi1; - ssi1.resize(2); - Test::StringSS ssi2; - ssi2.resize(3); + Test::StringSS ssi1; + ssi1.resize(2); + Test::StringSS ssi2; + ssi2.resize(3); - ssi1[0].push_back("abc"); - ssi1[1].push_back("de"); - ssi1[1].push_back("fghi"); + ssi1[0].push_back("abc"); + ssi1[1].push_back("de"); + ssi1[1].push_back("fghi"); - ssi2[2].push_back("xyz"); + ssi2[2].push_back("xyz"); - AMI_MyClass_opStringSSIPtr cb = new AMI_MyClass_opStringSSI; - p->opStringSS_async(cb, ssi1, ssi2); - test(cb->check()); + AMI_MyClass_opStringSSIPtr cb = new AMI_MyClass_opStringSSI; + p->opStringSS_async(cb, ssi1, ssi2); + test(cb->check()); } { - Test::ByteBoolD di1; - di1[10] = true; - di1[100] = false; - Test::ByteBoolD di2; - di2[10] = true; - di2[11] = false; - di2[101] = true; + Test::ByteBoolD di1; + di1[10] = true; + di1[100] = false; + Test::ByteBoolD di2; + di2[10] = true; + di2[11] = false; + di2[101] = true; - AMI_MyClass_opByteBoolDIPtr cb = new AMI_MyClass_opByteBoolDI; - p->opByteBoolD_async(cb, di1, di2); - test(cb->check()); + AMI_MyClass_opByteBoolDIPtr cb = new AMI_MyClass_opByteBoolDI; + p->opByteBoolD_async(cb, di1, di2); + test(cb->check()); } { - Test::ShortIntD di1; - di1[110] = -1; - di1[1100] = 123123; - Test::ShortIntD di2; - di2[110] = -1; - di2[111] = -100; - di2[1101] = 0; + Test::ShortIntD di1; + di1[110] = -1; + di1[1100] = 123123; + Test::ShortIntD di2; + di2[110] = -1; + di2[111] = -100; + di2[1101] = 0; - AMI_MyClass_opShortIntDIPtr cb = new AMI_MyClass_opShortIntDI; - p->opShortIntD_async(cb, di1, di2); - test(cb->check()); + AMI_MyClass_opShortIntDIPtr cb = new AMI_MyClass_opShortIntDI; + p->opShortIntD_async(cb, di1, di2); + test(cb->check()); } { - Test::LongFloatD di1; - di1[999999110] = Ice::Float(-1.1); - di1[999999111] = Ice::Float(123123.2); - Test::LongFloatD di2; - di2[999999110] = Ice::Float(-1.1); - di2[999999120] = Ice::Float(-100.4); - di2[999999130] = Ice::Float(0.5); + Test::LongFloatD di1; + di1[999999110] = Ice::Float(-1.1); + di1[999999111] = Ice::Float(123123.2); + Test::LongFloatD di2; + di2[999999110] = Ice::Float(-1.1); + di2[999999120] = Ice::Float(-100.4); + di2[999999130] = Ice::Float(0.5); - AMI_MyClass_opLongFloatDIPtr cb = new AMI_MyClass_opLongFloatDI; - p->opLongFloatD_async(cb, di1, di2); - test(cb->check()); + AMI_MyClass_opLongFloatDIPtr cb = new AMI_MyClass_opLongFloatDI; + p->opLongFloatD_async(cb, di1, di2); + test(cb->check()); } { - Test::StringStringD di1; - di1["foo"] = "abc -1.1"; - di1["bar"] = "abc 123123.2"; - Test::StringStringD di2; - di2["foo"] = "abc -1.1"; - di2["FOO"] = "abc -100.4"; - di2["BAR"] = "abc 0.5"; + Test::StringStringD di1; + di1["foo"] = "abc -1.1"; + di1["bar"] = "abc 123123.2"; + Test::StringStringD di2; + di2["foo"] = "abc -1.1"; + di2["FOO"] = "abc -100.4"; + di2["BAR"] = "abc 0.5"; - AMI_MyClass_opStringStringDIPtr cb = new AMI_MyClass_opStringStringDI; - p->opStringStringD_async(cb, di1, di2); - test(cb->check()); + AMI_MyClass_opStringStringDIPtr cb = new AMI_MyClass_opStringStringDI; + p->opStringStringD_async(cb, di1, di2); + test(cb->check()); } { - Test::StringMyEnumD di1; - di1["abc"] = Test::enum1; - di1[""] = Test::enum2; - Test::StringMyEnumD di2; - di2["abc"] = Test::enum1; - di2["qwerty"] = Test::enum3; - di2["Hello!!"] = Test::enum2; - - AMI_MyClass_opStringMyEnumDIPtr cb = new AMI_MyClass_opStringMyEnumDI; - p->opStringMyEnumD_async(cb, di1, di2); - test(cb->check()); - } + Test::StringMyEnumD di1; + di1["abc"] = Test::enum1; + di1[""] = Test::enum2; + Test::StringMyEnumD di2; + di2["abc"] = Test::enum1; + di2["qwerty"] = Test::enum3; + di2["Hello!!"] = Test::enum2; + + AMI_MyClass_opStringMyEnumDIPtr cb = new AMI_MyClass_opStringMyEnumDI; + p->opStringMyEnumD_async(cb, di1, di2); + test(cb->check()); + } { - const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 }; - - for(int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l) - { - Test::IntS s; - for(int i = 0; i < lengths[l]; ++i) - { - s.push_back(i); - } - AMI_MyClass_opIntSIPtr cb = new AMI_MyClass_opIntSI(lengths[l]); - p->opIntS_async(cb, s); - test(cb->check()); - } - } - - { - Test::StringStringD ctx; - ctx["one"] = "ONE"; - ctx["two"] = "TWO"; - ctx["three"] = "THREE"; - { - test(p->ice_getContext().empty()); - AMI_MyClass_opContextNotEqualIPtr cb = new AMI_MyClass_opContextNotEqualI(ctx); - p->opContext_async(cb); - test(cb->check()); - } - { - test(p->ice_getContext().empty()); - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p->opContext_async(cb, ctx); - test(cb->check()); - } - Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); - test(p2->ice_getContext() == ctx); - { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p2->opContext_async(cb); - test(cb->check()); - } - { - Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p2->opContext_async(cb, ctx); - test(cb->check()); - } - - { - // - // Test that default context is obtained correctly from communicator. - // + const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 }; + + for(int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l) + { + Test::IntS s; + for(int i = 0; i < lengths[l]; ++i) + { + s.push_back(i); + } + AMI_MyClass_opIntSIPtr cb = new AMI_MyClass_opIntSI(lengths[l]); + p->opIntS_async(cb, s); + test(cb->check()); + } + } + + { + Test::StringStringD ctx; + ctx["one"] = "ONE"; + ctx["two"] = "TWO"; + ctx["three"] = "THREE"; + { + test(p->ice_getContext().empty()); + AMI_MyClass_opContextNotEqualIPtr cb = new AMI_MyClass_opContextNotEqualI(ctx); + p->opContext_async(cb); + test(cb->check()); + } + { + test(p->ice_getContext().empty()); + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); + p->opContext_async(cb, ctx); + test(cb->check()); + } + Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); + test(p2->ice_getContext() == ctx); + { + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); + p2->opContext_async(cb); + test(cb->check()); + } + { + Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); + p2->opContext_async(cb, ctx); + test(cb->check()); + } + + { + // + // Test that default context is obtained correctly from communicator. + // /* DEPRECATED - Ice::Context dflt; - dflt["a"] = "b"; - communicator->setDefaultContext(dflt); - { - AMI_MyClass_opContextNotEqualIPtr cb = new AMI_MyClass_opContextNotEqualI(dflt); - p->opContext_async(cb); - test(cb->check()); - } - - Test::MyClassPrx p2 = Test::MyClassPrx::uncheckedCast(p->ice_context(Ice::Context())); - { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(Ice::Context()); - p2->opContext_async(cb); - test(cb->check()); - } - - p2 = Test::MyClassPrx::uncheckedCast(p->ice_defaultContext()); - { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(dflt); - p2->opContext_async(cb); - test(cb->check()); - } - - communicator->setDefaultContext(Ice::Context()); - { - AMI_MyClass_opContextNotEqualIPtr cb = new AMI_MyClass_opContextNotEqualI(Ice::Context()); - p2->opContext_async(cb); - test(cb->check()); - } - - communicator->setDefaultContext(dflt); - Test::MyClassPrx c = Test::MyClassPrx::checkedCast( - communicator->stringToProxy("test:default -p 12010 -t 10000")); - { - Ice::Context tmp; - tmp["a"] = "b"; - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); - c->opContext_async(cb); - test(cb->check()); - } - - dflt["a"] = "c"; - Test::MyClassPrx c2 = Test::MyClassPrx::uncheckedCast(c->ice_context(dflt)); - { - Ice::Context tmp; - tmp["a"] = "c"; - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); - c2->opContext_async(cb); - test(cb->check()); - } - - dflt.clear(); - Test::MyClassPrx c3 = Test::MyClassPrx::uncheckedCast(c2->ice_context(dflt)); - { - Ice::Context tmp; - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); - c3->opContext_async(cb); - test(cb->check()); - } - - Test::MyClassPrx c4 = Test::MyClassPrx::uncheckedCast(c2->ice_defaultContext()); - { - Ice::Context tmp; - tmp["a"] = "b"; - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); - c4->opContext_async(cb); - test(cb->check()); - } - - dflt["a"] = "d"; - communicator->setDefaultContext(dflt); - - Test::MyClassPrx c5 = Test::MyClassPrx::uncheckedCast(c->ice_defaultContext()); - { - Ice::Context tmp; - tmp["a"] = "d"; - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); - c5->opContext_async(cb); - test(cb->check()); - } - - communicator->setDefaultContext(Ice::Context()); + Ice::Context dflt; + dflt["a"] = "b"; + communicator->setDefaultContext(dflt); + { + AMI_MyClass_opContextNotEqualIPtr cb = new AMI_MyClass_opContextNotEqualI(dflt); + p->opContext_async(cb); + test(cb->check()); + } + + Test::MyClassPrx p2 = Test::MyClassPrx::uncheckedCast(p->ice_context(Ice::Context())); + { + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(Ice::Context()); + p2->opContext_async(cb); + test(cb->check()); + } + + p2 = Test::MyClassPrx::uncheckedCast(p->ice_defaultContext()); + { + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(dflt); + p2->opContext_async(cb); + test(cb->check()); + } + + communicator->setDefaultContext(Ice::Context()); + { + AMI_MyClass_opContextNotEqualIPtr cb = new AMI_MyClass_opContextNotEqualI(Ice::Context()); + p2->opContext_async(cb); + test(cb->check()); + } + + communicator->setDefaultContext(dflt); + Test::MyClassPrx c = Test::MyClassPrx::checkedCast( + communicator->stringToProxy("test:default -p 12010 -t 10000")); + { + Ice::Context tmp; + tmp["a"] = "b"; + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); + c->opContext_async(cb); + test(cb->check()); + } + + dflt["a"] = "c"; + Test::MyClassPrx c2 = Test::MyClassPrx::uncheckedCast(c->ice_context(dflt)); + { + Ice::Context tmp; + tmp["a"] = "c"; + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); + c2->opContext_async(cb); + test(cb->check()); + } + + dflt.clear(); + Test::MyClassPrx c3 = Test::MyClassPrx::uncheckedCast(c2->ice_context(dflt)); + { + Ice::Context tmp; + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); + c3->opContext_async(cb); + test(cb->check()); + } + + Test::MyClassPrx c4 = Test::MyClassPrx::uncheckedCast(c2->ice_defaultContext()); + { + Ice::Context tmp; + tmp["a"] = "b"; + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); + c4->opContext_async(cb); + test(cb->check()); + } + + dflt["a"] = "d"; + communicator->setDefaultContext(dflt); + + Test::MyClassPrx c5 = Test::MyClassPrx::uncheckedCast(c->ice_defaultContext()); + { + Ice::Context tmp; + tmp["a"] = "d"; + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(tmp); + c5->opContext_async(cb); + test(cb->check()); + } + + communicator->setDefaultContext(Ice::Context()); */ - } - - { - // - // Test implicit context propagation - // - - string impls[] = {"Shared", "SharedWithoutLocking", "PerThread"}; - for(int i = 0; i < 3; i++) - { - Ice::InitializationData initData; - initData.properties = communicator->getProperties()->clone(); - initData.properties->setProperty("Ice.ImplicitContext", impls[i]); - - Ice::CommunicatorPtr ic = Ice::initialize(initData); - - Ice::Context ctx; - ctx["one"] = "ONE"; - ctx["two"] = "TWO"; - ctx["three"] = "THREE"; - - - Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast( - ic->stringToProxy("test:default -p 12010 -t 10000")); - - - ic->getImplicitContext()->setContext(ctx); - test(ic->getImplicitContext()->getContext() == ctx); - { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p->opContext_async(cb); - test(cb->check()); - } - - ic->getImplicitContext()->set("zero", "ZERO"); - test(ic->getImplicitContext()->get("zero") == "ZERO"); - test(ic->getImplicitContext()->getWithDefault("foobar", "foo") == "foo"); - - ctx = ic->getImplicitContext()->getContext(); - { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p->opContext_async(cb); - test(cb->check()); - } - - Ice::Context prxContext; - prxContext["one"] = "UN"; - prxContext["four"] = "QUATRE"; - - Ice::Context combined = prxContext; - combined.insert(ctx.begin(), ctx.end()); - test(combined["one"] == "UN"); - - p = Test::MyClassPrx::uncheckedCast(p->ice_context(prxContext)); - - ic->getImplicitContext()->setContext(Ice::Context()); - { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(prxContext); - p->opContext_async(cb); - test(cb->check()); - } - - ic->getImplicitContext()->setContext(ctx); - { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(combined); - p->opContext_async(cb); - test(cb->check()); - } - - ic->destroy(); - } - } + } + + { + // + // Test implicit context propagation + // + + string impls[] = {"Shared", "SharedWithoutLocking", "PerThread"}; + for(int i = 0; i < 3; i++) + { + Ice::InitializationData initData; + initData.properties = communicator->getProperties()->clone(); + initData.properties->setProperty("Ice.ImplicitContext", impls[i]); + + Ice::CommunicatorPtr ic = Ice::initialize(initData); + + Ice::Context ctx; + ctx["one"] = "ONE"; + ctx["two"] = "TWO"; + ctx["three"] = "THREE"; + + + Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast( + ic->stringToProxy("test:default -p 12010 -t 10000")); + + + ic->getImplicitContext()->setContext(ctx); + test(ic->getImplicitContext()->getContext() == ctx); + { + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); + p->opContext_async(cb); + test(cb->check()); + } + + ic->getImplicitContext()->set("zero", "ZERO"); + test(ic->getImplicitContext()->get("zero") == "ZERO"); + test(ic->getImplicitContext()->getWithDefault("foobar", "foo") == "foo"); + + ctx = ic->getImplicitContext()->getContext(); + { + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); + p->opContext_async(cb); + test(cb->check()); + } + + Ice::Context prxContext; + prxContext["one"] = "UN"; + prxContext["four"] = "QUATRE"; + + Ice::Context combined = prxContext; + combined.insert(ctx.begin(), ctx.end()); + test(combined["one"] == "UN"); + + p = Test::MyClassPrx::uncheckedCast(p->ice_context(prxContext)); + + ic->getImplicitContext()->setContext(Ice::Context()); + { + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(prxContext); + p->opContext_async(cb); + test(cb->check()); + } + + ic->getImplicitContext()->setContext(ctx); + { + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(combined); + p->opContext_async(cb); + test(cb->check()); + } + + ic->destroy(); + } + } } { Ice::Double d = 1278312346.0 / 13.0; - Test::DoubleS ds(5, d); - AMI_MyClass_opDoubleMarshalingIPtr cb = new AMI_MyClass_opDoubleMarshalingI; - p->opDoubleMarshaling_async(cb, d, ds); - test(cb->check()); + Test::DoubleS ds(5, d); + AMI_MyClass_opDoubleMarshalingIPtr cb = new AMI_MyClass_opDoubleMarshalingI; + p->opDoubleMarshaling_async(cb, d, ds); + test(cb->check()); } { - Test::MyDerivedClassPrx derived = Test::MyDerivedClassPrx::checkedCast(p); - test(derived); - AMI_MyDerivedClass_opDerivedIPtr cb = new AMI_MyDerivedClass_opDerivedI; - derived->opDerived_async(cb); - test(cb->check()); + Test::MyDerivedClassPrx derived = Test::MyDerivedClassPrx::checkedCast(p); + test(derived); + AMI_MyDerivedClass_opDerivedIPtr cb = new AMI_MyDerivedClass_opDerivedI; + derived->opDerived_async(cb); + test(cb->check()); } } diff --git a/cpp/test/Ice/retry/AllTests.cpp b/cpp/test/Ice/retry/AllTests.cpp index 9e9c9f353fb..4ebb0915d56 100644 --- a/cpp/test/Ice/retry/AllTests.cpp +++ b/cpp/test/Ice/retry/AllTests.cpp @@ -19,7 +19,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> public: CallbackBase() : - _called(false) + _called(false) { } @@ -29,26 +29,26 @@ public: bool check() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - while(!_called) - { - if(!timedWait(IceUtil::Time::seconds(5))) - { - return false; - } - } - _called = false; - return true; + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + while(!_called) + { + if(!timedWait(IceUtil::Time::seconds(5))) + { + return false; + } + } + _called = false; + return true; } protected: void called() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - assert(!_called); - _called = true; - notify(); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + assert(!_called); + _called = true; + notify(); } private: @@ -62,12 +62,12 @@ public: virtual void ice_response() { - called(); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; @@ -79,13 +79,13 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(dynamic_cast<const Ice::ConnectionLostException*>(&ex)); - called(); + test(dynamic_cast<const Ice::ConnectionLostException*>(&ex)); + called(); } }; @@ -118,12 +118,12 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "calling operation to kill connection with second proxy... " << flush; try { - retry2->op(true); - test(false); + retry2->op(true); + test(false); } catch(Ice::ConnectionLostException) { - cout << "ok" << endl; + cout << "ok" << endl; } cout << "calling regular operation with first proxy again... " << flush; diff --git a/cpp/test/Ice/retry/Client.cpp b/cpp/test/Ice/retry/Client.cpp index cd47cb999cc..17cad12407f 100644 --- a/cpp/test/Ice/retry/Client.cpp +++ b/cpp/test/Ice/retry/Client.cpp @@ -31,38 +31,38 @@ main(int argc, char* argv[]) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); - // - // For this test, we want to disable retries. - // - initData.properties->setProperty("Ice.RetryIntervals", "-1"); + // + // For this test, we want to disable retries. + // + initData.properties->setProperty("Ice.RetryIntervals", "-1"); - // - // This test kills connections, so we don't want warnings. - // - initData.properties->setProperty("Ice.Warn.Connections", "0"); + // + // This test kills connections, so we don't want warnings. + // + initData.properties->setProperty("Ice.Warn.Connections", "0"); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator); } catch(const Ice::Exception&) { - status = EXIT_FAILURE; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/retry/Server.cpp b/cpp/test/Ice/retry/Server.cpp index 628bd83a2c2..2fc3aa5d171 100644 --- a/cpp/test/Ice/retry/Server.cpp +++ b/cpp/test/Ice/retry/Server.cpp @@ -32,26 +32,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/retry/TestI.cpp b/cpp/test/Ice/retry/TestI.cpp index e8c05542146..3bd0d68364d 100644 --- a/cpp/test/Ice/retry/TestI.cpp +++ b/cpp/test/Ice/retry/TestI.cpp @@ -15,7 +15,7 @@ RetryI::op(bool kill, const Ice::Current& current) { if(kill) { - current.con->close(true); + current.con->close(true); } } diff --git a/cpp/test/Ice/servantLocator/AllTests.cpp b/cpp/test/Ice/servantLocator/AllTests.cpp index 36f9fecf4d1..cbfda04dcd1 100644 --- a/cpp/test/Ice/servantLocator/AllTests.cpp +++ b/cpp/test/Ice/servantLocator/AllTests.cpp @@ -21,121 +21,121 @@ testExceptions(const TestIntfPrx& obj, bool collocated) { try { - obj->requestFailedException(); - test(false); + obj->requestFailedException(); + test(false); } catch(const ObjectNotExistException& ex) { - if(!collocated) - { - test(ex.id == obj->ice_getIdentity()); - test(ex.facet == obj->ice_getFacet()); - test(ex.operation == "requestFailedException"); - } + if(!collocated) + { + test(ex.id == obj->ice_getIdentity()); + test(ex.facet == obj->ice_getFacet()); + test(ex.operation == "requestFailedException"); + } } try { - obj->unknownUserException(); - test(false); + obj->unknownUserException(); + test(false); } catch(const UnknownUserException& ex) { - test(ex.unknown == "reason"); + test(ex.unknown == "reason"); } try { - obj->unknownLocalException(); - test(false); + obj->unknownLocalException(); + test(false); } catch(const UnknownLocalException& ex) { - test(ex.unknown == "reason"); + test(ex.unknown == "reason"); } try { - obj->unknownException(); - test(false); + obj->unknownException(); + test(false); } catch(const UnknownException& ex) { - test(ex.unknown == "reason"); + test(ex.unknown == "reason"); } try { - obj->userException(); - test(false); + obj->userException(); + test(false); } catch(const UnknownUserException& ex) { - //cerr << ex.unknown << endl; - test(!collocated); - test(ex.unknown == "Test::TestIntfUserException"); + //cerr << ex.unknown << endl; + test(!collocated); + test(ex.unknown == "Test::TestIntfUserException"); } catch(const TestIntfUserException&) { - test(collocated); + test(collocated); } try { - obj->localException(); - test(false); + obj->localException(); + test(false); } catch(const UnknownLocalException& ex) { - //cerr << ex.unknown << endl; - test(!collocated); - test(ex.unknown.find("Ice::SocketException:\nsocket exception: unknown error") != string::npos); + //cerr << ex.unknown << endl; + test(!collocated); + test(ex.unknown.find("Ice::SocketException:\nsocket exception: unknown error") != string::npos); } catch(const SocketException&) { - test(collocated); + test(collocated); } try { - obj->stdException(); - test(false); + obj->stdException(); + test(false); } catch(const UnknownException& ex) { - //cerr << ex.unknown << endl; - test(!collocated); - test(ex.unknown == "std::exception: Hello"); + //cerr << ex.unknown << endl; + test(!collocated); + test(ex.unknown == "std::exception: Hello"); } catch(const std::runtime_error&) { - test(collocated); + test(collocated); } try { - obj->cppException(); - test(false); + obj->cppException(); + test(false); } catch(const UnknownException& ex) { - //cerr << ex.unknown << endl; - test(!collocated); - test(ex.unknown == "unknown c++ exception"); + //cerr << ex.unknown << endl; + test(!collocated); + test(ex.unknown == "unknown c++ exception"); } catch(const int&) { - test(collocated); + test(collocated); } try { - obj->unknownExceptionWithServantException(); - test(false); + obj->unknownExceptionWithServantException(); + test(false); } catch(const UnknownException& ex) { - test(ex.unknown == "reason"); + test(ex.unknown == "reason"); } } @@ -158,7 +158,7 @@ allTests(const CommunicatorPtr& communicator, bool collocated) obj = TestIntfPrx::checkedCast(base); try { - TestIntfPrx::checkedCast(communicator->stringToProxy("category/unknown:default -p 12010 -t 10000")); + TestIntfPrx::checkedCast(communicator->stringToProxy("category/unknown:default -p 12010 -t 10000")); } catch(const ObjectNotExistException&) { @@ -172,14 +172,14 @@ allTests(const CommunicatorPtr& communicator, bool collocated) obj = TestIntfPrx::checkedCast(base); try { - TestIntfPrx::checkedCast(communicator->stringToProxy("anothercategory/unknown:default -p 12010 -t 10000")); + TestIntfPrx::checkedCast(communicator->stringToProxy("anothercategory/unknown:default -p 12010 -t 10000")); } catch(const ObjectNotExistException&) { } try { - TestIntfPrx::checkedCast(communicator->stringToProxy("unknown:default -p 12010 -t 10000")); + TestIntfPrx::checkedCast(communicator->stringToProxy("unknown:default -p 12010 -t 10000")); } catch(const Ice::ObjectNotExistException&) { diff --git a/cpp/test/Ice/servantLocator/Collocated.cpp b/cpp/test/Ice/servantLocator/Collocated.cpp index fec4143c667..53348a0799e 100644 --- a/cpp/test/Ice/servantLocator/Collocated.cpp +++ b/cpp/test/Ice/servantLocator/Collocated.cpp @@ -29,22 +29,22 @@ protected: virtual Ice::ObjectPtr newServantAndCookie(Ice::LocalObjectPtr& cookie) const { - cookie = new CookieI(); - return new TestI(); + cookie = new CookieI(); + return new TestI(); } virtual void checkCookie(const Ice::LocalObjectPtr& cookie) const { - Test::CookiePtr co = Test::CookiePtr::dynamicCast(cookie); - test(co); - test(co->message() == "blahblah"); + Test::CookiePtr co = Test::CookiePtr::dynamicCast(cookie); + test(co); + test(co->message() == "blahblah"); } virtual void throwTestIntfUserException() const { - throw Test::TestIntfUserException(); + throw Test::TestIntfUserException(); } }; diff --git a/cpp/test/Ice/servantLocator/ServantLocatorI.cpp b/cpp/test/Ice/servantLocator/ServantLocatorI.cpp index 4b51ac1cf29..93727d24be1 100644 --- a/cpp/test/Ice/servantLocator/ServantLocatorI.cpp +++ b/cpp/test/Ice/servantLocator/ServantLocatorI.cpp @@ -35,13 +35,13 @@ ServantLocatorI::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie if(current.id.name == "unknown") { - return 0; + return 0; } test(current.id.name == "locate" || current.id.name == "finished"); if(current.id.name == "locate") { - exception(current); + exception(current); } return newServantAndCookie(cookie); @@ -49,7 +49,7 @@ ServantLocatorI::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie void ServantLocatorI::finished(const Ice::Current& current, const Ice::ObjectPtr& servant, - const Ice::LocalObjectPtr& cookie) + const Ice::LocalObjectPtr& cookie) { test(!_deactivated); test(current.id.category == _category || _category.empty()); @@ -57,7 +57,7 @@ ServantLocatorI::finished(const Ice::Current& current, const Ice::ObjectPtr& ser if(current.id.name == "finished") { - exception(current); + exception(current); } checkCookie(cookie); @@ -76,38 +76,38 @@ ServantLocatorI::exception(const Ice::Current& current) { if(current.operation == "requestFailedException") { - throw Ice::ObjectNotExistException(__FILE__, __LINE__); + throw Ice::ObjectNotExistException(__FILE__, __LINE__); } else if(current.operation == "unknownUserException") { - throw UnknownUserException(__FILE__, __LINE__, "reason"); + throw UnknownUserException(__FILE__, __LINE__, "reason"); } else if(current.operation == "unknownLocalException") { - throw UnknownLocalException(__FILE__, __LINE__, "reason"); + throw UnknownLocalException(__FILE__, __LINE__, "reason"); } else if(current.operation == "unknownException") { - throw UnknownException(__FILE__, __LINE__, "reason"); + throw UnknownException(__FILE__, __LINE__, "reason"); } else if(current.operation == "userException") { - throwTestIntfUserException(); + throwTestIntfUserException(); } else if(current.operation == "localException") { - throw Ice::SocketException(__FILE__, __LINE__, 0); + throw Ice::SocketException(__FILE__, __LINE__, 0); } else if(current.operation == "stdException") { - throw std::runtime_error("Hello"); + throw std::runtime_error("Hello"); } else if(current.operation == "cppException") { - throw 5; + throw 5; } else if(current.operation == "unknownExceptionWithServantException") { - throw UnknownException(__FILE__, __LINE__, "reason"); + throw UnknownException(__FILE__, __LINE__, "reason"); } } diff --git a/cpp/test/Ice/servantLocator/Server.cpp b/cpp/test/Ice/servantLocator/Server.cpp index d07116aed9f..8777fcd5135 100644 --- a/cpp/test/Ice/servantLocator/Server.cpp +++ b/cpp/test/Ice/servantLocator/Server.cpp @@ -28,22 +28,22 @@ protected: virtual Ice::ObjectPtr newServantAndCookie(Ice::LocalObjectPtr& cookie) const { - cookie = new CookieI(); - return new TestI(); + cookie = new CookieI(); + return new TestI(); } virtual void checkCookie(const Ice::LocalObjectPtr& cookie) const { - Test::CookiePtr co = Test::CookiePtr::dynamicCast(cookie); - test(co); - test(co->message() == "blahblah"); + Test::CookiePtr co = Test::CookiePtr::dynamicCast(cookie); + test(co); + test(co->message() == "blahblah"); } virtual void throwTestIntfUserException() const { - throw Test::TestIntfUserException(); + throw Test::TestIntfUserException(); } }; diff --git a/cpp/test/Ice/servantLocator/ServerAMD.cpp b/cpp/test/Ice/servantLocator/ServerAMD.cpp index 59ae7efe8dd..470a67c51c7 100644 --- a/cpp/test/Ice/servantLocator/ServerAMD.cpp +++ b/cpp/test/Ice/servantLocator/ServerAMD.cpp @@ -28,22 +28,22 @@ protected: virtual Ice::ObjectPtr newServantAndCookie(Ice::LocalObjectPtr& cookie) const { - cookie = new CookieI(); - return new TestAMDI(); + cookie = new CookieI(); + return new TestAMDI(); } virtual void checkCookie(const Ice::LocalObjectPtr& cookie) const { - Test::CookiePtr co = Test::CookiePtr::dynamicCast(cookie); - test(co); - test(co->message() == "blahblah"); + Test::CookiePtr co = Test::CookiePtr::dynamicCast(cookie); + test(co); + test(co->message() == "blahblah"); } virtual void throwTestIntfUserException() const { - throw Test::TestIntfUserException(); + throw Test::TestIntfUserException(); } }; diff --git a/cpp/test/Ice/slicing/exceptions/AllTests.cpp b/cpp/test/Ice/slicing/exceptions/AllTests.cpp index 49dc930773f..4a43cc2823f 100644 --- a/cpp/test/Ice/slicing/exceptions/AllTests.cpp +++ b/cpp/test/Ice/slicing/exceptions/AllTests.cpp @@ -19,7 +19,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> public: CallbackBase() : - _called(false) + _called(false) { } @@ -29,26 +29,26 @@ public: bool check() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - while(!_called) - { - if(!timedWait(IceUtil::Time::seconds(5))) - { - return false; - } - } - _called = false; - return true; + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + while(!_called) + { + if(!timedWait(IceUtil::Time::seconds(5))) + { + return false; + } + } + _called = false; + return true; } protected: void called() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - assert(!_called); - _called = true; - notify(); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + assert(!_called); + _called = true; + notify(); } private: @@ -61,26 +61,26 @@ class AMI_Test_baseAsBaseI : public AMI_TestIntf_baseAsBase, public CallbackBase virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Base& b) - { - test(b.b == "Base.b"); - test(b.ice_name() =="Test::Base"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Base& b) + { + test(b.b == "Base.b"); + test(b.ice_name() =="Test::Base"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -91,26 +91,26 @@ class AMI_Test_unknownDerivedAsBaseI : public AMI_TestIntf_unknownDerivedAsBase, virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Base& b) - { - test(b.b == "UnknownDerived.b"); - test(b.ice_name() =="Test::Base"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Base& b) + { + test(b.b == "UnknownDerived.b"); + test(b.ice_name() =="Test::Base"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -121,27 +121,27 @@ class AMI_Test_knownDerivedAsBaseI : public AMI_TestIntf_knownDerivedAsBase, pub virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const KnownDerived& k) - { - test(k.b == "KnownDerived.b"); - test(k.kd == "KnownDerived.kd"); - test(k.ice_name() =="Test::KnownDerived"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const KnownDerived& k) + { + test(k.b == "KnownDerived.b"); + test(k.kd == "KnownDerived.kd"); + test(k.ice_name() =="Test::KnownDerived"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -152,27 +152,27 @@ class AMI_Test_knownDerivedAsKnownDerivedI : public AMI_TestIntf_knownDerivedAsK virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const KnownDerived& k) - { - test(k.b == "KnownDerived.b"); - test(k.kd == "KnownDerived.kd"); - test(k.ice_name() =="Test::KnownDerived"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const KnownDerived& k) + { + test(k.b == "KnownDerived.b"); + test(k.kd == "KnownDerived.kd"); + test(k.ice_name() =="Test::KnownDerived"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -183,26 +183,26 @@ class AMI_Test_unknownIntermediateAsBaseI : public AMI_TestIntf_unknownIntermedi virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Base& b) - { - test(b.b == "UnknownIntermediate.b"); - test(b.ice_name() =="Test::Base"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Base& b) + { + test(b.b == "UnknownIntermediate.b"); + test(b.ice_name() =="Test::Base"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -213,60 +213,60 @@ class AMI_Test_knownIntermediateAsBaseI : public AMI_TestIntf_knownIntermediateA virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const KnownIntermediate& ki) - { - test(ki.b == "KnownIntermediate.b"); - test(ki.ki == "KnownIntermediate.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "KnownIntermediate.b"); + test(ki.ki == "KnownIntermediate.ki"); + test(ki.ice_name() =="Test::KnownIntermediate"); + } + catch(...) + { + test(false); + } + called(); } }; typedef IceUtil::Handle<AMI_Test_knownIntermediateAsBaseI> AMI_Test_knownIntermediateAsBaseIPtr; class AMI_Test_knownMostDerivedAsBaseI : public AMI_TestIntf_knownMostDerivedAsBase, - public CallbackBase + public CallbackBase { virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const KnownMostDerived& kmd) - { - test(kmd.b == "KnownMostDerived.b"); - test(kmd.ki == "KnownMostDerived.ki"); - test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const KnownMostDerived& kmd) + { + test(kmd.b == "KnownMostDerived.b"); + test(kmd.ki == "KnownMostDerived.ki"); + test(kmd.kmd == "KnownMostDerived.kmd"); + test(kmd.ice_name() =="Test::KnownMostDerived"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -278,27 +278,27 @@ class AMI_Test_knownIntermediateAsKnownIntermediateI : public AMI_TestIntf_known virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const KnownIntermediate& ki) - { - test(ki.b == "KnownIntermediate.b"); - test(ki.ki == "KnownIntermediate.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "KnownIntermediate.b"); + test(ki.ki == "KnownIntermediate.ki"); + test(ki.ice_name() =="Test::KnownIntermediate"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -310,28 +310,28 @@ class AMI_Test_knownMostDerivedAsKnownMostDerivedI : public AMI_TestIntf_knownMo virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const KnownMostDerived& kmd) - { - test(kmd.b == "KnownMostDerived.b"); - test(kmd.ki == "KnownMostDerived.ki"); - test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const KnownMostDerived& kmd) + { + test(kmd.b == "KnownMostDerived.b"); + test(kmd.ki == "KnownMostDerived.ki"); + test(kmd.kmd == "KnownMostDerived.kmd"); + test(kmd.ice_name() =="Test::KnownMostDerived"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -343,28 +343,28 @@ class AMI_Test_knownMostDerivedAsKnownIntermediateI : public AMI_TestIntf_knownM virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const KnownMostDerived& kmd) - { - test(kmd.b == "KnownMostDerived.b"); - test(kmd.ki == "KnownMostDerived.ki"); - test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const KnownMostDerived& kmd) + { + test(kmd.b == "KnownMostDerived.b"); + test(kmd.ki == "KnownMostDerived.ki"); + test(kmd.kmd == "KnownMostDerived.kmd"); + test(kmd.ice_name() =="Test::KnownMostDerived"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -376,27 +376,27 @@ class AMI_Test_unknownMostDerived1AsBaseI : public AMI_TestIntf_unknownMostDeriv virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const KnownIntermediate& ki) - { - test(ki.b == "UnknownMostDerived1.b"); - test(ki.ki == "UnknownMostDerived1.ki"); - test(string(ki.ice_name()) =="Test::KnownIntermediate"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "UnknownMostDerived1.b"); + test(ki.ki == "UnknownMostDerived1.ki"); + test(string(ki.ice_name()) =="Test::KnownIntermediate"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -408,32 +408,32 @@ class AMI_Test_unknownMostDerived1AsKnownIntermediateI : public AMI_TestIntf_unk virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const KnownIntermediate& ki) - { - test(ki.b == "UnknownMostDerived1.b"); - test(ki.ki == "UnknownMostDerived1.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "UnknownMostDerived1.b"); + test(ki.ki == "UnknownMostDerived1.ki"); + test(ki.ice_name() =="Test::KnownIntermediate"); + } + catch(...) + { + test(false); + } + called(); } }; typedef IceUtil::Handle<AMI_Test_unknownMostDerived1AsKnownIntermediateI> - AMI_Test_unknownMostDerived1AsKnownIntermediateIPtr; + AMI_Test_unknownMostDerived1AsKnownIntermediateIPtr; class AMI_Test_unknownMostDerived2AsBaseI : public AMI_TestIntf_unknownMostDerived2AsBase, public CallbackBase @@ -441,26 +441,26 @@ class AMI_Test_unknownMostDerived2AsBaseI : public AMI_TestIntf_unknownMostDeriv virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { - try - { - exc.ice_throw(); - } - catch(const Base& b) - { - test(b.b == "UnknownMostDerived2.b"); - test(b.ice_name() =="Test::Base"); - } - catch(...) - { - test(false); - } - called(); + try + { + exc.ice_throw(); + } + catch(const Base& b) + { + test(b.b == "UnknownMostDerived2.b"); + test(b.ice_name() =="Test::Base"); + } + catch(...) + { + test(false); + } + called(); } }; @@ -474,364 +474,364 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "base... " << flush; { - try - { - test->baseAsBase(); - test(false); - } - catch(const Base& b) - { - test(b.b == "Base.b"); - test(b.ice_name() =="Test::Base"); - } - catch(...) - { - test(false); - } + try + { + test->baseAsBase(); + test(false); + } + catch(const Base& b) + { + test(b.b == "Base.b"); + test(b.ice_name() =="Test::Base"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "base (AMI)... " << flush; { - AMI_Test_baseAsBaseIPtr cb = new AMI_Test_baseAsBaseI; - test->baseAsBase_async(cb); - test(cb->check()); + AMI_Test_baseAsBaseIPtr cb = new AMI_Test_baseAsBaseI; + test->baseAsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "slicing of unknown derived... " << flush; { - try - { - test->unknownDerivedAsBase(); - test(false); - } - catch(const Base& b) - { - test(b.b == "UnknownDerived.b"); - test(b.ice_name() =="Test::Base"); - } - catch(...) - { - test(false); - } + try + { + test->unknownDerivedAsBase(); + test(false); + } + catch(const Base& b) + { + test(b.b == "UnknownDerived.b"); + test(b.ice_name() =="Test::Base"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "slicing of unknown derived (AMI)... " << flush; { - AMI_Test_unknownDerivedAsBaseIPtr cb = new AMI_Test_unknownDerivedAsBaseI; - test->unknownDerivedAsBase_async(cb); - test(cb->check()); + AMI_Test_unknownDerivedAsBaseIPtr cb = new AMI_Test_unknownDerivedAsBaseI; + test->unknownDerivedAsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "non-slicing of known derived as base... " << flush; { - try - { - test->knownDerivedAsBase(); - test(false); - } - catch(const KnownDerived& k) - { - test(k.b == "KnownDerived.b"); - test(k.kd == "KnownDerived.kd"); - test(k.ice_name() =="Test::KnownDerived"); - } - catch(...) - { - test(false); - } + try + { + test->knownDerivedAsBase(); + test(false); + } + catch(const KnownDerived& k) + { + test(k.b == "KnownDerived.b"); + test(k.kd == "KnownDerived.kd"); + test(k.ice_name() =="Test::KnownDerived"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "non-slicing of known derived as base (AMI)... " << flush; { - AMI_Test_knownDerivedAsBaseIPtr cb = new AMI_Test_knownDerivedAsBaseI; - test->knownDerivedAsBase_async(cb); - test(cb->check()); + AMI_Test_knownDerivedAsBaseIPtr cb = new AMI_Test_knownDerivedAsBaseI; + test->knownDerivedAsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "non-slicing of known derived as derived... " << flush; { - try - { - test->knownDerivedAsKnownDerived(); - test(false); - } - catch(const KnownDerived& k) - { - test(k.b == "KnownDerived.b"); - test(k.kd == "KnownDerived.kd"); - test(k.ice_name() =="Test::KnownDerived"); - } - catch(...) - { - test(false); - } + try + { + test->knownDerivedAsKnownDerived(); + test(false); + } + catch(const KnownDerived& k) + { + test(k.b == "KnownDerived.b"); + test(k.kd == "KnownDerived.kd"); + test(k.ice_name() =="Test::KnownDerived"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "non-slicing of known derived as derived (AMI)... " << flush; { - AMI_Test_knownDerivedAsKnownDerivedIPtr cb = new AMI_Test_knownDerivedAsKnownDerivedI; - test->knownDerivedAsKnownDerived_async(cb); - test(cb->check()); + AMI_Test_knownDerivedAsKnownDerivedIPtr cb = new AMI_Test_knownDerivedAsKnownDerivedI; + test->knownDerivedAsKnownDerived_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "slicing of unknown intermediate as base... " << flush; { - try - { - test->unknownIntermediateAsBase(); - test(false); - } - catch(const Base& b) - { - test(b.b == "UnknownIntermediate.b"); - test(b.ice_name() =="Test::Base"); - } - catch(...) - { - test(false); - } + try + { + test->unknownIntermediateAsBase(); + test(false); + } + catch(const Base& b) + { + test(b.b == "UnknownIntermediate.b"); + test(b.ice_name() =="Test::Base"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "slicing of unknown intermediate as base (AMI)... " << flush; { - AMI_Test_unknownIntermediateAsBaseIPtr cb = new AMI_Test_unknownIntermediateAsBaseI; - test->unknownIntermediateAsBase_async(cb); - test(cb->check()); + AMI_Test_unknownIntermediateAsBaseIPtr cb = new AMI_Test_unknownIntermediateAsBaseI; + test->unknownIntermediateAsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "slicing of known intermediate as base... " << flush; { - try - { - test->knownIntermediateAsBase(); - test(false); - } - catch(const KnownIntermediate& ki) - { - test(ki.b == "KnownIntermediate.b"); - test(ki.ki == "KnownIntermediate.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); - } - catch(...) - { - test(false); - } + try + { + test->knownIntermediateAsBase(); + test(false); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "KnownIntermediate.b"); + test(ki.ki == "KnownIntermediate.ki"); + test(ki.ice_name() =="Test::KnownIntermediate"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "slicing of known intermediate as base (AMI)... " << flush; { - AMI_Test_knownIntermediateAsBaseIPtr cb = new AMI_Test_knownIntermediateAsBaseI; - test->knownIntermediateAsBase_async(cb); - test(cb->check()); + AMI_Test_knownIntermediateAsBaseIPtr cb = new AMI_Test_knownIntermediateAsBaseI; + test->knownIntermediateAsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "slicing of known most derived as base... " << flush; { - try - { - test->knownMostDerivedAsBase(); - test(false); - } - catch(const KnownMostDerived& kmd) - { - test(kmd.b == "KnownMostDerived.b"); - test(kmd.ki == "KnownMostDerived.ki"); - test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); - } - catch(...) - { - test(false); - } + try + { + test->knownMostDerivedAsBase(); + test(false); + } + catch(const KnownMostDerived& kmd) + { + test(kmd.b == "KnownMostDerived.b"); + test(kmd.ki == "KnownMostDerived.ki"); + test(kmd.kmd == "KnownMostDerived.kmd"); + test(kmd.ice_name() =="Test::KnownMostDerived"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "slicing of known most derived as base (AMI)... " << flush; { - AMI_Test_knownMostDerivedAsBaseIPtr cb = new AMI_Test_knownMostDerivedAsBaseI; - test->knownMostDerivedAsBase_async(cb); - test(cb->check()); + AMI_Test_knownMostDerivedAsBaseIPtr cb = new AMI_Test_knownMostDerivedAsBaseI; + test->knownMostDerivedAsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "non-slicing of known intermediate as intermediate... " << flush; { - try - { - test->knownIntermediateAsKnownIntermediate(); - test(false); - } - catch(const KnownIntermediate& ki) - { - test(ki.b == "KnownIntermediate.b"); - test(ki.ki == "KnownIntermediate.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); - } - catch(...) - { - test(false); - } + try + { + test->knownIntermediateAsKnownIntermediate(); + test(false); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "KnownIntermediate.b"); + test(ki.ki == "KnownIntermediate.ki"); + test(ki.ice_name() =="Test::KnownIntermediate"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "non-slicing of known intermediate as intermediate (AMI)... " << flush; { - AMI_Test_knownIntermediateAsKnownIntermediateIPtr cb = new AMI_Test_knownIntermediateAsKnownIntermediateI; - test->knownIntermediateAsKnownIntermediate_async(cb); - test(cb->check()); + AMI_Test_knownIntermediateAsKnownIntermediateIPtr cb = new AMI_Test_knownIntermediateAsKnownIntermediateI; + test->knownIntermediateAsKnownIntermediate_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "non-slicing of known most derived exception as intermediate... " << flush; { - try - { - test->knownMostDerivedAsKnownIntermediate(); - test(false); - } - catch(const KnownMostDerived& kmd) - { - test(kmd.b == "KnownMostDerived.b"); - test(kmd.ki == "KnownMostDerived.ki"); - test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); - } - catch(...) - { - test(false); - } + try + { + test->knownMostDerivedAsKnownIntermediate(); + test(false); + } + catch(const KnownMostDerived& kmd) + { + test(kmd.b == "KnownMostDerived.b"); + test(kmd.ki == "KnownMostDerived.ki"); + test(kmd.kmd == "KnownMostDerived.kmd"); + test(kmd.ice_name() =="Test::KnownMostDerived"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "non-slicing of known most derived as intermediate (AMI)... " << flush; { - AMI_Test_knownMostDerivedAsKnownIntermediateIPtr cb = new AMI_Test_knownMostDerivedAsKnownIntermediateI; - test->knownMostDerivedAsKnownIntermediate_async(cb); - test(cb->check()); + AMI_Test_knownMostDerivedAsKnownIntermediateIPtr cb = new AMI_Test_knownMostDerivedAsKnownIntermediateI; + test->knownMostDerivedAsKnownIntermediate_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "non-slicing of known most derived as most derived... " << flush; { - try - { - test->knownMostDerivedAsKnownMostDerived(); - test(false); - } - catch(const KnownMostDerived& kmd) - { - test(kmd.b == "KnownMostDerived.b"); - test(kmd.ki == "KnownMostDerived.ki"); - test(kmd.kmd == "KnownMostDerived.kmd"); - test(kmd.ice_name() =="Test::KnownMostDerived"); - } - catch(...) - { - test(false); - } + try + { + test->knownMostDerivedAsKnownMostDerived(); + test(false); + } + catch(const KnownMostDerived& kmd) + { + test(kmd.b == "KnownMostDerived.b"); + test(kmd.ki == "KnownMostDerived.ki"); + test(kmd.kmd == "KnownMostDerived.kmd"); + test(kmd.ice_name() =="Test::KnownMostDerived"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "non-slicing of known most derived as most derived (AMI)... " << flush; { - AMI_Test_knownMostDerivedAsKnownMostDerivedIPtr cb = new AMI_Test_knownMostDerivedAsKnownMostDerivedI; - test->knownMostDerivedAsKnownMostDerived_async(cb); - test(cb->check()); + AMI_Test_knownMostDerivedAsKnownMostDerivedIPtr cb = new AMI_Test_knownMostDerivedAsKnownMostDerivedI; + test->knownMostDerivedAsKnownMostDerived_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "slicing of unknown most derived, known intermediate as base... " << flush; { - try - { - test->unknownMostDerived1AsBase(); - test(false); - } - catch(const KnownIntermediate& ki) - { - test(ki.b == "UnknownMostDerived1.b"); - test(ki.ki == "UnknownMostDerived1.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); - } - catch(...) - { - test(false); - } + try + { + test->unknownMostDerived1AsBase(); + test(false); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "UnknownMostDerived1.b"); + test(ki.ki == "UnknownMostDerived1.ki"); + test(ki.ice_name() =="Test::KnownIntermediate"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "slicing of unknown most derived, known intermediate as base (AMI)... " << flush; { - AMI_Test_unknownMostDerived1AsBaseIPtr cb = new AMI_Test_unknownMostDerived1AsBaseI; - test->unknownMostDerived1AsBase_async(cb); - test(cb->check()); + AMI_Test_unknownMostDerived1AsBaseIPtr cb = new AMI_Test_unknownMostDerived1AsBaseI; + test->unknownMostDerived1AsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "slicing of unknown most derived, known intermediate as intermediate... " << flush; { - try - { - test->unknownMostDerived1AsKnownIntermediate(); - test(false); - } - catch(const KnownIntermediate& ki) - { - test(ki.b == "UnknownMostDerived1.b"); - test(ki.ki == "UnknownMostDerived1.ki"); - test(ki.ice_name() =="Test::KnownIntermediate"); - } - catch(...) - { - test(false); - } + try + { + test->unknownMostDerived1AsKnownIntermediate(); + test(false); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "UnknownMostDerived1.b"); + test(ki.ki == "UnknownMostDerived1.ki"); + test(ki.ice_name() =="Test::KnownIntermediate"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "slicing of unknown most derived, known intermediate as intermediate (AMI)... " << flush; { - AMI_Test_unknownMostDerived1AsKnownIntermediateIPtr cb = new AMI_Test_unknownMostDerived1AsKnownIntermediateI; - test->unknownMostDerived1AsKnownIntermediate_async(cb); - test(cb->check()); + AMI_Test_unknownMostDerived1AsKnownIntermediateIPtr cb = new AMI_Test_unknownMostDerived1AsKnownIntermediateI; + test->unknownMostDerived1AsKnownIntermediate_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "slicing of unknown most derived, unknown intermediate as base... " << flush; { - try - { - test->unknownMostDerived2AsBase(); - test(false); - } - catch(const Base& b) - { - test(b.b == "UnknownMostDerived2.b"); - test(b.ice_name() =="Test::Base"); - } - catch(...) - { - test(false); - } + try + { + test->unknownMostDerived2AsBase(); + test(false); + } + catch(const Base& b) + { + test(b.b == "UnknownMostDerived2.b"); + test(b.ice_name() =="Test::Base"); + } + catch(...) + { + test(false); + } } cout << "ok" << endl; cout << "slicing of unknown most derived, unknown intermediate as base (AMI)... " << flush; { - AMI_Test_unknownMostDerived2AsBaseIPtr cb = new AMI_Test_unknownMostDerived2AsBaseI; - test->unknownMostDerived2AsBase_async(cb); - test(cb->check()); + AMI_Test_unknownMostDerived2AsBaseIPtr cb = new AMI_Test_unknownMostDerived2AsBaseI; + test->unknownMostDerived2AsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; diff --git a/cpp/test/Ice/slicing/exceptions/Client.cpp b/cpp/test/Ice/slicing/exceptions/Client.cpp index f3ac4fd8322..a48e0a0bf39 100644 --- a/cpp/test/Ice/slicing/exceptions/Client.cpp +++ b/cpp/test/Ice/slicing/exceptions/Client.cpp @@ -31,26 +31,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/slicing/exceptions/Server.cpp b/cpp/test/Ice/slicing/exceptions/Server.cpp index 9a7ad52c084..697d3b3cbfa 100644 --- a/cpp/test/Ice/slicing/exceptions/Server.cpp +++ b/cpp/test/Ice/slicing/exceptions/Server.cpp @@ -34,26 +34,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp b/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp index f19fcbf7f44..16190251017 100644 --- a/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp +++ b/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp @@ -34,26 +34,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp b/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp index e1286426788..f6f2810fcff 100644 --- a/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp +++ b/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp @@ -82,7 +82,7 @@ TestI::knownMostDerivedAsBase_async(const AMD_TestIntf_knownMostDerivedAsBasePtr void TestI::knownIntermediateAsKnownIntermediate_async(const AMD_TestIntf_knownIntermediateAsKnownIntermediatePtr& cb, - const ::Ice::Current&) + const ::Ice::Current&) { KnownIntermediate ki; ki.b = "KnownIntermediate.b"; @@ -92,7 +92,7 @@ TestI::knownIntermediateAsKnownIntermediate_async(const AMD_TestIntf_knownInterm void TestI::knownMostDerivedAsKnownIntermediate_async(const AMD_TestIntf_knownMostDerivedAsKnownIntermediatePtr& cb, - const ::Ice::Current&) + const ::Ice::Current&) { KnownMostDerived kmd; kmd.b = "KnownMostDerived.b"; @@ -104,7 +104,7 @@ TestI::knownMostDerivedAsKnownIntermediate_async(const AMD_TestIntf_knownMostDer void TestI:: knownMostDerivedAsKnownMostDerived_async(const AMD_TestIntf_knownMostDerivedAsKnownMostDerivedPtr& cb, - const ::Ice::Current&) + const ::Ice::Current&) { KnownMostDerived kmd; kmd.b = "KnownMostDerived.b"; @@ -125,7 +125,7 @@ TestI::unknownMostDerived1AsBase_async(const AMD_TestIntf_unknownMostDerived1AsB void TestI::unknownMostDerived1AsKnownIntermediate_async(const AMD_TestIntf_unknownMostDerived1AsKnownIntermediatePtr& cb, - const ::Ice::Current&) + const ::Ice::Current&) { UnknownMostDerived1 umd1; umd1.b = "UnknownMostDerived1.b"; diff --git a/cpp/test/Ice/slicing/exceptions/TestAMDI.h b/cpp/test/Ice/slicing/exceptions/TestAMDI.h index d390cf82bd9..a806e61c5aa 100644 --- a/cpp/test/Ice/slicing/exceptions/TestAMDI.h +++ b/cpp/test/Ice/slicing/exceptions/TestAMDI.h @@ -22,33 +22,33 @@ public: virtual void unknownDerivedAsBase_async(const ::Test::AMD_TestIntf_unknownDerivedAsBasePtr&, const ::Ice::Current&); virtual void knownDerivedAsBase_async(const ::Test::AMD_TestIntf_knownDerivedAsBasePtr&, const ::Ice::Current&); virtual void knownDerivedAsKnownDerived_async(const ::Test::AMD_TestIntf_knownDerivedAsKnownDerivedPtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void unknownIntermediateAsBase_async(const ::Test::AMD_TestIntf_unknownIntermediateAsBasePtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void knownIntermediateAsBase_async(const ::Test::AMD_TestIntf_knownIntermediateAsBasePtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void knownMostDerivedAsBase_async(const ::Test::AMD_TestIntf_knownMostDerivedAsBasePtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void knownIntermediateAsKnownIntermediate_async( - const ::Test::AMD_TestIntf_knownIntermediateAsKnownIntermediatePtr&, - const ::Ice::Current&); + const ::Test::AMD_TestIntf_knownIntermediateAsKnownIntermediatePtr&, + const ::Ice::Current&); virtual void knownMostDerivedAsKnownIntermediate_async( - const ::Test::AMD_TestIntf_knownMostDerivedAsKnownIntermediatePtr&, - const ::Ice::Current&); + const ::Test::AMD_TestIntf_knownMostDerivedAsKnownIntermediatePtr&, + const ::Ice::Current&); virtual void knownMostDerivedAsKnownMostDerived_async( - const ::Test::AMD_TestIntf_knownMostDerivedAsKnownMostDerivedPtr&, - const ::Ice::Current&); + const ::Test::AMD_TestIntf_knownMostDerivedAsKnownMostDerivedPtr&, + const ::Ice::Current&); virtual void unknownMostDerived1AsBase_async( - const ::Test::AMD_TestIntf_unknownMostDerived1AsBasePtr&, - const ::Ice::Current&); + const ::Test::AMD_TestIntf_unknownMostDerived1AsBasePtr&, + const ::Ice::Current&); virtual void unknownMostDerived1AsKnownIntermediate_async( - const ::Test::AMD_TestIntf_unknownMostDerived1AsKnownIntermediatePtr&, - const ::Ice::Current&); + const ::Test::AMD_TestIntf_unknownMostDerived1AsKnownIntermediatePtr&, + const ::Ice::Current&); virtual void unknownMostDerived2AsBase_async( - const ::Test::AMD_TestIntf_unknownMostDerived2AsBasePtr&, - const ::Ice::Current&); + const ::Test::AMD_TestIntf_unknownMostDerived2AsBasePtr&, + const ::Ice::Current&); virtual void shutdown_async(const ::Test::AMD_TestIntf_shutdownPtr&, const ::Ice::Current&); diff --git a/cpp/test/Ice/slicing/objects/AllTests.cpp b/cpp/test/Ice/slicing/objects/AllTests.cpp index 7646554dcca..b9f102b6c5a 100644 --- a/cpp/test/Ice/slicing/objects/AllTests.cpp +++ b/cpp/test/Ice/slicing/objects/AllTests.cpp @@ -20,7 +20,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> public: CallbackBase() : - _called(false) + _called(false) { } @@ -30,26 +30,26 @@ public: bool check() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - while(!_called) - { - if(!timedWait(IceUtil::Time::seconds(5))) - { - return false; - } - } - _called = false; - return true; + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + while(!_called) + { + if(!timedWait(IceUtil::Time::seconds(5))) + { + return false; + } + } + _called = false; + return true; } protected: void called() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - assert(!_called); - _called = true; - notify(); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + assert(!_called); + _called = true; + notify(); } private: @@ -62,18 +62,18 @@ class AMI_Test_SBaseAsObjectI : public AMI_TestIntf_SBaseAsObject, public Callba virtual void ice_response(const ::Ice::ObjectPtr& o) { - test(o); - test(o->ice_id() == "::Test::SBase"); - SBasePtr sb = SBasePtr::dynamicCast(o); - test(sb); - test(sb->sb == "SBase.sb"); - called(); + test(o); + test(o->ice_id() == "::Test::SBase"); + SBasePtr sb = SBasePtr::dynamicCast(o); + test(sb); + test(sb->sb == "SBase.sb"); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -84,14 +84,14 @@ class AMI_Test_SBaseAsSBaseI : public AMI_TestIntf_SBaseAsSBase, public Callback virtual void ice_response(const SBasePtr& sb) { - test(sb->sb == "SBase.sb"); - called(); + test(sb->sb == "SBase.sb"); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -102,16 +102,16 @@ class AMI_Test_SBSKnownDerivedAsSBaseI : public AMI_TestIntf_SBSKnownDerivedAsSB virtual void ice_response(const SBasePtr& sb) { - SBSKnownDerivedPtr sbskd = SBSKnownDerivedPtr::dynamicCast(sb); - test(sbskd); - test(sbskd->sbskd == "SBSKnownDerived.sbskd"); - called(); + SBSKnownDerivedPtr sbskd = SBSKnownDerivedPtr::dynamicCast(sb); + test(sbskd); + test(sbskd->sbskd == "SBSKnownDerived.sbskd"); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -123,14 +123,14 @@ class AMI_Test_SBSKnownDerivedAsSBSKnownDerivedI virtual void ice_response(const SBSKnownDerivedPtr& sbskd) { - test(sbskd->sbskd == "SBSKnownDerived.sbskd"); - called(); + test(sbskd->sbskd == "SBSKnownDerived.sbskd"); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -141,14 +141,14 @@ class AMI_Test_SBSUnknownDerivedAsSBaseI : public AMI_TestIntf_SBSUnknownDerived virtual void ice_response(const SBasePtr& sb) { - test(sb->sb == "SBSUnknownDerived.sb"); - called(); + test(sb->sb == "SBSUnknownDerived.sb"); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -159,14 +159,14 @@ class AMI_Test_SUnknownAsObjectI : public AMI_TestIntf_SUnknownAsObject, public virtual void ice_response(const Ice::ObjectPtr& o) { - test(false); + test(false); } virtual void ice_exception(const Ice::Exception& exc) { test(exc.ice_name() == "Ice::NoObjectFactoryException"); - called(); + called(); } }; @@ -177,17 +177,17 @@ class AMI_Test_oneElementCycleI : public AMI_TestIntf_oneElementCycle, public Ca virtual void ice_response(const BPtr& b) { - test(b); - test(b->ice_id() == "::Test::B"); - test(b->sb == "B1.sb"); - test(b->pb == b); - called(); + test(b); + test(b->ice_id() == "::Test::B"); + test(b->sb == "B1.sb"); + test(b->pb == b); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -198,22 +198,22 @@ class AMI_Test_twoElementCycleI : public AMI_TestIntf_twoElementCycle, public Ca virtual void ice_response(const BPtr& b1) { - test(b1); - test(b1->ice_id() == "::Test::B"); - test(b1->sb == "B1.sb"); + test(b1); + test(b1->ice_id() == "::Test::B"); + test(b1->sb == "B1.sb"); - BPtr b2 = b1->pb; - test(b2); - test(b2->ice_id() == "::Test::B"); - test(b2->sb == "B2.sb"); - test(b2->pb == b1); - called(); + BPtr b2 = b1->pb; + test(b2); + test(b2->ice_id() == "::Test::B"); + test(b2->sb == "B2.sb"); + test(b2->pb == b1); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -224,30 +224,30 @@ class AMI_Test_D1AsBI : public AMI_TestIntf_D1AsB, public CallbackBase virtual void ice_response(const BPtr& b1) { - test(b1); - test(b1->ice_id() == "::Test::D1"); - test(b1->sb == "D1.sb"); - test(b1->pb); - test(b1->pb != b1); - D1Ptr d1 = D1Ptr::dynamicCast(b1); - test(d1); - test(d1->sd1 == "D1.sd1"); - test(d1->pd1); - test(d1->pd1 != b1); - test(b1->pb == d1->pd1); - - BPtr b2 = b1->pb; - test(b2); - test(b2->pb == b1); - test(b2->sb == "D2.sb"); - test(b2->ice_id() == "::Test::B"); - called(); + test(b1); + test(b1->ice_id() == "::Test::D1"); + test(b1->sb == "D1.sb"); + test(b1->pb); + test(b1->pb != b1); + D1Ptr d1 = D1Ptr::dynamicCast(b1); + test(d1); + test(d1->sd1 == "D1.sd1"); + test(d1->pd1); + test(d1->pd1 != b1); + test(b1->pb == d1->pd1); + + BPtr b2 = b1->pb; + test(b2); + test(b2->pb == b1); + test(b2->sb == "D2.sb"); + test(b2->ice_id() == "::Test::B"); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -258,24 +258,24 @@ class AMI_Test_D1AsD1I : public AMI_TestIntf_D1AsD1, public CallbackBase virtual void ice_response(const D1Ptr& d1) { - test(d1); - test(d1->ice_id() == "::Test::D1"); - test(d1->sb == "D1.sb"); - test(d1->pb); - test(d1->pb != d1); + test(d1); + test(d1->ice_id() == "::Test::D1"); + test(d1->sb == "D1.sb"); + test(d1->pb); + test(d1->pb != d1); - BPtr b2 = d1->pb; - test(b2); - test(b2->ice_id() == "::Test::B"); - test(b2->sb == "D2.sb"); - test(b2->pb == d1); - called(); + BPtr b2 = d1->pb; + test(b2); + test(b2->ice_id() == "::Test::B"); + test(b2->sb == "D2.sb"); + test(b2->pb == d1); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -286,28 +286,28 @@ class AMI_Test_D2AsBI : public AMI_TestIntf_D2AsB, public CallbackBase virtual void ice_response(const BPtr& b2) { - test(b2); - test(b2->ice_id() == "::Test::B"); - test(b2->sb == "D2.sb"); - test(b2->pb); - test(b2->pb != b2); + test(b2); + test(b2->ice_id() == "::Test::B"); + test(b2->sb == "D2.sb"); + test(b2->pb); + test(b2->pb != b2); - BPtr b1 = b2->pb; - test(b1); - test(b1->ice_id() == "::Test::D1"); - test(b1->sb == "D1.sb"); - test(b1->pb == b2); - D1Ptr d1 = D1Ptr::dynamicCast(b1); - test(d1); - test(d1->sd1 == "D1.sd1"); - test(d1->pd1 == b2); - called(); + BPtr b1 = b2->pb; + test(b1); + test(b1->ice_id() == "::Test::D1"); + test(b1->sb == "D1.sb"); + test(b1->pb == b2); + D1Ptr d1 = D1Ptr::dynamicCast(b1); + test(d1); + test(d1->sd1 == "D1.sd1"); + test(d1->pd1 == b2); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -318,26 +318,26 @@ class AMI_Test_paramTest1I : public AMI_TestIntf_paramTest1, public CallbackBase virtual void ice_response(const BPtr& b1, const BPtr& b2) { - test(b1); - test(b1->ice_id() == "::Test::D1"); - test(b1->sb == "D1.sb"); - test(b1->pb == b2); - D1Ptr d1 = D1Ptr::dynamicCast(b1); - test(d1); - test(d1->sd1 == "D1.sd1"); - test(d1->pd1 == b2); + test(b1); + test(b1->ice_id() == "::Test::D1"); + test(b1->sb == "D1.sb"); + test(b1->pb == b2); + D1Ptr d1 = D1Ptr::dynamicCast(b1); + test(d1); + test(d1->sd1 == "D1.sd1"); + test(d1->pd1 == b2); - test(b2); - test(b2->ice_id() == "::Test::B"); // No factory, must be sliced - test(b2->sb == "D2.sb"); - test(b2->pb == b1); - called(); + test(b2); + test(b2->ice_id() == "::Test::B"); // No factory, must be sliced + test(b2->sb == "D2.sb"); + test(b2->pb == b1); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -348,14 +348,14 @@ class AMI_Test_returnTest1I : public AMI_TestIntf_returnTest1, public CallbackBa virtual void ice_response(const BPtr& r, const BPtr& p1, const BPtr& p2) { - test(r == p1); - called(); + test(r == p1); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -366,14 +366,14 @@ class AMI_Test_returnTest2I : public AMI_TestIntf_returnTest2, public CallbackBa virtual void ice_response(const BPtr& r, const BPtr& p1, const BPtr& p2) { - test(r == p1); - called(); + test(r == p1); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -385,14 +385,14 @@ public: virtual void ice_response(const BPtr& b) { - r = b; - called(); + r = b; + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } BPtr r; @@ -405,27 +405,27 @@ class AMI_Test_paramTest3I : public AMI_TestIntf_paramTest3, public CallbackBase virtual void ice_response(const BPtr& ret, const BPtr& p1, const BPtr& p2) { - test(p1); - test(p1->sb == "D2.sb (p1 1)"); - test(p1->pb == 0); - test(p1->ice_id() == "::Test::B"); + test(p1); + test(p1->sb == "D2.sb (p1 1)"); + test(p1->pb == 0); + test(p1->ice_id() == "::Test::B"); - test(p2); - test(p2->sb == "D2.sb (p2 1)"); - test(p2->pb == 0); - test(p2->ice_id() == "::Test::B"); + test(p2); + test(p2->sb == "D2.sb (p2 1)"); + test(p2->pb == 0); + test(p2->ice_id() == "::Test::B"); - test(ret); - test(ret->sb == "D1.sb (p2 2)"); - test(ret->pb == 0); - test(ret->ice_id() == "::Test::D1"); - called(); + test(ret); + test(ret->sb == "D1.sb (p2 2)"); + test(ret->pb == 0); + test(ret->ice_id() == "::Test::D1"); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -436,22 +436,22 @@ class AMI_Test_paramTest4I : public AMI_TestIntf_paramTest4, public CallbackBase virtual void ice_response(const BPtr& ret, const BPtr& b) { - test(b); - test(b->sb == "D4.sb (1)"); - test(b->pb == 0); - test(b->ice_id() == "::Test::B"); + test(b); + test(b->sb == "D4.sb (1)"); + test(b->pb == 0); + test(b->ice_id() == "::Test::B"); - test(ret); - test(ret->sb == "B.sb (2)"); - test(ret->pb == 0); - test(ret->ice_id() == "::Test::B"); - called(); + test(ret); + test(ret->sb == "B.sb (2)"); + test(ret->pb == 0); + test(ret->ice_id() == "::Test::B"); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -462,14 +462,14 @@ class AMI_Test_sequenceTestI : public AMI_TestIntf_sequenceTest, public Callback virtual void ice_response(const SS& ss) { - r = ss; - called(); + r = ss; + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } public: @@ -484,15 +484,15 @@ class AMI_Test_dictionaryTestI : public AMI_TestIntf_dictionaryTest, public Call virtual void ice_response(const BDict& r, const BDict& bout) { - this->r = r; - this->bout = bout; - called(); + this->r = r; + this->bout = bout; + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } public: @@ -508,19 +508,19 @@ class AMI_Test_throwBaseAsBaseI : public AMI_TestIntf_throwBaseAsBase, public Ca virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(ex.ice_name() == "Test::BaseException"); - const BaseException& e = dynamic_cast<const BaseException&>(ex); - test(e.sbe == "sbe"); - test(e.pb); - test(e.pb->sb == "sb"); - test(e.pb->pb == e.pb); - called(); + test(ex.ice_name() == "Test::BaseException"); + const BaseException& e = dynamic_cast<const BaseException&>(ex); + test(e.sbe == "sbe"); + test(e.pb); + test(e.pb->sb == "sb"); + test(e.pb->pb == e.pb); + called(); } }; @@ -531,25 +531,25 @@ class AMI_Test_throwDerivedAsBaseI : public AMI_TestIntf_throwDerivedAsBase, pub virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(ex.ice_name() == "Test::DerivedException"); - const DerivedException& e = dynamic_cast<const DerivedException&>(ex); - test(e.sbe == "sbe"); - test(e.pb); - test(e.pb->sb == "sb1"); - test(e.pb->pb == e.pb); - test(e.sde == "sde1"); - test(e.pd1); - test(e.pd1->sb == "sb2"); - test(e.pd1->pb == e.pd1); - test(e.pd1->sd1 == "sd2"); - test(e.pd1->pd1 == e.pd1); - called(); + test(ex.ice_name() == "Test::DerivedException"); + const DerivedException& e = dynamic_cast<const DerivedException&>(ex); + test(e.sbe == "sbe"); + test(e.pb); + test(e.pb->sb == "sb1"); + test(e.pb->pb == e.pb); + test(e.sde == "sde1"); + test(e.pd1); + test(e.pd1->sb == "sb2"); + test(e.pd1->pb == e.pd1); + test(e.pd1->sd1 == "sd2"); + test(e.pd1->pd1 == e.pd1); + called(); } }; @@ -560,25 +560,25 @@ class AMI_Test_throwDerivedAsDerivedI : public AMI_TestIntf_throwDerivedAsDerive virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(ex.ice_name() == "Test::DerivedException"); - const DerivedException& e = dynamic_cast<const DerivedException&>(ex); - test(e.sbe == "sbe"); - test(e.pb); - test(e.pb->sb == "sb1"); - test(e.pb->pb == e.pb); - test(e.sde == "sde1"); - test(e.pd1); - test(e.pd1->sb == "sb2"); - test(e.pd1->pb == e.pd1); - test(e.pd1->sd1 == "sd2"); - test(e.pd1->pd1 == e.pd1); - called(); + test(ex.ice_name() == "Test::DerivedException"); + const DerivedException& e = dynamic_cast<const DerivedException&>(ex); + test(e.sbe == "sbe"); + test(e.pb); + test(e.pb->sb == "sb1"); + test(e.pb->pb == e.pb); + test(e.sde == "sde1"); + test(e.pd1); + test(e.pd1->sb == "sb2"); + test(e.pd1->pb == e.pd1); + test(e.pd1->sd1 == "sd2"); + test(e.pd1->pd1 == e.pd1); + called(); } }; @@ -589,19 +589,19 @@ class AMI_Test_throwUnknownDerivedAsBaseI : public AMI_TestIntf_throwUnknownDeri virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(ex.ice_name() == "Test::BaseException"); - const BaseException& e = dynamic_cast<const BaseException&>(ex); - test(e.sbe == "sbe"); - test(e.pb); - test(e.pb->sb == "sb d2"); - test(e.pb->pb == e.pb); - called(); + test(ex.ice_name() == "Test::BaseException"); + const BaseException& e = dynamic_cast<const BaseException&>(ex); + test(e.sbe == "sbe"); + test(e.pb); + test(e.pb->sb == "sb d2"); + test(e.pb->pb == e.pb); + called(); } }; @@ -612,14 +612,14 @@ class AMI_Test_useForwardI : public AMI_TestIntf_useForward, public CallbackBase virtual void ice_response(const ForwardPtr& f) { - test(f); - called(); + test(f); + called(); } virtual void ice_exception(const Ice::Exception& exc) { - test(false); + test(false); } }; @@ -633,1281 +633,1281 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "base as Object... " << flush; { - Ice::ObjectPtr o; - try - { - o = test->SBaseAsObject(); - test(o); - test(o->ice_id() == "::Test::SBase"); - } - catch(...) - { - test(0); - } - SBasePtr sb = SBasePtr::dynamicCast(o); - test(sb); - test(sb->sb == "SBase.sb"); + Ice::ObjectPtr o; + try + { + o = test->SBaseAsObject(); + test(o); + test(o->ice_id() == "::Test::SBase"); + } + catch(...) + { + test(0); + } + SBasePtr sb = SBasePtr::dynamicCast(o); + test(sb); + test(sb->sb == "SBase.sb"); } cout << "ok" << endl; cout << "base as Object (AMI)... " << flush; { - AMI_Test_SBaseAsObjectIPtr cb = new AMI_Test_SBaseAsObjectI; - test->SBaseAsObject_async(cb); - test(cb->check()); + AMI_Test_SBaseAsObjectIPtr cb = new AMI_Test_SBaseAsObjectI; + test->SBaseAsObject_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "base as base... " << flush; { - SBasePtr sb; - try - { - sb = test->SBaseAsSBase(); - test(sb->sb == "SBase.sb"); - } - catch(...) - { - test(0); - } + SBasePtr sb; + try + { + sb = test->SBaseAsSBase(); + test(sb->sb == "SBase.sb"); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "base as base (AMI)... " << flush; { - AMI_Test_SBaseAsSBaseIPtr cb = new AMI_Test_SBaseAsSBaseI; - test->SBaseAsSBase_async(cb); - test(cb->check()); + AMI_Test_SBaseAsSBaseIPtr cb = new AMI_Test_SBaseAsSBaseI; + test->SBaseAsSBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "base with known derived as base... " << flush; { - SBasePtr sb; - try - { - sb = test->SBSKnownDerivedAsSBase(); - test(sb->sb == "SBSKnownDerived.sb"); - } - catch(...) - { - test(0); - } - SBSKnownDerivedPtr sbskd = SBSKnownDerivedPtr::dynamicCast(sb); - test(sbskd); - test(sbskd->sbskd == "SBSKnownDerived.sbskd"); + SBasePtr sb; + try + { + sb = test->SBSKnownDerivedAsSBase(); + test(sb->sb == "SBSKnownDerived.sb"); + } + catch(...) + { + test(0); + } + SBSKnownDerivedPtr sbskd = SBSKnownDerivedPtr::dynamicCast(sb); + test(sbskd); + test(sbskd->sbskd == "SBSKnownDerived.sbskd"); } cout << "ok" << endl; cout << "base with known derived as base (AMI)... " << flush; { - AMI_Test_SBSKnownDerivedAsSBaseIPtr cb = new AMI_Test_SBSKnownDerivedAsSBaseI; - test->SBSKnownDerivedAsSBase_async(cb); - test(cb->check()); + AMI_Test_SBSKnownDerivedAsSBaseIPtr cb = new AMI_Test_SBSKnownDerivedAsSBaseI; + test->SBSKnownDerivedAsSBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "base with known derived as known derived... " << flush; { - SBSKnownDerivedPtr sbskd; - try - { - sbskd = test->SBSKnownDerivedAsSBSKnownDerived(); - test(sbskd->sbskd == "SBSKnownDerived.sbskd"); - } - catch(...) - { - test(0); - } + SBSKnownDerivedPtr sbskd; + try + { + sbskd = test->SBSKnownDerivedAsSBSKnownDerived(); + test(sbskd->sbskd == "SBSKnownDerived.sbskd"); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "base with known derived as known derived (AMI)... " << flush; { - AMI_Test_SBSKnownDerivedAsSBSKnownDerivedIPtr cb = new AMI_Test_SBSKnownDerivedAsSBSKnownDerivedI; - test->SBSKnownDerivedAsSBSKnownDerived_async(cb); - test(cb->check()); + AMI_Test_SBSKnownDerivedAsSBSKnownDerivedIPtr cb = new AMI_Test_SBSKnownDerivedAsSBSKnownDerivedI; + test->SBSKnownDerivedAsSBSKnownDerived_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "base with unknown derived as base... " << flush; { - SBasePtr sb; - try - { - sb = test->SBSUnknownDerivedAsSBase(); - test(sb->sb == "SBSUnknownDerived.sb"); - } - catch(...) - { - test(0); - } + SBasePtr sb; + try + { + sb = test->SBSUnknownDerivedAsSBase(); + test(sb->sb == "SBSUnknownDerived.sb"); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "base with unknown derived as base (AMI)... " << flush; { - AMI_Test_SBSUnknownDerivedAsSBaseIPtr cb = new AMI_Test_SBSUnknownDerivedAsSBaseI; - test->SBSUnknownDerivedAsSBase_async(cb); - test(cb->check()); + AMI_Test_SBSUnknownDerivedAsSBaseIPtr cb = new AMI_Test_SBSUnknownDerivedAsSBaseI; + test->SBSUnknownDerivedAsSBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "unknown with Object as Object... " << flush; { - Ice::ObjectPtr o; - try - { - o = test->SUnknownAsObject(); - test(0); - } - catch(const Ice::NoObjectFactoryException&) - { - } - catch(...) - { - test(0); - } + Ice::ObjectPtr o; + try + { + o = test->SUnknownAsObject(); + test(0); + } + catch(const Ice::NoObjectFactoryException&) + { + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "unknown with Object as Object (AMI)... " << flush; { - try - { - AMI_Test_SUnknownAsObjectIPtr cb = new AMI_Test_SUnknownAsObjectI; - test->SUnknownAsObject_async(cb);
- test(cb->check()); - } - catch(...) - { - test(0); - } + try + { + AMI_Test_SUnknownAsObjectIPtr cb = new AMI_Test_SUnknownAsObjectI; + test->SUnknownAsObject_async(cb);
+ test(cb->check()); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "one-element cycle... " << flush; { - try - { - BPtr b = test->oneElementCycle(); - test(b); - test(b->ice_id() == "::Test::B"); - test(b->sb == "B1.sb"); - test(b->pb == b); - } - catch(...) - { - test(0); - } + try + { + BPtr b = test->oneElementCycle(); + test(b); + test(b->ice_id() == "::Test::B"); + test(b->sb == "B1.sb"); + test(b->pb == b); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "one-element cycle (AMI)... " << flush; { - AMI_Test_oneElementCycleIPtr cb = new AMI_Test_oneElementCycleI; - test->oneElementCycle_async(cb); - test(cb->check()); + AMI_Test_oneElementCycleIPtr cb = new AMI_Test_oneElementCycleI; + test->oneElementCycle_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "two-element cycle... " << flush; { - try - { - BPtr b1 = test->twoElementCycle(); - test(b1); - test(b1->ice_id() == "::Test::B"); - test(b1->sb == "B1.sb"); - - BPtr b2 = b1->pb; - test(b2); - test(b2->ice_id() == "::Test::B"); - test(b2->sb == "B2.sb"); - test(b2->pb == b1); - } - catch(...) - { - test(0); - } + try + { + BPtr b1 = test->twoElementCycle(); + test(b1); + test(b1->ice_id() == "::Test::B"); + test(b1->sb == "B1.sb"); + + BPtr b2 = b1->pb; + test(b2); + test(b2->ice_id() == "::Test::B"); + test(b2->sb == "B2.sb"); + test(b2->pb == b1); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "two-element cycle (AMI)... " << flush; { - AMI_Test_twoElementCycleIPtr cb = new AMI_Test_twoElementCycleI; - test->twoElementCycle_async(cb); - test(cb->check()); + AMI_Test_twoElementCycleIPtr cb = new AMI_Test_twoElementCycleI; + test->twoElementCycle_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "known derived pointer slicing as base... " << flush; { - try - { - BPtr b1; - b1 = test->D1AsB(); - test(b1); - test(b1->ice_id() == "::Test::D1"); - test(b1->sb == "D1.sb"); - test(b1->pb); - test(b1->pb != b1); - D1Ptr d1 = D1Ptr::dynamicCast(b1); - test(d1); - test(d1->sd1 == "D1.sd1"); - test(d1->pd1); - test(d1->pd1 != b1); - test(b1->pb == d1->pd1); - - BPtr b2 = b1->pb; - test(b2); - test(b2->pb == b1); - test(b2->sb == "D2.sb"); - test(b2->ice_id() == "::Test::B"); - } - catch(...) - { - test(0); - } + try + { + BPtr b1; + b1 = test->D1AsB(); + test(b1); + test(b1->ice_id() == "::Test::D1"); + test(b1->sb == "D1.sb"); + test(b1->pb); + test(b1->pb != b1); + D1Ptr d1 = D1Ptr::dynamicCast(b1); + test(d1); + test(d1->sd1 == "D1.sd1"); + test(d1->pd1); + test(d1->pd1 != b1); + test(b1->pb == d1->pd1); + + BPtr b2 = b1->pb; + test(b2); + test(b2->pb == b1); + test(b2->sb == "D2.sb"); + test(b2->ice_id() == "::Test::B"); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "known derived pointer slicing as base (AMI)... " << flush; { - AMI_Test_D1AsBIPtr cb = new AMI_Test_D1AsBI; - test->D1AsB_async(cb); - test(cb->check()); + AMI_Test_D1AsBIPtr cb = new AMI_Test_D1AsBI; + test->D1AsB_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "known derived pointer slicing as derived... " << flush; { - try - { - D1Ptr d1; - d1 = test->D1AsD1(); - test(d1); - test(d1->ice_id() == "::Test::D1"); - test(d1->sb == "D1.sb"); - test(d1->pb); - test(d1->pb != d1); - - BPtr b2 = d1->pb; - test(b2); - test(b2->ice_id() == "::Test::B"); - test(b2->sb == "D2.sb"); - test(b2->pb == d1); - } - catch(...) - { - test(0); - } + try + { + D1Ptr d1; + d1 = test->D1AsD1(); + test(d1); + test(d1->ice_id() == "::Test::D1"); + test(d1->sb == "D1.sb"); + test(d1->pb); + test(d1->pb != d1); + + BPtr b2 = d1->pb; + test(b2); + test(b2->ice_id() == "::Test::B"); + test(b2->sb == "D2.sb"); + test(b2->pb == d1); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "known derived pointer slicing as derived (AMI)... " << flush; { - AMI_Test_D1AsD1IPtr cb = new AMI_Test_D1AsD1I; - test->D1AsD1_async(cb); - test(cb->check()); + AMI_Test_D1AsD1IPtr cb = new AMI_Test_D1AsD1I; + test->D1AsD1_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "unknown derived pointer slicing as base... " << flush; { - try - { - BPtr b2; - b2 = test->D2AsB(); - test(b2); - test(b2->ice_id() == "::Test::B"); - test(b2->sb == "D2.sb"); - test(b2->pb); - test(b2->pb != b2); - - BPtr b1 = b2->pb; - test(b1); - test(b1->ice_id() == "::Test::D1"); - test(b1->sb == "D1.sb"); - test(b1->pb == b2); - D1Ptr d1 = D1Ptr::dynamicCast(b1); - test(d1); - test(d1->sd1 == "D1.sd1"); - test(d1->pd1 == b2); - } - catch(...) - { - test(0); - } + try + { + BPtr b2; + b2 = test->D2AsB(); + test(b2); + test(b2->ice_id() == "::Test::B"); + test(b2->sb == "D2.sb"); + test(b2->pb); + test(b2->pb != b2); + + BPtr b1 = b2->pb; + test(b1); + test(b1->ice_id() == "::Test::D1"); + test(b1->sb == "D1.sb"); + test(b1->pb == b2); + D1Ptr d1 = D1Ptr::dynamicCast(b1); + test(d1); + test(d1->sd1 == "D1.sd1"); + test(d1->pd1 == b2); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "unknown derived pointer slicing as base (AMI)... " << flush; { - AMI_Test_D2AsBIPtr cb = new AMI_Test_D2AsBI; - test->D2AsB_async(cb); - test(cb->check()); + AMI_Test_D2AsBIPtr cb = new AMI_Test_D2AsBI; + test->D2AsB_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "param ptr slicing with known first... " << flush; { - try - { - BPtr b1; - BPtr b2; - test->paramTest1(b1, b2); - - test(b1); - test(b1->ice_id() == "::Test::D1"); - test(b1->sb == "D1.sb"); - test(b1->pb == b2); - D1Ptr d1 = D1Ptr::dynamicCast(b1); - test(d1); - test(d1->sd1 == "D1.sd1"); - test(d1->pd1 == b2); - - test(b2); - test(b2->ice_id() == "::Test::B"); // No factory, must be sliced - test(b2->sb == "D2.sb"); - test(b2->pb == b1); - } - catch(...) - { - test(0); - } + try + { + BPtr b1; + BPtr b2; + test->paramTest1(b1, b2); + + test(b1); + test(b1->ice_id() == "::Test::D1"); + test(b1->sb == "D1.sb"); + test(b1->pb == b2); + D1Ptr d1 = D1Ptr::dynamicCast(b1); + test(d1); + test(d1->sd1 == "D1.sd1"); + test(d1->pd1 == b2); + + test(b2); + test(b2->ice_id() == "::Test::B"); // No factory, must be sliced + test(b2->sb == "D2.sb"); + test(b2->pb == b1); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "param ptr slicing with known first (AMI)... " << flush; { - AMI_Test_paramTest1IPtr cb = new AMI_Test_paramTest1I; - test->paramTest1_async(cb); - test(cb->check()); + AMI_Test_paramTest1IPtr cb = new AMI_Test_paramTest1I; + test->paramTest1_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "param ptr slicing with unknown first... " << flush; { - try - { - BPtr b2; - BPtr b1; - test->paramTest2(b2, b1); - - test(b1); - test(b1->ice_id() == "::Test::D1"); - test(b1->sb == "D1.sb"); - test(b1->pb == b2); - D1Ptr d1 = D1Ptr::dynamicCast(b1); - test(d1); - test(d1->sd1 == "D1.sd1"); - test(d1->pd1 == b2); - - test(b2); - test(b2->ice_id() == "::Test::B"); // No factory, must be sliced - test(b2->sb == "D2.sb"); - test(b2->pb == b1); - } - catch(...) - { - test(0); - } + try + { + BPtr b2; + BPtr b1; + test->paramTest2(b2, b1); + + test(b1); + test(b1->ice_id() == "::Test::D1"); + test(b1->sb == "D1.sb"); + test(b1->pb == b2); + D1Ptr d1 = D1Ptr::dynamicCast(b1); + test(d1); + test(d1->sd1 == "D1.sd1"); + test(d1->pd1 == b2); + + test(b2); + test(b2->ice_id() == "::Test::B"); // No factory, must be sliced + test(b2->sb == "D2.sb"); + test(b2->pb == b1); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "return value identity with known first... " << flush; { - try - { - BPtr p1; - BPtr p2; - BPtr r = test->returnTest1(p1, p2); - test(r == p1); - } - catch(...) - { - test(0); - } + try + { + BPtr p1; + BPtr p2; + BPtr r = test->returnTest1(p1, p2); + test(r == p1); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "return value identity with known first (AMI)... " << flush; { - AMI_Test_returnTest1IPtr cb = new AMI_Test_returnTest1I; - test->returnTest1_async(cb); - test(cb->check()); + AMI_Test_returnTest1IPtr cb = new AMI_Test_returnTest1I; + test->returnTest1_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "return value identity with unknown first... " << flush; { - try - { - BPtr p1; - BPtr p2; - BPtr r = test->returnTest2(p1, p2); - test(r == p1); - } - catch(...) - { - test(0); - } + try + { + BPtr p1; + BPtr p2; + BPtr r = test->returnTest2(p1, p2); + test(r == p1); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "return value identity with unknown first (AMI)... " << flush; { - AMI_Test_returnTest2IPtr cb = new AMI_Test_returnTest2I; - test->returnTest2_async(cb); - test(cb->check()); + AMI_Test_returnTest2IPtr cb = new AMI_Test_returnTest2I; + test->returnTest2_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "return value identity for input params known first... " << flush; { - try - { - D1Ptr d1 = new D1; - d1->sb = "D1.sb"; - d1->sd1 = "D1.sd1"; - D3Ptr d3 = new D3; - d3->pb = d1; - d3->sb = "D3.sb"; - d3->sd3 = "D3.sd3"; - d3->pd3 = d1; - d1->pb = d3; - d1->pd1 = d3; - - BPtr b1 = test->returnTest3(d1, d3); - - test(b1); - test(b1->sb == "D1.sb"); - test(b1->ice_id() == "::Test::D1"); - D1Ptr p1 = D1Ptr::dynamicCast(b1); - test(p1); - test(p1->sd1 == "D1.sd1"); - test(p1->pd1 == b1->pb); - - BPtr b2 = b1->pb; - test(b2); - test(b2->sb == "D3.sb"); - test(b2->ice_id() == "::Test::B"); // Sliced by server - test(b2->pb == b1); - D3Ptr p3 = D3Ptr::dynamicCast(b2); - test(!p3); - - test(b1 != d1); - test(b1 != d3); - test(b2 != d1); - test(b2 != d3); - } - catch(...) - { - test(0); - } + try + { + D1Ptr d1 = new D1; + d1->sb = "D1.sb"; + d1->sd1 = "D1.sd1"; + D3Ptr d3 = new D3; + d3->pb = d1; + d3->sb = "D3.sb"; + d3->sd3 = "D3.sd3"; + d3->pd3 = d1; + d1->pb = d3; + d1->pd1 = d3; + + BPtr b1 = test->returnTest3(d1, d3); + + test(b1); + test(b1->sb == "D1.sb"); + test(b1->ice_id() == "::Test::D1"); + D1Ptr p1 = D1Ptr::dynamicCast(b1); + test(p1); + test(p1->sd1 == "D1.sd1"); + test(p1->pd1 == b1->pb); + + BPtr b2 = b1->pb; + test(b2); + test(b2->sb == "D3.sb"); + test(b2->ice_id() == "::Test::B"); // Sliced by server + test(b2->pb == b1); + D3Ptr p3 = D3Ptr::dynamicCast(b2); + test(!p3); + + test(b1 != d1); + test(b1 != d3); + test(b2 != d1); + test(b2 != d3); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "return value identity for input params known first (AMI)... " << flush; { - try - { - D1Ptr d1 = new D1; - d1->sb = "D1.sb"; - d1->sd1 = "D1.sd1"; - D3Ptr d3 = new D3; - d3->pb = d1; - d3->sb = "D3.sb"; - d3->sd3 = "D3.sd3"; - d3->pd3 = d1; - d1->pb = d3; - d1->pd1 = d3; - - AMI_Test_returnTest3IPtr cb = new AMI_Test_returnTest3I; - test->returnTest3_async(cb, d1, d3); - test(cb->check()); - BPtr b1 = cb->r; - - test(b1); - test(b1->sb == "D1.sb"); - test(b1->ice_id() == "::Test::D1"); - D1Ptr p1 = D1Ptr::dynamicCast(b1); - test(p1); - test(p1->sd1 == "D1.sd1"); - test(p1->pd1 == b1->pb); - - BPtr b2 = b1->pb; - test(b2); - test(b2->sb == "D3.sb"); - test(b2->ice_id() == "::Test::B"); // Sliced by server - test(b2->pb == b1); - D3Ptr p3 = D3Ptr::dynamicCast(b2); - test(!p3); - - test(b1 != d1); - test(b1 != d3); - test(b2 != d1); - test(b2 != d3); - } - catch(...) - { - test(0); - } + try + { + D1Ptr d1 = new D1; + d1->sb = "D1.sb"; + d1->sd1 = "D1.sd1"; + D3Ptr d3 = new D3; + d3->pb = d1; + d3->sb = "D3.sb"; + d3->sd3 = "D3.sd3"; + d3->pd3 = d1; + d1->pb = d3; + d1->pd1 = d3; + + AMI_Test_returnTest3IPtr cb = new AMI_Test_returnTest3I; + test->returnTest3_async(cb, d1, d3); + test(cb->check()); + BPtr b1 = cb->r; + + test(b1); + test(b1->sb == "D1.sb"); + test(b1->ice_id() == "::Test::D1"); + D1Ptr p1 = D1Ptr::dynamicCast(b1); + test(p1); + test(p1->sd1 == "D1.sd1"); + test(p1->pd1 == b1->pb); + + BPtr b2 = b1->pb; + test(b2); + test(b2->sb == "D3.sb"); + test(b2->ice_id() == "::Test::B"); // Sliced by server + test(b2->pb == b1); + D3Ptr p3 = D3Ptr::dynamicCast(b2); + test(!p3); + + test(b1 != d1); + test(b1 != d3); + test(b2 != d1); + test(b2 != d3); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "return value identity for input params unknown first... " << flush; { - try - { - D1Ptr d1 = new D1; - d1->sb = "D1.sb"; - d1->sd1 = "D1.sd1"; - D3Ptr d3 = new D3; - d3->pb = d1; - d3->sb = "D3.sb"; - d3->sd3 = "D3.sd3"; - d3->pd3 = d1; - d1->pb = d3; - d1->pd1 = d3; - - BPtr b1 = test->returnTest3(d3, d1); - - test(b1); - test(b1->sb == "D3.sb"); - test(b1->ice_id() == "::Test::B"); // Sliced by server - D3Ptr p1 = D3Ptr::dynamicCast(b1); - test(!p1); - - BPtr b2 = b1->pb; - test(b2); - test(b2->sb == "D1.sb"); - test(b2->ice_id() == "::Test::D1"); - test(b2->pb == b1); - D1Ptr p3 = D1Ptr::dynamicCast(b2); - test(p3); - test(p3->sd1 == "D1.sd1"); - test(p3->pd1 == b1); - - test(b1 != d1); - test(b1 != d3); - test(b2 != d1); - test(b2 != d3); - } - catch(...) - { - test(0); - } + try + { + D1Ptr d1 = new D1; + d1->sb = "D1.sb"; + d1->sd1 = "D1.sd1"; + D3Ptr d3 = new D3; + d3->pb = d1; + d3->sb = "D3.sb"; + d3->sd3 = "D3.sd3"; + d3->pd3 = d1; + d1->pb = d3; + d1->pd1 = d3; + + BPtr b1 = test->returnTest3(d3, d1); + + test(b1); + test(b1->sb == "D3.sb"); + test(b1->ice_id() == "::Test::B"); // Sliced by server + D3Ptr p1 = D3Ptr::dynamicCast(b1); + test(!p1); + + BPtr b2 = b1->pb; + test(b2); + test(b2->sb == "D1.sb"); + test(b2->ice_id() == "::Test::D1"); + test(b2->pb == b1); + D1Ptr p3 = D1Ptr::dynamicCast(b2); + test(p3); + test(p3->sd1 == "D1.sd1"); + test(p3->pd1 == b1); + + test(b1 != d1); + test(b1 != d3); + test(b2 != d1); + test(b2 != d3); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "return value identity for input params unknown first (AMI)... " << flush; { - try - { - D1Ptr d1 = new D1; - d1->sb = "D1.sb"; - d1->sd1 = "D1.sd1"; - D3Ptr d3 = new D3; - d3->pb = d1; - d3->sb = "D3.sb"; - d3->sd3 = "D3.sd3"; - d3->pd3 = d1; - d1->pb = d3; - d1->pd1 = d3; - - AMI_Test_returnTest3IPtr cb = new AMI_Test_returnTest3I; - test->returnTest3_async(cb, d3, d1); - test(cb->check()); - BPtr b1 = cb->r; - - test(b1); - test(b1->sb == "D3.sb"); - test(b1->ice_id() == "::Test::B"); // Sliced by server - D3Ptr p1 = D3Ptr::dynamicCast(b1); - test(!p1); - - BPtr b2 = b1->pb; - test(b2); - test(b2->sb == "D1.sb"); - test(b2->ice_id() == "::Test::D1"); - test(b2->pb == b1); - D1Ptr p3 = D1Ptr::dynamicCast(b2); - test(p3); - test(p3->sd1 == "D1.sd1"); - test(p3->pd1 == b1); - - test(b1 != d1); - test(b1 != d3); - test(b2 != d1); - test(b2 != d3); - } - catch(...) - { - test(0); - } + try + { + D1Ptr d1 = new D1; + d1->sb = "D1.sb"; + d1->sd1 = "D1.sd1"; + D3Ptr d3 = new D3; + d3->pb = d1; + d3->sb = "D3.sb"; + d3->sd3 = "D3.sd3"; + d3->pd3 = d1; + d1->pb = d3; + d1->pd1 = d3; + + AMI_Test_returnTest3IPtr cb = new AMI_Test_returnTest3I; + test->returnTest3_async(cb, d3, d1); + test(cb->check()); + BPtr b1 = cb->r; + + test(b1); + test(b1->sb == "D3.sb"); + test(b1->ice_id() == "::Test::B"); // Sliced by server + D3Ptr p1 = D3Ptr::dynamicCast(b1); + test(!p1); + + BPtr b2 = b1->pb; + test(b2); + test(b2->sb == "D1.sb"); + test(b2->ice_id() == "::Test::D1"); + test(b2->pb == b1); + D1Ptr p3 = D1Ptr::dynamicCast(b2); + test(p3); + test(p3->sd1 == "D1.sd1"); + test(p3->pd1 == b1); + + test(b1 != d1); + test(b1 != d3); + test(b2 != d1); + test(b2 != d3); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "remainder unmarshaling (3 instances)... " << flush; { - try - { - BPtr p1; - BPtr p2; - BPtr ret = test->paramTest3(p1, p2); - - test(p1); - test(p1->sb == "D2.sb (p1 1)"); - test(p1->pb == 0); - test(p1->ice_id() == "::Test::B"); - - test(p2); - test(p2->sb == "D2.sb (p2 1)"); - test(p2->pb == 0); - test(p2->ice_id() == "::Test::B"); - - test(ret); - test(ret->sb == "D1.sb (p2 2)"); - test(ret->pb == 0); - test(ret->ice_id() == "::Test::D1"); - } - catch(...) - { - test(0); - } + try + { + BPtr p1; + BPtr p2; + BPtr ret = test->paramTest3(p1, p2); + + test(p1); + test(p1->sb == "D2.sb (p1 1)"); + test(p1->pb == 0); + test(p1->ice_id() == "::Test::B"); + + test(p2); + test(p2->sb == "D2.sb (p2 1)"); + test(p2->pb == 0); + test(p2->ice_id() == "::Test::B"); + + test(ret); + test(ret->sb == "D1.sb (p2 2)"); + test(ret->pb == 0); + test(ret->ice_id() == "::Test::D1"); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "remainder unmarshaling (3 instances) (AMI)... " << flush; { - AMI_Test_paramTest3IPtr cb = new AMI_Test_paramTest3I; - test->paramTest3_async(cb); - test(cb->check()); + AMI_Test_paramTest3IPtr cb = new AMI_Test_paramTest3I; + test->paramTest3_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "remainder unmarshaling (4 instances)... " << flush; { - try - { - BPtr b; - BPtr ret = test->paramTest4(b); - - test(b); - test(b->sb == "D4.sb (1)"); - test(b->pb == 0); - test(b->ice_id() == "::Test::B"); - - test(ret); - test(ret->sb == "B.sb (2)"); - test(ret->pb == 0); - test(ret->ice_id() == "::Test::B"); - } - catch(...) - { - test(0); - } + try + { + BPtr b; + BPtr ret = test->paramTest4(b); + + test(b); + test(b->sb == "D4.sb (1)"); + test(b->pb == 0); + test(b->ice_id() == "::Test::B"); + + test(ret); + test(ret->sb == "B.sb (2)"); + test(ret->pb == 0); + test(ret->ice_id() == "::Test::B"); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "remainder unmarshaling (4 instances) (AMI)... " << flush; { - BPtr b; - AMI_Test_paramTest4IPtr cb = new AMI_Test_paramTest4I; - test->paramTest4_async(cb); - test(cb->check()); + BPtr b; + AMI_Test_paramTest4IPtr cb = new AMI_Test_paramTest4I; + test->paramTest4_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "param ptr slicing, instance marshaled in unknown derived as base... " << flush; { - try - { - BPtr b1 = new B; - b1->sb = "B.sb(1)"; - b1->pb = b1; - - D3Ptr d3 = new D3; - d3->sb = "D3.sb"; - d3->pb = d3; - d3->sd3 = "D3.sd3"; - d3->pd3 = b1; - - BPtr b2 = new B; - b2->sb = "B.sb(2)"; - b2->pb = b1; - - BPtr r = test->returnTest3(d3, b2); - - test(r); - test(r->ice_id() == "::Test::B"); - test(r->sb == "D3.sb"); - test(r->pb == r); - } - catch(...) - { - test(0); - } + try + { + BPtr b1 = new B; + b1->sb = "B.sb(1)"; + b1->pb = b1; + + D3Ptr d3 = new D3; + d3->sb = "D3.sb"; + d3->pb = d3; + d3->sd3 = "D3.sd3"; + d3->pd3 = b1; + + BPtr b2 = new B; + b2->sb = "B.sb(2)"; + b2->pb = b1; + + BPtr r = test->returnTest3(d3, b2); + + test(r); + test(r->ice_id() == "::Test::B"); + test(r->sb == "D3.sb"); + test(r->pb == r); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "param ptr slicing, instance marshaled in unknown derived as base (AMI)... " << flush; { - try - { - BPtr b1 = new B; - b1->sb = "B.sb(1)"; - b1->pb = b1; - - D3Ptr d3 = new D3; - d3->sb = "D3.sb"; - d3->pb = d3; - d3->sd3 = "D3.sd3"; - d3->pd3 = b1; - - BPtr b2 = new B; - b2->sb = "B.sb(2)"; - b2->pb = b1; - - AMI_Test_returnTest3IPtr cb = new AMI_Test_returnTest3I; - test->returnTest3_async(cb, d3, b2); - test(cb->check()); - BPtr r = cb->r; - - test(r); - test(r->ice_id() == "::Test::B"); - test(r->sb == "D3.sb"); - test(r->pb == r); - } - catch(...) - { - test(0); - } + try + { + BPtr b1 = new B; + b1->sb = "B.sb(1)"; + b1->pb = b1; + + D3Ptr d3 = new D3; + d3->sb = "D3.sb"; + d3->pb = d3; + d3->sd3 = "D3.sd3"; + d3->pd3 = b1; + + BPtr b2 = new B; + b2->sb = "B.sb(2)"; + b2->pb = b1; + + AMI_Test_returnTest3IPtr cb = new AMI_Test_returnTest3I; + test->returnTest3_async(cb, d3, b2); + test(cb->check()); + BPtr r = cb->r; + + test(r); + test(r->ice_id() == "::Test::B"); + test(r->sb == "D3.sb"); + test(r->pb == r); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "param ptr slicing, instance marshaled in unknown derived as derived... " - << flush; - { - try - { - D1Ptr d11 = new D1; - d11->sb = "D1.sb(1)"; - d11->pb = d11; - d11->sd1 = "D1.sd1(1)"; - - D3Ptr d3 = new D3; - d3->sb = "D3.sb"; - d3->pb = d3; - d3->sd3 = "D3.sd3"; - d3->pd3 = d11; - - D1Ptr d12 = new D1; - d12->sb = "D1.sb(2)"; - d12->pb = d12; - d12->sd1 = "D1.sd1(2)"; - d12->pd1 = d11; - - BPtr r = test->returnTest3(d3, d12); - test(r); - test(r->ice_id() == "::Test::B"); - test(r->sb == "D3.sb"); - test(r->pb == r); - } - catch(...) - { - test(0); - } + << flush; + { + try + { + D1Ptr d11 = new D1; + d11->sb = "D1.sb(1)"; + d11->pb = d11; + d11->sd1 = "D1.sd1(1)"; + + D3Ptr d3 = new D3; + d3->sb = "D3.sb"; + d3->pb = d3; + d3->sd3 = "D3.sd3"; + d3->pd3 = d11; + + D1Ptr d12 = new D1; + d12->sb = "D1.sb(2)"; + d12->pb = d12; + d12->sd1 = "D1.sd1(2)"; + d12->pd1 = d11; + + BPtr r = test->returnTest3(d3, d12); + test(r); + test(r->ice_id() == "::Test::B"); + test(r->sb == "D3.sb"); + test(r->pb == r); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "param ptr slicing, instance marshaled in unknown derived as derived (AMI)... " - << flush; - { - try - { - D1Ptr d11 = new D1; - d11->sb = "D1.sb(1)"; - d11->pb = d11; - d11->sd1 = "D1.sd1(1)"; - - D3Ptr d3 = new D3; - d3->sb = "D3.sb"; - d3->pb = d3; - d3->sd3 = "D3.sd3"; - d3->pd3 = d11; - - D1Ptr d12 = new D1; - d12->sb = "D1.sb(2)"; - d12->pb = d12; - d12->sd1 = "D1.sd1(2)"; - d12->pd1 = d11; - - AMI_Test_returnTest3IPtr cb = new AMI_Test_returnTest3I; - test->returnTest3_async(cb, d3, d12); - test(cb->check()); - BPtr r = cb->r; - test(r); - test(r->ice_id() == "::Test::B"); - test(r->sb == "D3.sb"); - test(r->pb == r); - } - catch(...) - { - test(0); - } + << flush; + { + try + { + D1Ptr d11 = new D1; + d11->sb = "D1.sb(1)"; + d11->pb = d11; + d11->sd1 = "D1.sd1(1)"; + + D3Ptr d3 = new D3; + d3->sb = "D3.sb"; + d3->pb = d3; + d3->sd3 = "D3.sd3"; + d3->pd3 = d11; + + D1Ptr d12 = new D1; + d12->sb = "D1.sb(2)"; + d12->pb = d12; + d12->sd1 = "D1.sd1(2)"; + d12->pd1 = d11; + + AMI_Test_returnTest3IPtr cb = new AMI_Test_returnTest3I; + test->returnTest3_async(cb, d3, d12); + test(cb->check()); + BPtr r = cb->r; + test(r); + test(r->ice_id() == "::Test::B"); + test(r->sb == "D3.sb"); + test(r->pb == r); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "sequence slicing... " << flush; { - try - { - SS ss; - { - BPtr ss1b = new B; - ss1b->sb = "B.sb"; - ss1b->pb = ss1b; - - D1Ptr ss1d1 = new D1; - ss1d1->sb = "D1.sb"; - ss1d1->sd1 = "D1.sd1"; - ss1d1->pb = ss1b; - - D3Ptr ss1d3 = new D3; - ss1d3->sb = "D3.sb"; - ss1d3->sd3 = "D3.sd3"; - ss1d3->pb = ss1b; - - BPtr ss2b = new B; - ss2b->sb = "B.sb"; - ss2b->pb = ss1b; - - D1Ptr ss2d1 = new D1; - ss2d1->sb = "D1.sb"; - ss2d1->sd1 = "D1.sd1"; - ss2d1->pb = ss2b; - - D3Ptr ss2d3 = new D3; - ss2d3->sb = "D3.sb"; - ss2d3->sd3 = "D3.sd3"; - ss2d3->pb = ss2b; - - ss1d1->pd1 = ss2b; - ss1d3->pd3 = ss2d1; - - ss2d1->pd1 = ss1d3; - ss2d3->pd3 = ss1d1; - - SS1Ptr ss1 = new SS1; - ss1->s.push_back(ss1b); - ss1->s.push_back(ss1d1); - ss1->s.push_back(ss1d3); - - SS2Ptr ss2 = new SS2; - ss2->s.push_back(ss2b); - ss2->s.push_back(ss2d1); - ss2->s.push_back(ss2d3); - - ss = test->sequenceTest(ss1, ss2); - } - - test(ss.c1); - BPtr ss1b = ss.c1->s[0]; - BPtr ss1d1 = ss.c1->s[1]; - test(ss.c2); - BPtr ss1d3 = ss.c1->s[2]; - - test(ss.c2); - BPtr ss2b = ss.c2->s[0]; - BPtr ss2d1 = ss.c2->s[1]; - BPtr ss2d3 = ss.c2->s[2]; - - test(ss1b->pb == ss1b); - test(ss1d1->pb == ss1b); - test(ss1d3->pb == ss1b); - - test(ss2b->pb == ss1b); - test(ss2d1->pb == ss2b); - test(ss2d3->pb == ss2b); - - test(ss1b->ice_id() == "::Test::B"); - test(ss1d1->ice_id() == "::Test::D1"); - test(ss1d3->ice_id() == "::Test::B"); - - test(ss2b->ice_id() == "::Test::B"); - test(ss2d1->ice_id() == "::Test::D1"); - test(ss2d3->ice_id() == "::Test::B"); - } - catch(const ::Ice::Exception&) - { - test(0); - } + try + { + SS ss; + { + BPtr ss1b = new B; + ss1b->sb = "B.sb"; + ss1b->pb = ss1b; + + D1Ptr ss1d1 = new D1; + ss1d1->sb = "D1.sb"; + ss1d1->sd1 = "D1.sd1"; + ss1d1->pb = ss1b; + + D3Ptr ss1d3 = new D3; + ss1d3->sb = "D3.sb"; + ss1d3->sd3 = "D3.sd3"; + ss1d3->pb = ss1b; + + BPtr ss2b = new B; + ss2b->sb = "B.sb"; + ss2b->pb = ss1b; + + D1Ptr ss2d1 = new D1; + ss2d1->sb = "D1.sb"; + ss2d1->sd1 = "D1.sd1"; + ss2d1->pb = ss2b; + + D3Ptr ss2d3 = new D3; + ss2d3->sb = "D3.sb"; + ss2d3->sd3 = "D3.sd3"; + ss2d3->pb = ss2b; + + ss1d1->pd1 = ss2b; + ss1d3->pd3 = ss2d1; + + ss2d1->pd1 = ss1d3; + ss2d3->pd3 = ss1d1; + + SS1Ptr ss1 = new SS1; + ss1->s.push_back(ss1b); + ss1->s.push_back(ss1d1); + ss1->s.push_back(ss1d3); + + SS2Ptr ss2 = new SS2; + ss2->s.push_back(ss2b); + ss2->s.push_back(ss2d1); + ss2->s.push_back(ss2d3); + + ss = test->sequenceTest(ss1, ss2); + } + + test(ss.c1); + BPtr ss1b = ss.c1->s[0]; + BPtr ss1d1 = ss.c1->s[1]; + test(ss.c2); + BPtr ss1d3 = ss.c1->s[2]; + + test(ss.c2); + BPtr ss2b = ss.c2->s[0]; + BPtr ss2d1 = ss.c2->s[1]; + BPtr ss2d3 = ss.c2->s[2]; + + test(ss1b->pb == ss1b); + test(ss1d1->pb == ss1b); + test(ss1d3->pb == ss1b); + + test(ss2b->pb == ss1b); + test(ss2d1->pb == ss2b); + test(ss2d3->pb == ss2b); + + test(ss1b->ice_id() == "::Test::B"); + test(ss1d1->ice_id() == "::Test::D1"); + test(ss1d3->ice_id() == "::Test::B"); + + test(ss2b->ice_id() == "::Test::B"); + test(ss2d1->ice_id() == "::Test::D1"); + test(ss2d3->ice_id() == "::Test::B"); + } + catch(const ::Ice::Exception&) + { + test(0); + } } cout << "ok" << endl; cout << "sequence slicing (AMI)... " << flush; { - try - { - SS ss; - { - BPtr ss1b = new B; - ss1b->sb = "B.sb"; - ss1b->pb = ss1b; - - D1Ptr ss1d1 = new D1; - ss1d1->sb = "D1.sb"; - ss1d1->sd1 = "D1.sd1"; - ss1d1->pb = ss1b; - - D3Ptr ss1d3 = new D3; - ss1d3->sb = "D3.sb"; - ss1d3->sd3 = "D3.sd3"; - ss1d3->pb = ss1b; - - BPtr ss2b = new B; - ss2b->sb = "B.sb"; - ss2b->pb = ss1b; - - D1Ptr ss2d1 = new D1; - ss2d1->sb = "D1.sb"; - ss2d1->sd1 = "D1.sd1"; - ss2d1->pb = ss2b; - - D3Ptr ss2d3 = new D3; - ss2d3->sb = "D3.sb"; - ss2d3->sd3 = "D3.sd3"; - ss2d3->pb = ss2b; - - ss1d1->pd1 = ss2b; - ss1d3->pd3 = ss2d1; - - ss2d1->pd1 = ss1d3; - ss2d3->pd3 = ss1d1; - - SS1Ptr ss1 = new SS1; - ss1->s.push_back(ss1b); - ss1->s.push_back(ss1d1); - ss1->s.push_back(ss1d3); - - SS2Ptr ss2 = new SS2; - ss2->s.push_back(ss2b); - ss2->s.push_back(ss2d1); - ss2->s.push_back(ss2d3); - - AMI_Test_sequenceTestIPtr cb = new AMI_Test_sequenceTestI; - test->sequenceTest_async(cb, ss1, ss2); - test(cb->check()); - ss = cb->r; - } - - test(ss.c1); - BPtr ss1b = ss.c1->s[0]; - BPtr ss1d1 = ss.c1->s[1]; - test(ss.c2); - BPtr ss1d3 = ss.c1->s[2]; - - test(ss.c2); - BPtr ss2b = ss.c2->s[0]; - BPtr ss2d1 = ss.c2->s[1]; - BPtr ss2d3 = ss.c2->s[2]; - - test(ss1b->pb == ss1b); - test(ss1d1->pb == ss1b); - test(ss1d3->pb == ss1b); - - test(ss2b->pb == ss1b); - test(ss2d1->pb == ss2b); - test(ss2d3->pb == ss2b); - - test(ss1b->ice_id() == "::Test::B"); - test(ss1d1->ice_id() == "::Test::D1"); - test(ss1d3->ice_id() == "::Test::B"); - - test(ss2b->ice_id() == "::Test::B"); - test(ss2d1->ice_id() == "::Test::D1"); - test(ss2d3->ice_id() == "::Test::B"); - } - catch(const ::Ice::Exception&) - { - test(0); - } + try + { + SS ss; + { + BPtr ss1b = new B; + ss1b->sb = "B.sb"; + ss1b->pb = ss1b; + + D1Ptr ss1d1 = new D1; + ss1d1->sb = "D1.sb"; + ss1d1->sd1 = "D1.sd1"; + ss1d1->pb = ss1b; + + D3Ptr ss1d3 = new D3; + ss1d3->sb = "D3.sb"; + ss1d3->sd3 = "D3.sd3"; + ss1d3->pb = ss1b; + + BPtr ss2b = new B; + ss2b->sb = "B.sb"; + ss2b->pb = ss1b; + + D1Ptr ss2d1 = new D1; + ss2d1->sb = "D1.sb"; + ss2d1->sd1 = "D1.sd1"; + ss2d1->pb = ss2b; + + D3Ptr ss2d3 = new D3; + ss2d3->sb = "D3.sb"; + ss2d3->sd3 = "D3.sd3"; + ss2d3->pb = ss2b; + + ss1d1->pd1 = ss2b; + ss1d3->pd3 = ss2d1; + + ss2d1->pd1 = ss1d3; + ss2d3->pd3 = ss1d1; + + SS1Ptr ss1 = new SS1; + ss1->s.push_back(ss1b); + ss1->s.push_back(ss1d1); + ss1->s.push_back(ss1d3); + + SS2Ptr ss2 = new SS2; + ss2->s.push_back(ss2b); + ss2->s.push_back(ss2d1); + ss2->s.push_back(ss2d3); + + AMI_Test_sequenceTestIPtr cb = new AMI_Test_sequenceTestI; + test->sequenceTest_async(cb, ss1, ss2); + test(cb->check()); + ss = cb->r; + } + + test(ss.c1); + BPtr ss1b = ss.c1->s[0]; + BPtr ss1d1 = ss.c1->s[1]; + test(ss.c2); + BPtr ss1d3 = ss.c1->s[2]; + + test(ss.c2); + BPtr ss2b = ss.c2->s[0]; + BPtr ss2d1 = ss.c2->s[1]; + BPtr ss2d3 = ss.c2->s[2]; + + test(ss1b->pb == ss1b); + test(ss1d1->pb == ss1b); + test(ss1d3->pb == ss1b); + + test(ss2b->pb == ss1b); + test(ss2d1->pb == ss2b); + test(ss2d3->pb == ss2b); + + test(ss1b->ice_id() == "::Test::B"); + test(ss1d1->ice_id() == "::Test::D1"); + test(ss1d3->ice_id() == "::Test::B"); + + test(ss2b->ice_id() == "::Test::B"); + test(ss2d1->ice_id() == "::Test::D1"); + test(ss2d3->ice_id() == "::Test::B"); + } + catch(const ::Ice::Exception&) + { + test(0); + } } cout << "ok" << endl; cout << "dictionary slicing... " << flush; { - try - { - BDict bin; - BDict bout; - BDict r; - int i; - for(i = 0; i < 10; ++i) - { - ostringstream s; - s << "D1." << i; - D1Ptr d1 = new D1; - d1->sb = s.str(); - d1->pb = d1; - d1->sd1 = s.str(); - bin[i] = d1; - } - - r = test->dictionaryTest(bin, bout); - - test(bout.size() == 10); - for(i = 0; i < 10; ++i) - { - BPtr b = bout.find(i * 10)->second; - test(b); - std::ostringstream s; - s << "D1." << i; - test(b->sb == s.str()); - test(b->pb); - test(b->pb != b); - test(b->pb->sb == s.str()); - test(b->pb->pb == b->pb); - } - - test(r.size() == 10); - for(i = 0; i < 10; ++i) - { - BPtr b = r.find(i * 20)->second; - test(b); - std::ostringstream s; - s << "D1." << i * 20; - test(b->sb == s.str()); - test(b->pb == (i == 0 ? BPtr(0) : r.find((i - 1) * 20)->second)); - D1Ptr d1 = D1Ptr::dynamicCast(b); - test(d1); - test(d1->sd1 == s.str()); - test(d1->pd1 == d1); - } - } - catch(const ::Ice::Exception&) - { - test(0); - } + try + { + BDict bin; + BDict bout; + BDict r; + int i; + for(i = 0; i < 10; ++i) + { + ostringstream s; + s << "D1." << i; + D1Ptr d1 = new D1; + d1->sb = s.str(); + d1->pb = d1; + d1->sd1 = s.str(); + bin[i] = d1; + } + + r = test->dictionaryTest(bin, bout); + + test(bout.size() == 10); + for(i = 0; i < 10; ++i) + { + BPtr b = bout.find(i * 10)->second; + test(b); + std::ostringstream s; + s << "D1." << i; + test(b->sb == s.str()); + test(b->pb); + test(b->pb != b); + test(b->pb->sb == s.str()); + test(b->pb->pb == b->pb); + } + + test(r.size() == 10); + for(i = 0; i < 10; ++i) + { + BPtr b = r.find(i * 20)->second; + test(b); + std::ostringstream s; + s << "D1." << i * 20; + test(b->sb == s.str()); + test(b->pb == (i == 0 ? BPtr(0) : r.find((i - 1) * 20)->second)); + D1Ptr d1 = D1Ptr::dynamicCast(b); + test(d1); + test(d1->sd1 == s.str()); + test(d1->pd1 == d1); + } + } + catch(const ::Ice::Exception&) + { + test(0); + } } cout << "ok" << endl; cout << "dictionary slicing (AMI)... " << flush; { - try - { - BDict bin; - BDict bout; - BDict r; - int i; - for(i = 0; i < 10; ++i) - { - ostringstream s; - s << "D1." << i; - D1Ptr d1 = new D1; - d1->sb = s.str(); - d1->pb = d1; - d1->sd1 = s.str(); - bin[i] = d1; - } - - AMI_Test_dictionaryTestIPtr cb = new AMI_Test_dictionaryTestI; - test->dictionaryTest_async(cb, bin); - test(cb->check()); - bout = cb->bout; - r = cb->r; - - test(bout.size() == 10); - for(i = 0; i < 10; ++i) - { - BPtr b = bout.find(i * 10)->second; - test(b); - std::ostringstream s; - s << "D1." << i; - test(b->sb == s.str()); - test(b->pb); - test(b->pb != b); - test(b->pb->sb == s.str()); - test(b->pb->pb == b->pb); - } - - test(r.size() == 10); - for(i = 0; i < 10; ++i) - { - BPtr b = r.find(i * 20)->second; - test(b); - std::ostringstream s; - s << "D1." << i * 20; - test(b->sb == s.str()); - test(b->pb == (i == 0 ? BPtr(0) : r.find((i - 1) * 20)->second)); - D1Ptr d1 = D1Ptr::dynamicCast(b); - test(d1); - test(d1->sd1 == s.str()); - test(d1->pd1 == d1); - } - } - catch(const ::Ice::Exception&) - { - test(0); - } + try + { + BDict bin; + BDict bout; + BDict r; + int i; + for(i = 0; i < 10; ++i) + { + ostringstream s; + s << "D1." << i; + D1Ptr d1 = new D1; + d1->sb = s.str(); + d1->pb = d1; + d1->sd1 = s.str(); + bin[i] = d1; + } + + AMI_Test_dictionaryTestIPtr cb = new AMI_Test_dictionaryTestI; + test->dictionaryTest_async(cb, bin); + test(cb->check()); + bout = cb->bout; + r = cb->r; + + test(bout.size() == 10); + for(i = 0; i < 10; ++i) + { + BPtr b = bout.find(i * 10)->second; + test(b); + std::ostringstream s; + s << "D1." << i; + test(b->sb == s.str()); + test(b->pb); + test(b->pb != b); + test(b->pb->sb == s.str()); + test(b->pb->pb == b->pb); + } + + test(r.size() == 10); + for(i = 0; i < 10; ++i) + { + BPtr b = r.find(i * 20)->second; + test(b); + std::ostringstream s; + s << "D1." << i * 20; + test(b->sb == s.str()); + test(b->pb == (i == 0 ? BPtr(0) : r.find((i - 1) * 20)->second)); + D1Ptr d1 = D1Ptr::dynamicCast(b); + test(d1); + test(d1->sd1 == s.str()); + test(d1->pd1 == d1); + } + } + catch(const ::Ice::Exception&) + { + test(0); + } } cout << "ok" << endl; cout << "base exception thrown as base exception... " << flush; { - try - { - test->throwBaseAsBase(); - test(0); - } - catch(const BaseException& e) - { - test(e.ice_name() == "Test::BaseException"); - test(e.sbe == "sbe"); - test(e.pb); - test(e.pb->sb == "sb"); - test(e.pb->pb == e.pb); - } - catch(...) - { - test(0); - } + try + { + test->throwBaseAsBase(); + test(0); + } + catch(const BaseException& e) + { + test(e.ice_name() == "Test::BaseException"); + test(e.sbe == "sbe"); + test(e.pb); + test(e.pb->sb == "sb"); + test(e.pb->pb == e.pb); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "base exception thrown as base exception (AMI)... " << flush; { - AMI_Test_throwBaseAsBaseIPtr cb = new AMI_Test_throwBaseAsBaseI; - test->throwBaseAsBase_async(cb); - test(cb->check()); + AMI_Test_throwBaseAsBaseIPtr cb = new AMI_Test_throwBaseAsBaseI; + test->throwBaseAsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "derived exception thrown as base exception... " << flush; { - try - { - test->throwDerivedAsBase(); - test(0); - } - catch(const DerivedException& e) - { - test(e.ice_name() == "Test::DerivedException"); - test(e.sbe == "sbe"); - test(e.pb); - test(e.pb->sb == "sb1"); - test(e.pb->pb == e.pb); - test(e.sde == "sde1"); - test(e.pd1); - test(e.pd1->sb == "sb2"); - test(e.pd1->pb == e.pd1); - test(e.pd1->sd1 == "sd2"); - test(e.pd1->pd1 == e.pd1); - } - catch(...) - { - test(0); - } + try + { + test->throwDerivedAsBase(); + test(0); + } + catch(const DerivedException& e) + { + test(e.ice_name() == "Test::DerivedException"); + test(e.sbe == "sbe"); + test(e.pb); + test(e.pb->sb == "sb1"); + test(e.pb->pb == e.pb); + test(e.sde == "sde1"); + test(e.pd1); + test(e.pd1->sb == "sb2"); + test(e.pd1->pb == e.pd1); + test(e.pd1->sd1 == "sd2"); + test(e.pd1->pd1 == e.pd1); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "derived exception thrown as base exception (AMI)... " << flush; { - AMI_Test_throwDerivedAsBaseIPtr cb = new AMI_Test_throwDerivedAsBaseI; - test->throwDerivedAsBase_async(cb); - test(cb->check()); + AMI_Test_throwDerivedAsBaseIPtr cb = new AMI_Test_throwDerivedAsBaseI; + test->throwDerivedAsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "derived exception thrown as derived exception... " << flush; { - try - { - test->throwDerivedAsDerived(); - test(0); - } - catch(const DerivedException& e) - { - test(e.ice_name() == "Test::DerivedException"); - test(e.sbe == "sbe"); - test(e.pb); - test(e.pb->sb == "sb1"); - test(e.pb->pb == e.pb); - test(e.sde == "sde1"); - test(e.pd1); - test(e.pd1->sb == "sb2"); - test(e.pd1->pb == e.pd1); - test(e.pd1->sd1 == "sd2"); - test(e.pd1->pd1 == e.pd1); - } - catch(...) - { - test(0); - } + try + { + test->throwDerivedAsDerived(); + test(0); + } + catch(const DerivedException& e) + { + test(e.ice_name() == "Test::DerivedException"); + test(e.sbe == "sbe"); + test(e.pb); + test(e.pb->sb == "sb1"); + test(e.pb->pb == e.pb); + test(e.sde == "sde1"); + test(e.pd1); + test(e.pd1->sb == "sb2"); + test(e.pd1->pb == e.pd1); + test(e.pd1->sd1 == "sd2"); + test(e.pd1->pd1 == e.pd1); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "derived exception thrown as derived exception (AMI)... " << flush; { - AMI_Test_throwDerivedAsDerivedIPtr cb = new AMI_Test_throwDerivedAsDerivedI; - test->throwDerivedAsDerived_async(cb); - test(cb->check()); + AMI_Test_throwDerivedAsDerivedIPtr cb = new AMI_Test_throwDerivedAsDerivedI; + test->throwDerivedAsDerived_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "unknown derived exception thrown as base exception... " << flush; { - try - { - test->throwUnknownDerivedAsBase(); - test(0); - } - catch(const BaseException& e) - { - test(e.ice_name() == "Test::BaseException"); - test(e.sbe == "sbe"); - test(e.pb); - test(e.pb->sb == "sb d2"); - test(e.pb->pb == e.pb); - } - catch(...) - { - test(0); - } + try + { + test->throwUnknownDerivedAsBase(); + test(0); + } + catch(const BaseException& e) + { + test(e.ice_name() == "Test::BaseException"); + test(e.sbe == "sbe"); + test(e.pb); + test(e.pb->sb == "sb d2"); + test(e.pb->pb == e.pb); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "unknown derived exception thrown as base exception (AMI)... " << flush; { - AMI_Test_throwUnknownDerivedAsBaseIPtr cb = new AMI_Test_throwUnknownDerivedAsBaseI; - test->throwUnknownDerivedAsBase_async(cb); - test(cb->check()); + AMI_Test_throwUnknownDerivedAsBaseIPtr cb = new AMI_Test_throwUnknownDerivedAsBaseI; + test->throwUnknownDerivedAsBase_async(cb); + test(cb->check()); } cout << "ok" << endl; cout << "forward-declared class... " << flush; { - try - { - ForwardPtr f; - test->useForward(f); - test(f); - } - catch(...) - { - test(0); - } + try + { + ForwardPtr f; + test->useForward(f); + test(f); + } + catch(...) + { + test(0); + } } cout << "ok" << endl; cout << "forward-declared class (AMI)... " << flush; { - AMI_Test_useForwardIPtr cb = new AMI_Test_useForwardI; - test->useForward_async(cb); - test(cb->check()); + AMI_Test_useForwardIPtr cb = new AMI_Test_useForwardI; + test->useForward_async(cb); + test(cb->check()); } cout << "ok" << endl; diff --git a/cpp/test/Ice/slicing/objects/Client.cpp b/cpp/test/Ice/slicing/objects/Client.cpp index 94509fc0099..f3ca8da558d 100644 --- a/cpp/test/Ice/slicing/objects/Client.cpp +++ b/cpp/test/Ice/slicing/objects/Client.cpp @@ -31,26 +31,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/slicing/objects/Server.cpp b/cpp/test/Ice/slicing/objects/Server.cpp index 9a7ad52c084..697d3b3cbfa 100644 --- a/cpp/test/Ice/slicing/objects/Server.cpp +++ b/cpp/test/Ice/slicing/objects/Server.cpp @@ -34,26 +34,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/slicing/objects/ServerAMD.cpp b/cpp/test/Ice/slicing/objects/ServerAMD.cpp index f19fcbf7f44..16190251017 100644 --- a/cpp/test/Ice/slicing/objects/ServerAMD.cpp +++ b/cpp/test/Ice/slicing/objects/ServerAMD.cpp @@ -34,26 +34,26 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/slicing/objects/Test.ice b/cpp/test/Ice/slicing/objects/Test.ice index 9d31ce660b5..01e91579311 100644 --- a/cpp/test/Ice/slicing/objects/Test.ice +++ b/cpp/test/Ice/slicing/objects/Test.ice @@ -67,7 +67,7 @@ exception DerivedException extends BaseException D1 pd1; }; -class Forward; // Forward-declared class defined in another compilation unit +class Forward; // Forward-declared class defined in another compilation unit ["ami"] interface TestIntf { @@ -104,7 +104,7 @@ class Forward; // Forward-declared class defined in another compilation unit void throwDerivedAsDerived() throws DerivedException; void throwUnknownDerivedAsBase() throws BaseException; - void useForward(out Forward f); // Use of forward-declared class to verify that code is generated correctly. + void useForward(out Forward f); // Use of forward-declared class to verify that code is generated correctly. void shutdown(); }; diff --git a/cpp/test/Ice/slicing/objects/TestAMD.ice b/cpp/test/Ice/slicing/objects/TestAMD.ice index 9303d9e8325..1fe41bec3f5 100644 --- a/cpp/test/Ice/slicing/objects/TestAMD.ice +++ b/cpp/test/Ice/slicing/objects/TestAMD.ice @@ -67,7 +67,7 @@ exception DerivedException extends BaseException D1 pd1; }; -class Forward; // Forward-declared class defined in another compilation unit +class Forward; // Forward-declared class defined in another compilation unit ["ami", "amd"] interface TestIntf { @@ -104,7 +104,7 @@ class Forward; // Forward-declared class defined in another compilation unit void throwDerivedAsDerived() throws DerivedException; void throwUnknownDerivedAsBase() throws BaseException; - void useForward(out Forward f); // Use of forward-declared class to verify that code is generated correctly. + void useForward(out Forward f); // Use of forward-declared class to verify that code is generated correctly. void shutdown(); }; diff --git a/cpp/test/Ice/slicing/objects/TestAMDI.cpp b/cpp/test/Ice/slicing/objects/TestAMDI.cpp index b8ca525e84c..ec4dfa48769 100644 --- a/cpp/test/Ice/slicing/objects/TestAMDI.cpp +++ b/cpp/test/Ice/slicing/objects/TestAMDI.cpp @@ -45,7 +45,7 @@ TestI::SBSKnownDerivedAsSBase_async(const AMD_TestIntf_SBSKnownDerivedAsSBasePtr void TestI::SBSKnownDerivedAsSBSKnownDerived_async(const AMD_TestIntf_SBSKnownDerivedAsSBSKnownDerivedPtr& cb, - const ::Ice::Current&) + const ::Ice::Current&) { SBSKnownDerivedPtr sbskd = new SBSKnownDerived; sbskd->sb = "SBSKnownDerived.sb"; @@ -254,7 +254,7 @@ TestI::returnTest3_async(const AMD_TestIntf_returnTest3Ptr& cb, const BPtr& p1, void TestI::sequenceTest_async(const AMD_TestIntf_sequenceTestPtr& cb, - const SS1Ptr& p1, const SS2Ptr& p2, const ::Ice::Current&) + const SS1Ptr& p1, const SS2Ptr& p2, const ::Ice::Current&) { SS ss; ss.c1 = p1; @@ -269,25 +269,25 @@ TestI::dictionaryTest_async(const AMD_TestIntf_dictionaryTestPtr& cb, const BDic int i; for(i = 0; i < 10; ++i) { - BPtr b = bin.find(i)->second; - D2Ptr d2 = new D2; - d2->sb = b->sb; - d2->pb = b->pb; - d2->sd2 = "D2"; - d2->pd2 = d2; - bout[i * 10] = d2; + BPtr b = bin.find(i)->second; + D2Ptr d2 = new D2; + d2->sb = b->sb; + d2->pb = b->pb; + d2->sd2 = "D2"; + d2->pd2 = d2; + bout[i * 10] = d2; } BDict r; for(i = 0; i < 10; ++i) { - std::ostringstream s; - s << "D1." << i * 20; - D1Ptr d1 = new D1; - d1->sb = s.str(); - d1->pb = (i == 0 ? BPtr(0) : r.find((i - 1) * 20)->second); - d1->sd1 = s.str(); - d1->pd1 = d1; - r[i * 20] = d1; + std::ostringstream s; + s << "D1." << i * 20; + D1Ptr d1 = new D1; + d1->sb = s.str(); + d1->pb = (i == 0 ? BPtr(0) : r.find((i - 1) * 20)->second); + d1->sd1 = s.str(); + d1->pd1 = d1; + r[i * 20] = d1; } cb->ice_response(r, bout); } diff --git a/cpp/test/Ice/slicing/objects/TestAMDI.h b/cpp/test/Ice/slicing/objects/TestAMDI.h index edb10690fce..81224a27376 100644 --- a/cpp/test/Ice/slicing/objects/TestAMDI.h +++ b/cpp/test/Ice/slicing/objects/TestAMDI.h @@ -22,12 +22,12 @@ public: virtual void SBaseAsObject_async(const ::Test::AMD_TestIntf_SBaseAsObjectPtr&, const ::Ice::Current&); virtual void SBaseAsSBase_async(const ::Test::AMD_TestIntf_SBaseAsSBasePtr&, const ::Ice::Current&); virtual void SBSKnownDerivedAsSBase_async(const ::Test::AMD_TestIntf_SBSKnownDerivedAsSBasePtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void SBSKnownDerivedAsSBSKnownDerived_async(const ::Test::AMD_TestIntf_SBSKnownDerivedAsSBSKnownDerivedPtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void SBSUnknownDerivedAsSBase_async(const ::Test::AMD_TestIntf_SBSUnknownDerivedAsSBasePtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void SUnknownAsObject_async(const ::Test::AMD_TestIntf_SUnknownAsObjectPtr&, const ::Ice::Current&); @@ -46,20 +46,20 @@ public: virtual void returnTest1_async(const ::Test::AMD_TestIntf_returnTest1Ptr&, const ::Ice::Current&); virtual void returnTest2_async(const ::Test::AMD_TestIntf_returnTest2Ptr&, const ::Ice::Current&); virtual void returnTest3_async(const ::Test::AMD_TestIntf_returnTest3Ptr&, const ::Test::BPtr&, const ::Test::BPtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void sequenceTest_async(const ::Test::AMD_TestIntf_sequenceTestPtr&, - const ::Test::SS1Ptr&, const ::Test::SS2Ptr&, const ::Ice::Current&); + const ::Test::SS1Ptr&, const ::Test::SS2Ptr&, const ::Ice::Current&); virtual void dictionaryTest_async(const ::Test::AMD_TestIntf_dictionaryTestPtr&, - const ::Test::BDict&, const ::Ice::Current&); + const ::Test::BDict&, const ::Ice::Current&); virtual void throwBaseAsBase_async(const ::Test::AMD_TestIntf_throwBaseAsBasePtr&, const ::Ice::Current&); virtual void throwDerivedAsBase_async(const ::Test::AMD_TestIntf_throwDerivedAsBasePtr&, const ::Ice::Current&); virtual void throwDerivedAsDerived_async(const ::Test::AMD_TestIntf_throwDerivedAsDerivedPtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void throwUnknownDerivedAsBase_async(const ::Test::AMD_TestIntf_throwUnknownDerivedAsBasePtr&, - const ::Ice::Current&); + const ::Ice::Current&); virtual void useForward_async(const ::Test::AMD_TestIntf_useForwardPtr&, const ::Ice::Current&); diff --git a/cpp/test/Ice/slicing/objects/TestI.cpp b/cpp/test/Ice/slicing/objects/TestI.cpp index 660ba0b86dc..bf33febf78d 100644 --- a/cpp/test/Ice/slicing/objects/TestI.cpp +++ b/cpp/test/Ice/slicing/objects/TestI.cpp @@ -245,25 +245,25 @@ TestI::dictionaryTest(const BDict& bin, BDict& bout, const ::Ice::Current&) int i; for(i = 0; i < 10; ++i) { - BPtr b = bin.find(i)->second; - D2Ptr d2 = new D2; - d2->sb = b->sb; - d2->pb = b->pb; - d2->sd2 = "D2"; - d2->pd2 = d2; - bout[i * 10] = d2; + BPtr b = bin.find(i)->second; + D2Ptr d2 = new D2; + d2->sb = b->sb; + d2->pb = b->pb; + d2->sd2 = "D2"; + d2->pd2 = d2; + bout[i * 10] = d2; } BDict r; for(i = 0; i < 10; ++i) { - std::ostringstream s; - s << "D1." << i * 20; - D1Ptr d1 = new D1; - d1->sb = s.str(); - d1->pb = (i == 0 ? BPtr(0) : r.find((i - 1) * 20)->second); - d1->sd1 = s.str(); - d1->pd1 = d1; - r[i * 20] = d1; + std::ostringstream s; + s << "D1." << i * 20; + D1Ptr d1 = new D1; + d1->sb = s.str(); + d1->pb = (i == 0 ? BPtr(0) : r.find((i - 1) * 20)->second); + d1->sd1 = s.str(); + d1->pd1 = d1; + r[i * 20] = d1; } return r; } diff --git a/cpp/test/Ice/stream/Client.cpp b/cpp/test/Ice/stream/Client.cpp index 6861067f468..efa8f77f459 100644 --- a/cpp/test/Ice/stream/Client.cpp +++ b/cpp/test/Ice/stream/Client.cpp @@ -99,7 +99,7 @@ public: virtual Ice::ObjectPtr create(const string& type) { - return _factory->create(type); + return _factory->create(type); } virtual void @@ -110,7 +110,7 @@ public: void setFactory(const Ice::ObjectFactoryPtr& factory) { - _factory = factory; + _factory = factory; } private: diff --git a/cpp/test/Ice/timeout/AllTests.cpp b/cpp/test/Ice/timeout/AllTests.cpp index 71af9e97b60..694604304f9 100644 --- a/cpp/test/Ice/timeout/AllTests.cpp +++ b/cpp/test/Ice/timeout/AllTests.cpp @@ -19,7 +19,7 @@ class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> public: CallbackBase() : - _called(false) + _called(false) { } @@ -29,26 +29,26 @@ public: bool check() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - while(!_called) - { - if(!timedWait(IceUtil::Time::seconds(5))) - { - return false; - } - } - _called = false; - return true; + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + while(!_called) + { + if(!timedWait(IceUtil::Time::seconds(5))) + { + return false; + } + } + _called = false; + return true; } protected: void called() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - assert(!_called); - _called = true; - notify(); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + assert(!_called); + _called = true; + notify(); } private: @@ -62,12 +62,12 @@ public: virtual void ice_response() { - called(); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; typedef IceUtil::Handle<AMISendData> AMISendDataPtr; @@ -78,13 +78,13 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(dynamic_cast<const Ice::TimeoutException*>(&ex)); - called(); + test(dynamic_cast<const Ice::TimeoutException*>(&ex)); + called(); } }; typedef IceUtil::Handle<AMISendDataEx> AMISendDataExPtr; @@ -95,12 +95,12 @@ public: virtual void ice_response() { - called(); + called(); } virtual void ice_exception(const ::Ice::Exception&) { - test(false); + test(false); } }; typedef IceUtil::Handle<AMISleep> AMISleepPtr; @@ -111,13 +111,13 @@ public: virtual void ice_response() { - test(false); + test(false); } virtual void ice_exception(const ::Ice::Exception& ex) { - test(dynamic_cast<const Ice::TimeoutException*>(&ex)); - called(); + test(dynamic_cast<const Ice::TimeoutException*>(&ex)); + called(); } }; typedef IceUtil::Handle<AMISleepEx> AMISleepExPtr; @@ -134,249 +134,249 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing connect timeout... " << flush; { - // - // Expect ConnectTimeoutException. - // - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); - to->holdAdapter(750); - to->ice_getConnection()->close(true); // Force a reconnect. - try - { - to->op(); - test(false); - } - catch(const Ice::ConnectTimeoutException&) - { - // Expected. - } + // + // Expect ConnectTimeoutException. + // + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); + to->holdAdapter(750); + to->ice_getConnection()->close(true); // Force a reconnect. + try + { + to->op(); + test(false); + } + catch(const Ice::ConnectTimeoutException&) + { + // Expected. + } } { - // - // Expect success. - // - timeout->op(); // Ensure adapter is active. - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); - to->holdAdapter(500); - to->ice_getConnection()->close(true); // Force a reconnect. - try - { - to->op(); - } - catch(const Ice::ConnectTimeoutException&) - { - test(false); - } + // + // Expect success. + // + timeout->op(); // Ensure adapter is active. + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); + to->holdAdapter(500); + to->ice_getConnection()->close(true); // Force a reconnect. + try + { + to->op(); + } + catch(const Ice::ConnectTimeoutException&) + { + test(false); + } } cout << "ok" << endl; cout << "testing read timeout... " << flush; { - // - // Expect TimeoutException. - // - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); - try - { - to->sleep(750); - test(false); - } - catch(const Ice::TimeoutException&) - { - // Expected. - } + // + // Expect TimeoutException. + // + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); + try + { + to->sleep(750); + test(false); + } + catch(const Ice::TimeoutException&) + { + // Expected. + } } { - // - // Expect success. - // - timeout->op(); // Ensure adapter is active. - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); - try - { - to->sleep(500); - } - catch(const Ice::TimeoutException&) - { - test(false); - } + // + // Expect success. + // + timeout->op(); // Ensure adapter is active. + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); + try + { + to->sleep(500); + } + catch(const Ice::TimeoutException&) + { + test(false); + } } cout << "ok" << endl; cout << "testing write timeout... " << flush; { - // - // Expect TimeoutException. - // - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); - to->holdAdapter(750); - try - { - ByteSeq seq(100000); - to->sendData(seq); - test(false); - } - catch(const Ice::TimeoutException&) - { - // Expected. - } + // + // Expect TimeoutException. + // + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); + to->holdAdapter(750); + try + { + ByteSeq seq(100000); + to->sendData(seq); + test(false); + } + catch(const Ice::TimeoutException&) + { + // Expected. + } } { - // - // Expect success. - // - timeout->op(); // Ensure adapter is active. - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); - to->holdAdapter(500); - try - { - ByteSeq seq(100000); - to->sendData(seq); - } - catch(const Ice::TimeoutException&) - { - test(false); - } + // + // Expect success. + // + timeout->op(); // Ensure adapter is active. + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); + to->holdAdapter(500); + try + { + ByteSeq seq(100000); + to->sendData(seq); + } + catch(const Ice::TimeoutException&) + { + test(false); + } } cout << "ok" << endl; cout << "testing AMI read timeout... " << flush; { - // - // The resolution of AMI timeouts is limited by the connection monitor - // thread. We set Ice.MonitorConnections=1 (one second) in main(). - // - // Expect TimeoutException. - // - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); - AMISleepExPtr cb = new AMISleepEx; - to->sleep_async(cb, 2000); - test(cb->check()); + // + // The resolution of AMI timeouts is limited by the connection monitor + // thread. We set Ice.MonitorConnections=1 (one second) in main(). + // + // Expect TimeoutException. + // + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); + AMISleepExPtr cb = new AMISleepEx; + to->sleep_async(cb, 2000); + test(cb->check()); } { - // - // Expect success. - // - timeout->op(); // Ensure adapter is active. - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); - AMISleepPtr cb = new AMISleep; - to->sleep_async(cb, 500); - test(cb->check()); + // + // Expect success. + // + timeout->op(); // Ensure adapter is active. + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); + AMISleepPtr cb = new AMISleep; + to->sleep_async(cb, 500); + test(cb->check()); } cout << "ok" << endl; cout << "testing AMI write timeout... " << flush; { - // - // The resolution of AMI timeouts is limited by the connection monitor - // thread. We set Ice.MonitorConnections=1 (one second) in main(). - // - // Expect TimeoutException. - // - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); - to->holdAdapter(2000); - ByteSeq seq(100000); - AMISendDataExPtr cb = new AMISendDataEx; - to->sendData_async(cb, seq); - test(cb->check()); + // + // The resolution of AMI timeouts is limited by the connection monitor + // thread. We set Ice.MonitorConnections=1 (one second) in main(). + // + // Expect TimeoutException. + // + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(500)); + to->holdAdapter(2000); + ByteSeq seq(100000); + AMISendDataExPtr cb = new AMISendDataEx; + to->sendData_async(cb, seq); + test(cb->check()); } { - // - // Expect success. - // - timeout->op(); // Ensure adapter is active. - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); - to->holdAdapter(500); - ByteSeq seq(100000); - AMISendDataPtr cb = new AMISendData; - to->sendData_async(cb, seq); - test(cb->check()); + // + // Expect success. + // + timeout->op(); // Ensure adapter is active. + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); + to->holdAdapter(500); + ByteSeq seq(100000); + AMISendDataPtr cb = new AMISendData; + to->sendData_async(cb, seq); + test(cb->check()); } cout << "ok" << endl; cout << "testing timeout overrides... " << flush; { - // - // Test Ice.Override.Timeout. This property overrides all - // endpoint timeouts. - // - Ice::InitializationData initData; - initData.properties = communicator->getProperties()->clone(); - initData.properties->setProperty("Ice.Override.Timeout", "500"); - Ice::CommunicatorPtr comm = Ice::initialize(initData); - TimeoutPrx to = TimeoutPrx::checkedCast(comm->stringToProxy(sref)); - try - { - to->sleep(750); - test(false); - } - catch(const Ice::TimeoutException&) - { - // Expected. - } - // - // Calling ice_timeout() should have no effect. - // - timeout->op(); // Ensure adapter is active. - to = TimeoutPrx::checkedCast(to->ice_timeout(1000)); - try - { - to->sleep(750); - test(false); - } - catch(const Ice::TimeoutException&) - { - // Expected. - } - comm->destroy(); + // + // Test Ice.Override.Timeout. This property overrides all + // endpoint timeouts. + // + Ice::InitializationData initData; + initData.properties = communicator->getProperties()->clone(); + initData.properties->setProperty("Ice.Override.Timeout", "500"); + Ice::CommunicatorPtr comm = Ice::initialize(initData); + TimeoutPrx to = TimeoutPrx::checkedCast(comm->stringToProxy(sref)); + try + { + to->sleep(750); + test(false); + } + catch(const Ice::TimeoutException&) + { + // Expected. + } + // + // Calling ice_timeout() should have no effect. + // + timeout->op(); // Ensure adapter is active. + to = TimeoutPrx::checkedCast(to->ice_timeout(1000)); + try + { + to->sleep(750); + test(false); + } + catch(const Ice::TimeoutException&) + { + // Expected. + } + comm->destroy(); } { - // - // Test Ice.Override.ConnectTimeout. - // - Ice::InitializationData initData; - initData.properties = communicator->getProperties()->clone(); - initData.properties->setProperty("Ice.Override.ConnectTimeout", "750"); - Ice::CommunicatorPtr comm = Ice::initialize(initData); - timeout->holdAdapter(1000); - TimeoutPrx to = TimeoutPrx::uncheckedCast(comm->stringToProxy(sref)); - try - { - to->op(); - test(false); - } - catch(const Ice::ConnectTimeoutException&) - { - // Expected. - } - // - // Calling ice_timeout() should have no effect on the connect timeout. - // - timeout->op(); // Ensure adapter is active. - timeout->holdAdapter(1000); - to = TimeoutPrx::uncheckedCast(to->ice_timeout(1250)); - try - { - to->op(); - test(false); - } - catch(const Ice::ConnectTimeoutException&) - { - // Expected. - } - // - // Verify that timeout set via ice_timeout() is still used for requests. - // - to->op(); // Force connection. - try - { - to->sleep(1500); - test(false); - } - catch(const Ice::TimeoutException&) - { - // Expected. - } - comm->destroy(); + // + // Test Ice.Override.ConnectTimeout. + // + Ice::InitializationData initData; + initData.properties = communicator->getProperties()->clone(); + initData.properties->setProperty("Ice.Override.ConnectTimeout", "750"); + Ice::CommunicatorPtr comm = Ice::initialize(initData); + timeout->holdAdapter(1000); + TimeoutPrx to = TimeoutPrx::uncheckedCast(comm->stringToProxy(sref)); + try + { + to->op(); + test(false); + } + catch(const Ice::ConnectTimeoutException&) + { + // Expected. + } + // + // Calling ice_timeout() should have no effect on the connect timeout. + // + timeout->op(); // Ensure adapter is active. + timeout->holdAdapter(1000); + to = TimeoutPrx::uncheckedCast(to->ice_timeout(1250)); + try + { + to->op(); + test(false); + } + catch(const Ice::ConnectTimeoutException&) + { + // Expected. + } + // + // Verify that timeout set via ice_timeout() is still used for requests. + // + to->op(); // Force connection. + try + { + to->sleep(1500); + test(false); + } + catch(const Ice::TimeoutException&) + { + // Expected. + } + comm->destroy(); } cout << "ok" << endl; diff --git a/cpp/test/Ice/timeout/Client.cpp b/cpp/test/Ice/timeout/Client.cpp index fef4d9c797e..b3c9c744c72 100644 --- a/cpp/test/Ice/timeout/Client.cpp +++ b/cpp/test/Ice/timeout/Client.cpp @@ -31,44 +31,44 @@ main(int argc, char* argv[]) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); - // - // For this test, we want to disable retries. - // - initData.properties->setProperty("Ice.RetryIntervals", "-1"); + // + // For this test, we want to disable retries. + // + initData.properties->setProperty("Ice.RetryIntervals", "-1"); - // - // This test kills connections, so we don't want warnings. - // - initData.properties->setProperty("Ice.Warn.Connections", "0"); + // + // This test kills connections, so we don't want warnings. + // + initData.properties->setProperty("Ice.Warn.Connections", "0"); - // - // Check for AMI timeouts every second. - // - initData.properties->setProperty("Ice.MonitorConnections", "1"); + // + // Check for AMI timeouts every second. + // + initData.properties->setProperty("Ice.MonitorConnections", "1"); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { cerr << ex << endl; - status = EXIT_FAILURE; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/timeout/Server.cpp b/cpp/test/Ice/timeout/Server.cpp index bed1e7aeeaf..cd1d2159c86 100644 --- a/cpp/test/Ice/timeout/Server.cpp +++ b/cpp/test/Ice/timeout/Server.cpp @@ -32,34 +32,34 @@ main(int argc, char* argv[]) try { - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); - // - // This test kills connections, so we don't want warnings. - // - initData.properties->setProperty("Ice.Warn.Connections", "0"); + // + // This test kills connections, so we don't want warnings. + // + initData.properties->setProperty("Ice.Warn.Connections", "0"); - communicator = Ice::initialize(argc, argv, initData); - status = run(argc, argv, communicator); + communicator = Ice::initialize(argc, argv, initData); + status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) { - cerr << ex << endl; - status = EXIT_FAILURE; + cerr << ex << endl; + status = EXIT_FAILURE; } if(communicator) { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } } return status; diff --git a/cpp/test/Ice/timeout/TestI.cpp b/cpp/test/Ice/timeout/TestI.cpp index 23356bfb4a8..b69ac089a70 100644 --- a/cpp/test/Ice/timeout/TestI.cpp +++ b/cpp/test/Ice/timeout/TestI.cpp @@ -19,15 +19,15 @@ class ActivateAdapterThread : public IceUtil::Thread public: ActivateAdapterThread(const ObjectAdapterPtr& adapter, int timeout) : - _adapter(adapter), _timeout(timeout) + _adapter(adapter), _timeout(timeout) { } virtual void run() { - IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(_timeout)); - _adapter->activate(); + IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(_timeout)); + _adapter->activate(); } private: |