diff options
Diffstat (limited to 'cpp/test')
64 files changed, 734 insertions, 712 deletions
diff --git a/cpp/test/Ice/acm/AllTests.cpp b/cpp/test/Ice/acm/AllTests.cpp index cbe654b2d4c..6df4319364c 100644 --- a/cpp/test/Ice/acm/AllTests.cpp +++ b/cpp/test/Ice/acm/AllTests.cpp @@ -130,7 +130,7 @@ class TestCase : public: TestCase(const string& name, const RemoteCommunicatorPrxPtr& com) : - _name(name), _com(com), _logger(new LoggerI()), + _testCaseName(name), _com(com), _logger(new LoggerI()), _clientACMTimeout(-1), _clientACMClose(-1), _clientACMHeartbeat(-1), _serverACMTimeout(-1), _serverACMClose(-1), _serverACMHeartbeat(-1), _heartbeat(0), _closed(false) @@ -176,7 +176,7 @@ public: void join() #endif { - cout << "testing " << _name << "... " << flush; + cout << "testing " << _testCaseName << "... " << flush; _logger->start(); #ifdef ICE_CPP11_MAPPING t.join(); @@ -279,7 +279,7 @@ public: protected: - const string _name; + const string _testCaseName; const RemoteCommunicatorPrxPtr _com; string _msg; LoggerIPtr _logger; @@ -309,7 +309,7 @@ public: setServerACM(1, -1, -1); // Faster ACM to make sure we receive enough ACM heartbeats } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr&, const TestIntfPrxPtr& proxy) { proxy->sleep(4); @@ -358,7 +358,7 @@ public: setServerACM(2, 2, 0); // Disable heartbeat on invocations } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr&, const TestIntfPrxPtr& proxy) { try { @@ -391,7 +391,7 @@ public: setServerACM(1, 2, 0); // Disable heartbeat on invocations } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr&, const TestIntfPrxPtr& proxy) { // No close on invocation, the call should succeed this time. proxy->sleep(3); @@ -411,7 +411,7 @@ public: setClientACM(1, 1, 0); // Only close on idle } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr&, const TestIntfPrxPtr&) { IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(3000)); // Idle for 3 seconds @@ -431,7 +431,7 @@ public: setClientACM(1, 2, 0); // Only close on invocation } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr&, const TestIntfPrxPtr&) { IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(3000)); // Idle for 3 seconds @@ -450,7 +450,7 @@ public: setClientACM(1, 3, 0); // Only close on idle and invocation } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr&) { // // Put the adapter on hold. The server will not respond to @@ -483,7 +483,7 @@ public: setClientACM(1, 4, 0); // Only close on idle and invocation } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr&) { adapter->hold(); IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(3000)); // Idle for 3 seconds @@ -504,7 +504,7 @@ public: setServerACM(1, -1, 2); // Enable server heartbeats. } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr&, const TestIntfPrxPtr&) { IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(3000)); @@ -522,7 +522,7 @@ public: setServerACM(1, -1, 3); // Enable server heartbeats. } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr&, const TestIntfPrxPtr& proxy) { for(int i = 0; i < 10; ++i) { @@ -548,7 +548,7 @@ public: setServerACM(10, -1, 0); } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr&, const TestIntfPrxPtr& proxy) { proxy->startHeartbeatCount(); Ice::ConnectionPtr con = proxy->ice_getConnection(); @@ -614,7 +614,7 @@ public: setClientACM(15, 4, 0); } - virtual void runTestCase(const RemoteObjectAdapterPrxPtr& adapter, const TestIntfPrxPtr& proxy) + virtual void runTestCase(const RemoteObjectAdapterPrxPtr&, const TestIntfPrxPtr& proxy) { Ice::ConnectionPtr con = proxy->ice_getConnection(); diff --git a/cpp/test/Ice/acm/TestI.cpp b/cpp/test/Ice/acm/TestI.cpp index cbbada92dfb..82a6b9eadfb 100644 --- a/cpp/test/Ice/acm/TestI.cpp +++ b/cpp/test/Ice/acm/TestI.cpp @@ -105,7 +105,7 @@ RemoteObjectAdapterI::deactivate(const Ice::Current&) } void -TestI::sleep(int delay, const Ice::Current& current) +TestI::sleep(int delay, const Ice::Current&) { Lock sync(*this); timedWait(IceUtil::Time::seconds(delay)); @@ -120,7 +120,7 @@ TestI::sleepAndHold(int delay, const Ice::Current& current) } void -TestI::interruptSleep(const Ice::Current& current) +TestI::interruptSleep(const Ice::Current&) { Lock sync(*this); notifyAll(); diff --git a/cpp/test/Ice/ami/AllTests.cpp b/cpp/test/Ice/ami/AllTests.cpp index c60ca2f6d67..f1de69154ef 100644 --- a/cpp/test/Ice/ami/AllTests.cpp +++ b/cpp/test/Ice/ami/AllTests.cpp @@ -62,7 +62,7 @@ struct Cookie : public Ice::LocalObject }; typedef IceUtil::Handle<Cookie> CookiePtr; -class CallbackBase : public Ice::LocalObject +class CallbackBase : public virtual Ice::LocalObject { public: @@ -781,7 +781,7 @@ public: { } - virtual void closed(const Ice::ConnectionPtr& con) + virtual void closed(const Ice::ConnectionPtr&) { called(); } @@ -906,16 +906,16 @@ allTests(Test::TestHelper* helper, bool collocated) #ifdef ICE_CPP11_MAPPING string sref = "test:" + helper->getTestEndpoint(); - auto obj = communicator->stringToProxy(sref); - test(obj); + auto prx = communicator->stringToProxy(sref); + test(prx); - auto p = Ice::uncheckedCast<Test::TestIntfPrx>(obj); + auto p = Ice::uncheckedCast<Test::TestIntfPrx>(prx); sref = "testController:" + helper->getTestEndpoint(1); - obj = communicator->stringToProxy(sref); - test(obj); + prx = communicator->stringToProxy(sref); + test(prx); - auto testController = Ice::uncheckedCast<Test::TestIntfControllerPrx>(obj); + auto testController = Ice::uncheckedCast<Test::TestIntfControllerPrx>(prx); Ice::Context ctx; cout << "testing lambda API... " << flush; @@ -1796,7 +1796,7 @@ allTests(Test::TestHelper* helper, bool collocated) promise.set_value(); thrower(throwEx[i]); }, - [&](const exception_ptr& ex) + [&](const exception_ptr&) { test(false); }); @@ -2190,7 +2190,7 @@ allTests(Test::TestHelper* helper, bool collocated) auto con = p->ice_getConnection(); auto sc = make_shared<promise<void>>(); con->setCloseCallback( - [sc](Ice::ConnectionPtr connection) + [sc](Ice::ConnectionPtr) { sc->set_value(); }); @@ -2245,13 +2245,13 @@ allTests(Test::TestHelper* helper, bool collocated) for(int i = 0; i < maxQueue; i++) { auto s = make_shared<promise<void>>(); - atomic_flag sent = ATOMIC_FLAG_INIT; + atomic_flag sent2 = ATOMIC_FLAG_INIT; p->opWithPayloadAsync(seq, [s]() { s->set_value(); }, [s](exception_ptr ex) { s->set_exception(ex); }, - [&sent](bool) { sent.test_and_set(); }); + [&sent2](bool) { sent2.test_and_set(); }); results.push_back(s->get_future()); - if(sent.test_and_set()) + if(sent2.test_and_set()) { done = false; maxQueue *= 2; @@ -2265,11 +2265,11 @@ allTests(Test::TestHelper* helper, bool collocated) done = false; } - for(vector<future<void>>::iterator p = results.begin(); p != results.end(); ++p) + for(vector<future<void>>::iterator r = results.begin(); r != results.end(); ++r) { try { - p->get(); + r->get(); } catch(const Ice::LocalException&) { @@ -2293,7 +2293,7 @@ allTests(Test::TestHelper* helper, bool collocated) auto sent = make_shared<promise<void>>(); p->startDispatchAsync([s]() { s->set_value(); }, [s](exception_ptr ex) { s->set_exception(ex); }, - [sent](bool ss) { sent->set_value(); }); + [sent](bool) { sent->set_value(); }); auto f = s->get_future(); sent->get_future().get(); // Ensure the request was sent before we close the connection. con->close(Ice::ConnectionClose::Gracefully); @@ -2315,7 +2315,7 @@ allTests(Test::TestHelper* helper, bool collocated) con = p->ice_getConnection(); auto sc = make_shared<promise<void>>(); con->setCloseCallback( - [sc](Ice::ConnectionPtr connection) + [sc](Ice::ConnectionPtr) { sc->set_value(); }); @@ -2350,7 +2350,7 @@ allTests(Test::TestHelper* helper, bool collocated) auto sent = make_shared<promise<void>>(); p->startDispatchAsync([s]() { s->set_value(); }, [s](exception_ptr ex) { s->set_exception(ex); }, - [sent](bool ss) { sent->set_value(); }); + [sent](bool) { sent->set_value(); }); auto f = s->get_future(); sent->get_future().get(); // Ensure the request was sent before we close the connection. con->close(Ice::ConnectionClose::Forcefully); @@ -2702,7 +2702,7 @@ allTests(Test::TestHelper* helper, bool collocated) Ice::InitializationData initData; initData.properties = communicator->getProperties()->clone(); Ice::CommunicatorPtr ic = Ice::initialize(initData); - Ice::ObjectPrx obj = ic->stringToProxy(p->ice_toString()); + obj = ic->stringToProxy(p->ice_toString()); Test::TestIntfPrx p2 = Test::TestIntfPrx::checkedCast(obj); ic->destroy(); @@ -3982,12 +3982,12 @@ allTests(Test::TestHelper* helper, bool collocated) done = false; } - for(vector<Ice::AsyncResultPtr>::const_iterator p = results.begin(); p != results.end(); ++p) + for(vector<Ice::AsyncResultPtr>::const_iterator r = results.begin(); r != results.end(); ++r) { - (*p)->waitForCompleted(); + (*r)->waitForCompleted(); try { - (*p)->throwLocalException(); + (*r)->throwLocalException(); } catch(const Ice::LocalException&) { diff --git a/cpp/test/Ice/ami/TestI.cpp b/cpp/test/Ice/ami/TestI.cpp index 2893a408cd0..0e3f5f9bed6 100644 --- a/cpp/test/Ice/ami/TestI.cpp +++ b/cpp/test/Ice/ami/TestI.cpp @@ -99,7 +99,7 @@ TestIntfI::close(Test::CloseMode mode, const Ice::Current& current) } void -TestIntfI::sleep(Ice::Int ms, const Ice::Current& current) +TestIntfI::sleep(Ice::Int ms, const Ice::Current&) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); timedWait(IceUtil::Time::milliSeconds(ms)); @@ -107,7 +107,7 @@ TestIntfI::sleep(Ice::Int ms, const Ice::Current& current) #ifdef ICE_CPP11_MAPPING void -TestIntfI::startDispatchAsync(std::function<void()> response, std::function<void(std::exception_ptr)> ex, +TestIntfI::startDispatchAsync(std::function<void()> response, std::function<void(std::exception_ptr)>, const Ice::Current&) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); @@ -143,7 +143,7 @@ TestIntfI::startDispatch_async(const Test::AMD_TestIntf_startDispatchPtr& cb, co #endif void -TestIntfI::finishDispatch(const Ice::Current& current) +TestIntfI::finishDispatch(const Ice::Current&) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); if(_shutdown) diff --git a/cpp/test/Ice/background/AllTests.cpp b/cpp/test/Ice/background/AllTests.cpp index 61cb5b11afe..de2d989f7ed 100644 --- a/cpp/test/Ice/background/AllTests.cpp +++ b/cpp/test/Ice/background/AllTests.cpp @@ -456,8 +456,7 @@ connectTests(const ConfigurationPtr& configuration, const Test::BackgroundPrxPtr } background->ice_getConnection()->close(Ice::ICE_SCOPED_ENUM(ConnectionClose, GracefullyWithWait)); - int i; - for(i = 0; i < 4; ++i) + for(int i = 0; i < 4; ++i) { if(i == 0 || i == 2) { @@ -550,7 +549,7 @@ connectTests(const ConfigurationPtr& configuration, const Test::BackgroundPrxPtr OpThreadPtr thread1 = new OpThread(background); OpThreadPtr thread2 = new OpThread(background); - for(i = 0; i < 5; i++) + for(int i = 0; i < 5; i++) { try { @@ -598,8 +597,7 @@ initializeTests(const ConfigurationPtr& configuration, } background->ice_getConnection()->close(Ice::ICE_SCOPED_ENUM(ConnectionClose, GracefullyWithWait)); - int i; - for(i = 0; i < 4; i++) + for(int i = 0; i < 4; i++) { if(i == 0 || i == 2) { @@ -760,7 +758,7 @@ initializeTests(const ConfigurationPtr& configuration, OpThreadPtr thread1 = new OpThread(background); OpThreadPtr thread2 = new OpThread(background); - for(i = 0; i < 5; i++) + for(int i = 0; i < 5; i++) { try { @@ -882,8 +880,7 @@ validationTests(const ConfigurationPtr& configuration, test(false); } - int i; - for(i = 0; i < 2; i++) + for(int i = 0; i < 2; i++) { configuration->readException(new Ice::SocketException(__FILE__, __LINE__)); BackgroundPrxPtr prx = i == 0 ? background : background->ice_oneway(); @@ -1228,8 +1225,7 @@ readWriteTests(const ConfigurationPtr& configuration, test(false); } - int i; - for(i = 0; i < 2; i++) + for(int i = 0; i < 2; i++) { BackgroundPrxPtr prx = i == 0 ? background : background->ice_oneway(); @@ -1308,28 +1304,30 @@ readWriteTests(const ConfigurationPtr& configuration, configuration->readReady(false); // Required in C# to make sure beginRead() doesn't throw too soon. configuration->readException(new Ice::SocketException(__FILE__, __LINE__)); #ifdef ICE_CPP11_MAPPING - promise<void> completed; - background->opAsync( - []() - { - test(false); - }, - [&completed](exception_ptr e) - { - try - { - rethrow_exception(e); - } - catch(const Ice::SocketException&) - { - completed.set_value(); - } - catch(...) + { + promise<void> completed; + background->opAsync( + []() { test(false); - } - }); - completed.get_future().get(); + }, + [&completed](exception_ptr e) + { + try + { + rethrow_exception(e); + } + catch(const Ice::SocketException&) + { + completed.set_value(); + } + catch(...) + { + test(false); + } + }); + completed.get_future().get(); + } #else Ice::AsyncResultPtr r = background->begin_op(); try @@ -1390,7 +1388,7 @@ readWriteTests(const ConfigurationPtr& configuration, configuration->writeException(0); } - for(i = 0; i < 2; ++i) + for(int i = 0; i < 2; ++i) { BackgroundPrxPtr prx = i == 0 ? background : background->ice_oneway(); @@ -1427,7 +1425,7 @@ readWriteTests(const ConfigurationPtr& configuration, test(sent.get_future().wait_for(chrono::milliseconds(0)) != future_status::ready); completed.get_future().get(); #else - Ice::AsyncResultPtr r = prx->begin_op(); + r = prx->begin_op(); test(!r->sentSynchronously()); try { @@ -1486,7 +1484,7 @@ readWriteTests(const ConfigurationPtr& configuration, completed.get_future().get(); #else - Ice::AsyncResultPtr r = background->begin_op(); + r = background->begin_op(); try { background->end_op(r); @@ -1530,7 +1528,7 @@ readWriteTests(const ConfigurationPtr& configuration, }); completed.get_future().get(); #else - Ice::AsyncResultPtr r = background->begin_op(); + r = background->begin_op(); // The read exception might propagate before the message send is seen as completed on IOCP. # ifndef ICE_USE_IOCP r->waitForSent(); @@ -1591,7 +1589,7 @@ readWriteTests(const ConfigurationPtr& configuration, { c1.set_value(); }, - [](exception_ptr err) + [](exception_ptr) { test(false); }, @@ -1609,7 +1607,7 @@ readWriteTests(const ConfigurationPtr& configuration, { c2.set_value(); }, - [](exception_ptr err) + [](exception_ptr) { test(false); }, @@ -1775,7 +1773,7 @@ readWriteTests(const ConfigurationPtr& configuration, OpThreadPtr thread1 = new OpThread(background); OpThreadPtr thread2 = new OpThread(background); - for(i = 0; i < 5; i++) + for(int i = 0; i < 5; i++) { try { diff --git a/cpp/test/Ice/background/Transceiver.cpp b/cpp/test/Ice/background/Transceiver.cpp index f6b044b864f..13cfba89aea 100644 --- a/cpp/test/Ice/background/Transceiver.cpp +++ b/cpp/test/Ice/background/Transceiver.cpp @@ -24,8 +24,9 @@ Transceiver::getNativeInfo() IceInternal::SocketOperation Transceiver::initialize(IceInternal::Buffer& readBuffer, IceInternal::Buffer& writeBuffer) { + IceInternal::SocketOperation status = IceInternal::SocketOperationNone; #ifndef ICE_USE_IOCP - IceInternal::SocketOperation status = _configuration->initializeSocketOperation(); + status = _configuration->initializeSocketOperation(); if(status == IceInternal::SocketOperationConnect) { return status; @@ -52,7 +53,7 @@ Transceiver::initialize(IceInternal::Buffer& readBuffer, IceInternal::Buffer& wr _configuration->checkInitializeException(); if(!_initialized) { - IceInternal::SocketOperation status = _transceiver->initialize(readBuffer, writeBuffer); + status = _transceiver->initialize(readBuffer, writeBuffer); if(status != IceInternal::SocketOperationNone) { return status; diff --git a/cpp/test/Ice/binding/AllTests.cpp b/cpp/test/Ice/binding/AllTests.cpp index ca2a64f2c41..dd358dc6465 100644 --- a/cpp/test/Ice/binding/AllTests.cpp +++ b/cpp/test/Ice/binding/AllTests.cpp @@ -1009,10 +1009,10 @@ allTests(Test::TestHelper* helper) Ice::InitializationData clientInitData; clientInitData.properties = *q; Ice::CommunicatorHolder clientCommunicator(clientInitData); - Ice::ObjectPrxPtr prx = clientCommunicator->stringToProxy(strPrx); + Ice::ObjectPrxPtr clientPrx = clientCommunicator->stringToProxy(strPrx); try { - prx->ice_ping(); + clientPrx->ice_ping(); test(false); } catch(const Ice::ObjectNotExistException&) diff --git a/cpp/test/Ice/binding/TestI.cpp b/cpp/test/Ice/binding/TestI.cpp index ecadd92171b..2975993180b 100644 --- a/cpp/test/Ice/binding/TestI.cpp +++ b/cpp/test/Ice/binding/TestI.cpp @@ -91,7 +91,7 @@ RemoteObjectAdapterI::getTestIntf(const Ice::Current&) } void -RemoteObjectAdapterI::deactivate(const Ice::Current& current) +RemoteObjectAdapterI::deactivate(const Ice::Current&) { try { diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp index 39877b6960a..ffb0b379dd9 100644 --- a/cpp/test/Ice/custom/AllTests.cpp +++ b/cpp/test/Ice/custom/AllTests.cpp @@ -3366,10 +3366,10 @@ allTests(Test::TestHelper* helper) cout << "testing class mapped structs with AMI... " << flush; { - Test::ClassStructPtr cs2; - Test::ClassStructSeq csseq2; + cs2 = 0; + csseq2.clear(); Ice::AsyncResultPtr r = t->begin_opClassStruct(cs, csseq1); - Test::ClassStructPtr cs3 = t->end_opClassStruct(cs2, csseq2, r); + cs3 = t->end_opClassStruct(cs2, csseq2, r); assert(cs3 == cs); assert(csseq1.size() == csseq2.size()); assert(csseq1[0] == csseq2[0]); @@ -3424,8 +3424,7 @@ allTests(Test::TestHelper* helper) test(r.returnValue == wstr); #else Ice::AsyncResultPtr r = wsc1->begin_opString(wstr); - wstring out; - wstring ret = wsc1->end_opString(out, r); + ret = wsc1->end_opString(out, r); test(out == wstr); test(ret == wstr); #endif @@ -3436,10 +3435,10 @@ allTests(Test::TestHelper* helper) promise<bool> done; wsc1->opStringAsync(wstr, - [&](wstring ret, wstring out) + [&](wstring retP, wstring outP) { - test(out == wstr); - test(ret == wstr); + test(outP == wstr); + test(retP == wstr); done.set_value(true); }, [&](std::exception_ptr) @@ -3467,8 +3466,7 @@ allTests(Test::TestHelper* helper) test(r.returnValue == wstr); #else Ice::AsyncResultPtr r = wsc2->begin_opString(wstr); - wstring out; - wstring ret = wsc2->end_opString(out, r); + ret = wsc2->end_opString(out, r); test(out == wstr); test(ret == wstr); #endif @@ -3479,10 +3477,10 @@ allTests(Test::TestHelper* helper) promise<bool> done; wsc2->opStringAsync(wstr, - [&](wstring ret, wstring out) + [&](wstring retP, wstring outP) { - test(out == wstr); - test(ret == wstr); + test(outP == wstr); + test(retP == wstr); done.set_value(true); }, [&](std::exception_ptr) diff --git a/cpp/test/Ice/defaultValue/Client.cpp b/cpp/test/Ice/defaultValue/Client.cpp index 3057e93e872..215966e95f0 100644 --- a/cpp/test/Ice/defaultValue/Client.cpp +++ b/cpp/test/Ice/defaultValue/Client.cpp @@ -22,7 +22,7 @@ public: }; void -Client::run(int argc, char** argv) +Client::run(int, char**) { void allTests(); allTests(); diff --git a/cpp/test/Ice/exceptions/TestAMDI.cpp b/cpp/test/Ice/exceptions/TestAMDI.cpp index c423a8381fb..b098008c430 100644 --- a/cpp/test/Ice/exceptions/TestAMDI.cpp +++ b/cpp/test/Ice/exceptions/TestAMDI.cpp @@ -200,7 +200,7 @@ ThrowerI::throwCasCAsync(int a, int b, int c, void ThrowerI::throwModAAsync(int a, int a2, function<void()>, - function<void(exception_ptr)> exception, + function<void(exception_ptr)>, const Ice::Current&) { Mod::A ex; diff --git a/cpp/test/Ice/faultTolerance/AllTests.cpp b/cpp/test/Ice/faultTolerance/AllTests.cpp index e1917b4ea11..3d0a2ffadcf 100644 --- a/cpp/test/Ice/faultTolerance/AllTests.cpp +++ b/cpp/test/Ice/faultTolerance/AllTests.cpp @@ -89,9 +89,9 @@ public: catch(const Ice::ConnectFailedException&) { } - catch(const Ice::Exception& ex) + catch(const Ice::Exception& e) { - cout << ex << endl; + cout << e << endl; test(false); } called(); diff --git a/cpp/test/Ice/gc/Client.cpp b/cpp/test/Ice/gc/Client.cpp index 49425be3f7d..126084f473a 100644 --- a/cpp/test/Ice/gc/Client.cpp +++ b/cpp/test/Ice/gc/Client.cpp @@ -525,7 +525,7 @@ public: }; void -Client::run(int argc, char** argv) +Client::run(int, char**) { allTests(); } diff --git a/cpp/test/Ice/hold/AllTests.cpp b/cpp/test/Ice/hold/AllTests.cpp index 4db7f187534..f316bcebddf 100644 --- a/cpp/test/Ice/hold/AllTests.cpp +++ b/cpp/test/Ice/hold/AllTests.cpp @@ -109,20 +109,19 @@ allTests(Test::TestHelper* helper) cout << "ok" << endl; cout << "changing state between active and hold rapidly... " << flush; - int i; - for(i = 0; i < 100; ++i) + for(int i = 0; i < 100; ++i) { hold->putOnHold(0); } - for(i = 0; i < 100; ++i) + for(int i = 0; i < 100; ++i) { hold->ice_oneway()->putOnHold(0); } - for(i = 0; i < 100; ++i) + for(int i = 0; i < 100; ++i) { holdSerialized->putOnHold(0); } - for(i = 0; i < 100; ++i) + for(int i = 0; i < 100; ++i) { holdSerialized->ice_oneway()->putOnHold(0); } @@ -140,9 +139,9 @@ allTests(Test::TestHelper* helper) auto sent = make_shared<promise<bool>>(); auto expected = value; hold->setAsync(value + 1, IceUtilInternal::random(5), - [cond, expected, completed](int value) + [cond, expected, completed](int val) { - if(value != expected) + if(val != expected) { cond->set(false); } @@ -215,9 +214,9 @@ allTests(Test::TestHelper* helper) holdSerialized->setAsync( value + 1, IceUtilInternal::random(1), - [cond, expected, completed](int value) + [cond, expected, completed](int val) { - if(value != expected) + if(val != expected) { cond->set(false); } @@ -282,7 +281,7 @@ allTests(Test::TestHelper* helper) [](exception_ptr) { }, - [completed](bool sentSynchronously) + [completed](bool /*sentSynchronously*/) { completed->set_value(); }); @@ -318,7 +317,7 @@ allTests(Test::TestHelper* helper) { hold->waitForHold(); hold->waitForHold(); - for(i = 0; i < 1000; ++i) + for(int i = 0; i < 1000; ++i) { hold->ice_oneway()->ice_ping(); if((i % 20) == 0) diff --git a/cpp/test/Ice/impl/Makefile.mk b/cpp/test/Ice/impl/Makefile.mk index 5c5d0feaba6..a4e19bae6e9 100644 --- a/cpp/test/Ice/impl/Makefile.mk +++ b/cpp/test/Ice/impl/Makefile.mk @@ -18,7 +18,7 @@ define make-impl-with-config ifneq ($$($2_impl),) $5_sources += $$($5_objdir)/$$($2_impl)I.cpp $5_objects += $$(addprefix $$($5_objdir)/,$$(call source-to-object,$$($5_objdir)/$$($2_impl)I.cpp)) -$5_cppflags += -I$$($5_objdir) +$5_cppflags += -I$$($5_objdir) $(nounusedparameter-cppflags) $$($5_objects): $$($5_objdir)/$$($2_impl)I.cpp diff --git a/cpp/test/Ice/info/AllTests.cpp b/cpp/test/Ice/info/AllTests.cpp index 40addf59a37..75680954a2c 100644 --- a/cpp/test/Ice/info/AllTests.cpp +++ b/cpp/test/Ice/info/AllTests.cpp @@ -194,14 +194,14 @@ allTests(Test::TestHelper* helper) test(ctx["host"] == tcpinfo->host); test(ctx["compress"] == "false"); istringstream is(ctx["port"]); - int port; - is >> port; - test(port > 0); + int portCtx; + is >> portCtx; + test(portCtx > 0); info = base->ice_datagram()->ice_getConnection()->getEndpoint()->getInfo(); Ice::UDPEndpointInfoPtr udp = ICE_DYNAMIC_CAST(Ice::UDPEndpointInfo, info); test(udp); - test(udp->port == port); + test(udp->port == portCtx); test(udp->host == defaultHost); } cout << "ok" << endl; diff --git a/cpp/test/Ice/interceptor/AMDInterceptorI.cpp b/cpp/test/Ice/interceptor/AMDInterceptorI.cpp index 647e7e62d88..204fc5d3305 100644 --- a/cpp/test/Ice/interceptor/AMDInterceptorI.cpp +++ b/cpp/test/Ice/interceptor/AMDInterceptorI.cpp @@ -97,9 +97,9 @@ AMDInterceptorI::dispatch(Ice::Request& request) { rethrow_exception(ex); } - catch(const IceUtil::Exception& ex) + catch(const IceUtil::Exception& e) { - setException(ex); + setException(e); } catch(...) { diff --git a/cpp/test/Ice/invoke/AllTests.cpp b/cpp/test/Ice/invoke/AllTests.cpp index d56d47b60f8..168834a3e68 100644 --- a/cpp/test/Ice/invoke/AllTests.cpp +++ b/cpp/test/Ice/invoke/AllTests.cpp @@ -12,7 +12,6 @@ #include <Test.h> using namespace std; -using namespace Ice; static string testString = "This is a test string"; @@ -302,15 +301,15 @@ allTests(Test::TestHelper* helper) { Ice::ByteSeq inEncaps, outEncaps; - if(!oneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)) + if(!oneway->ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)) { test(false); } - test(batchOneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)); - test(batchOneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)); - test(batchOneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)); - test(batchOneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)); + test(batchOneway->ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)); + test(batchOneway->ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)); + test(batchOneway->ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)); + test(batchOneway->ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)); batchOneway->ice_flushBatchRequests(); Ice::OutputStream out(communicator); @@ -320,7 +319,7 @@ allTests(Test::TestHelper* helper) out.finished(inEncaps); // ice_invoke - if(cl->ice_invoke("opString", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)) + if(cl->ice_invoke("opString", Ice::ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps)) { Ice::InputStream in(communicator, out.getEncoding(), outEncaps); in.startEncapsulation(); @@ -338,7 +337,7 @@ allTests(Test::TestHelper* helper) // ice_invoke with array mapping pair<const ::Ice::Byte*, const ::Ice::Byte*> inPair(&inEncaps[0], &inEncaps[0] + inEncaps.size()); - if(cl->ice_invoke("opString", ICE_ENUM(OperationMode, Normal), inPair, outEncaps)) + if(cl->ice_invoke("opString", Ice::ICE_ENUM(OperationMode, Normal), inPair, outEncaps)) { Ice::InputStream in(communicator, out.getEncoding(), outEncaps); in.startEncapsulation(); @@ -363,7 +362,7 @@ allTests(Test::TestHelper* helper) { ctx["raise"] = ""; } - if(cl->ice_invoke("opException", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps, ctx)) + if(cl->ice_invoke("opException", Ice::ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps, ctx)) { test(false); } @@ -393,7 +392,7 @@ allTests(Test::TestHelper* helper) { Ice::ByteSeq inEncaps; - batchOneway->ice_invokeAsync("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, + batchOneway->ice_invokeAsync("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps, [](bool, const vector<Ice::Byte>) { test(false); @@ -413,10 +412,10 @@ allTests(Test::TestHelper* helper) // { Ice::ByteSeq inEncaps; - test(batchOneway->ice_invokeAsync("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps).get().returnValue); - test(batchOneway->ice_invokeAsync("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps).get().returnValue); - test(batchOneway->ice_invokeAsync("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps).get().returnValue); - test(batchOneway->ice_invokeAsync("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps).get().returnValue); + test(batchOneway->ice_invokeAsync("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps).get().returnValue); + test(batchOneway->ice_invokeAsync("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps).get().returnValue); + test(batchOneway->ice_invokeAsync("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps).get().returnValue); + test(batchOneway->ice_invokeAsync("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps).get().returnValue); batchOneway->ice_flushBatchRequests(); } @@ -425,7 +424,7 @@ allTests(Test::TestHelper* helper) Ice::ByteSeq inEncaps, outEncaps; oneway->ice_invokeAsync( "opOneway", - OperationMode::Normal, + Ice::OperationMode::Normal, inEncaps, nullptr, [&](exception_ptr ex) @@ -446,7 +445,7 @@ allTests(Test::TestHelper* helper) { Ice::ByteSeq inEncaps, outEncaps; - auto completed = oneway->ice_invokeAsync("opOneway", OperationMode::Normal, inEncaps); + auto completed = oneway->ice_invokeAsync("opOneway", Ice::OperationMode::Normal, inEncaps); test(completed.get().returnValue); } @@ -459,7 +458,7 @@ allTests(Test::TestHelper* helper) out.endEncapsulation(); out.finished(inEncaps); - cl->ice_invokeAsync("opString", OperationMode::Normal, inEncaps, + cl->ice_invokeAsync("opString", Ice::OperationMode::Normal, inEncaps, [&](bool ok, vector<Ice::Byte> outParams) { outEncaps = move(outParams); @@ -491,7 +490,7 @@ allTests(Test::TestHelper* helper) out.endEncapsulation(); out.finished(inEncaps); - auto result = cl->ice_invokeAsync("opString", OperationMode::Normal, inEncaps).get(); + auto result = cl->ice_invokeAsync("opString", Ice::OperationMode::Normal, inEncaps).get(); test(result.returnValue); Ice::InputStream in(communicator, result.outParams); @@ -516,7 +515,7 @@ allTests(Test::TestHelper* helper) auto inPair = make_pair(inEncaps.data(), inEncaps.data() + inEncaps.size()); - cl->ice_invokeAsync("opString", OperationMode::Normal, inPair, + cl->ice_invokeAsync("opString", Ice::OperationMode::Normal, inPair, [&](bool ok, pair<const Ice::Byte*, const Ice::Byte*> outParams) { vector<Ice::Byte>(outParams.first, outParams.second).swap(outEncaps); @@ -556,7 +555,7 @@ allTests(Test::TestHelper* helper) auto inPair = make_pair(inEncaps.data(), inEncaps.data() + inEncaps.size()); - auto result = cl->ice_invokeAsync("opString", OperationMode::Normal, inPair).get(); + auto result = cl->ice_invokeAsync("opString", Ice::OperationMode::Normal, inPair).get(); test(result.returnValue); Ice::InputStream in(communicator, result.outParams); @@ -574,7 +573,7 @@ allTests(Test::TestHelper* helper) promise<void> sent; Ice::ByteSeq inEncaps, outEncaps; - cl->ice_invokeAsync("opException", OperationMode::Normal, inEncaps, + cl->ice_invokeAsync("opException", Ice::OperationMode::Normal, inEncaps, [&](bool ok, vector<Ice::Byte> outParams) { outEncaps = move(outParams); @@ -611,7 +610,7 @@ allTests(Test::TestHelper* helper) // { Ice::ByteSeq inEncaps; - auto result = cl->ice_invokeAsync("opException", OperationMode::Normal, inEncaps).get(); + auto result = cl->ice_invokeAsync("opException", Ice::OperationMode::Normal, inEncaps).get(); test(!result.returnValue); Ice::InputStream in(communicator, result.outParams); @@ -636,10 +635,10 @@ allTests(Test::TestHelper* helper) { Ice::ByteSeq inEncaps, outEncaps; - test(batchOneway->end_ice_invoke(outEncaps, batchOneway->begin_ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps))); - test(batchOneway->end_ice_invoke(outEncaps, batchOneway->begin_ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps))); - test(batchOneway->end_ice_invoke(outEncaps, batchOneway->begin_ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps))); - test(batchOneway->end_ice_invoke(outEncaps, batchOneway->begin_ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps))); + test(batchOneway->end_ice_invoke(outEncaps, batchOneway->begin_ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps))); + test(batchOneway->end_ice_invoke(outEncaps, batchOneway->begin_ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps))); + test(batchOneway->end_ice_invoke(outEncaps, batchOneway->begin_ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps))); + test(batchOneway->end_ice_invoke(outEncaps, batchOneway->begin_ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps))); batchOneway->ice_flushBatchRequests(); } diff --git a/cpp/test/Ice/invoke/Server.cpp b/cpp/test/Ice/invoke/Server.cpp index ccee3948daf..42cc9a9d960 100644 --- a/cpp/test/Ice/invoke/Server.cpp +++ b/cpp/test/Ice/invoke/Server.cpp @@ -77,13 +77,6 @@ private: Ice::ObjectPtr _blobject; }; -int -run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) -{ - - return EXIT_SUCCESS; -} - class Server : public Test::TestHelper { public: diff --git a/cpp/test/Ice/location/AllTests.cpp b/cpp/test/Ice/location/AllTests.cpp index fe309e7358d..1bd242a73f2 100644 --- a/cpp/test/Ice/location/AllTests.cpp +++ b/cpp/test/Ice/location/AllTests.cpp @@ -587,7 +587,7 @@ allTests(Test::TestHelper* helper, const string& ref) registry->setAdapterDirectProxy("TestAdapter5", locator->findAdapterById("TestAdapter")); registry->addObject(communicator->stringToProxy("test3@TestAdapter")); - int count = locator->getRequestCount(); + count = locator->getRequestCount(); ic->stringToProxy("test@TestAdapter5")->ice_locatorCacheTimeout(0)->ice_ping(); // No locator cache. ic->stringToProxy("test3")->ice_locatorCacheTimeout(0)->ice_ping(); // No locator cache. count += 3; diff --git a/cpp/test/Ice/logger/Client5.cpp b/cpp/test/Ice/logger/Client5.cpp index 2d7442a98c6..60a3edc3975 100644 --- a/cpp/test/Ice/logger/Client5.cpp +++ b/cpp/test/Ice/logger/Client5.cpp @@ -45,7 +45,7 @@ public: }; void -Client5::run(int argc, char** argv) +Client5::run(int, char**) { // // Run Client application 20 times, each times it generate 512 bytes of log messages, diff --git a/cpp/test/Ice/metrics/AllTests.cpp b/cpp/test/Ice/metrics/AllTests.cpp index fab844de98f..7e67d887a47 100644 --- a/cpp/test/Ice/metrics/AllTests.cpp +++ b/cpp/test/Ice/metrics/AllTests.cpp @@ -278,7 +278,7 @@ struct Void struct Connect { - Connect(const Ice::ObjectPrxPtr& proxy) : proxy(proxy) + Connect(const Ice::ObjectPrxPtr& proxyP) : proxy(proxyP) { } @@ -307,7 +307,7 @@ struct Connect struct InvokeOp { - InvokeOp(const Test::MetricsPrxPtr& proxy) : proxy(proxy) + InvokeOp(const Test::MetricsPrxPtr& proxyP) : proxy(proxyP) { } diff --git a/cpp/test/Ice/metrics/InstrumentationI.h b/cpp/test/Ice/metrics/InstrumentationI.h index ce6cdfaa053..faa192eaa32 100644 --- a/cpp/test/Ice/metrics/InstrumentationI.h +++ b/cpp/test/Ice/metrics/InstrumentationI.h @@ -227,7 +227,7 @@ public: } virtual Ice::Instrumentation::RemoteObserverPtr - getRemoteObserver(const Ice::ConnectionInfoPtr& c, const Ice::EndpointPtr& e, Ice::Int, Ice::Int) + getRemoteObserver(const Ice::ConnectionInfoPtr&, const Ice::EndpointPtr&, Ice::Int, Ice::Int) { IceUtil::Mutex::Lock sync(*this); if(!remoteObserver) diff --git a/cpp/test/Ice/objects/AllTests.cpp b/cpp/test/Ice/objects/AllTests.cpp index 7633f3732bb..19f19cf13a6 100644 --- a/cpp/test/Ice/objects/AllTests.cpp +++ b/cpp/test/Ice/objects/AllTests.cpp @@ -64,10 +64,10 @@ testUOE(const Ice::CommunicatorPtr& communicator) void clear(const CPtr&); +#ifdef ICE_CPP11_MAPPING void clear(const BPtr& b) { -#ifdef ICE_CPP11_MAPPING // No GC with the C++11 mapping if(dynamic_pointer_cast<B>(b->theA)) { @@ -82,23 +82,33 @@ clear(const BPtr& b) clear(dynamic_pointer_cast<B>(tmp)); } b->theC = nullptr; -#endif } +#else +void +clear(const BPtr&) +{ +} +#endif +#ifdef ICE_CPP11_MAPPING void clear(const CPtr& c) { -#ifdef ICE_CPP11_MAPPING // No GC with the C++11 mapping clear(c->theB); c->theB = nullptr; -#endif } +#else +void +clear(const CPtr&) +{ +} +#endif +#ifdef ICE_CPP11_MAPPING void clear(const DPtr& d) { -#ifdef ICE_CPP11_MAPPING // No GC with the C++11 mapping if(dynamic_pointer_cast<B>(d->theA)) { @@ -107,8 +117,13 @@ clear(const DPtr& d) d->theA = nullptr; clear(d->theB); d->theB = nullptr; -#endif } +#else +void +clear(const DPtr&) +{ +} +#endif } @@ -341,10 +356,12 @@ allTests(Test::TestHelper* helper) cout << "ok" << endl; cout << "getting K... " << flush; - KPtr k = initial->getK(); - LPtr l = ICE_DYNAMIC_CAST(L, k->value); - test(l); - test(l->data == "l"); + { + KPtr k = initial->getK(); + LPtr l = ICE_DYNAMIC_CAST(L, k->value); + test(l); + test(l->data == "l"); + } cout << "ok" << endl; cout << "testing Value as parameter..." << flush; @@ -434,10 +451,10 @@ allTests(Test::TestHelper* helper) cout << "testing recursive type... " << flush; RecursivePtr top = ICE_MAKE_SHARED(Recursive); - RecursivePtr p = top; int depth = 0; try { + RecursivePtr p = top; #if defined(NDEBUG) || !defined(__APPLE__) const int maxDepth = 2000; #else @@ -513,9 +530,9 @@ allTests(Test::TestHelper* helper) cout << "testing Object factory registration... " << flush; { - BasePtr base = p->opDerived(); - test(base); - test(base->ice_id() == "::Test::Derived"); + BasePtr basePtr = p->opDerived(); + test(basePtr); + test(basePtr->ice_id() == "::Test::Derived"); } cout << "ok" << endl; diff --git a/cpp/test/Ice/objects/Client.cpp b/cpp/test/Ice/objects/Client.cpp index 677d60e32a8..763dcffa4e1 100644 --- a/cpp/test/Ice/objects/Client.cpp +++ b/cpp/test/Ice/objects/Client.cpp @@ -98,7 +98,7 @@ public: assert(_destroyed); } - virtual Ice::ValuePtr create(const string& type) + virtual Ice::ValuePtr create(const string&) { return ICE_NULLPTR; } diff --git a/cpp/test/Ice/objects/Collocated.cpp b/cpp/test/Ice/objects/Collocated.cpp index 01a2e3c99a8..a8780f5a166 100644 --- a/cpp/test/Ice/objects/Collocated.cpp +++ b/cpp/test/Ice/objects/Collocated.cpp @@ -91,7 +91,7 @@ public: assert(_destroyed); } - virtual Ice::ValuePtr create(const string& type) + virtual Ice::ValuePtr create(const string&) { return ICE_NULLPTR; } diff --git a/cpp/test/Ice/operations/BatchOneways.cpp b/cpp/test/Ice/operations/BatchOneways.cpp index 63a4e7ed63b..2f1c180867d 100644 --- a/cpp/test/Ice/operations/BatchOneways.cpp +++ b/cpp/test/Ice/operations/BatchOneways.cpp @@ -141,15 +141,16 @@ batchOneways(const Test::MyClassPrxPtr& p) Ice::Identity identity; identity.name = "invalid"; - Ice::ObjectPrxPtr batch3 = batch->ice_identity(identity); - batch3->ice_ping(); - batch3->ice_flushBatchRequests(); - - // Make sure that a bogus batch request doesn't cause troubles to other ones. - batch3->ice_ping(); - batch->ice_ping(); - batch->ice_flushBatchRequests(); - batch->ice_ping(); + { + Ice::ObjectPrxPtr batch3 = batch->ice_identity(identity); + batch3->ice_ping(); + batch3->ice_flushBatchRequests(); + // Make sure that a bogus batch request doesn't cause troubles to other ones. + batch3->ice_ping(); + batch->ice_ping(); + batch->ice_flushBatchRequests(); + batch->ice_ping(); + } if(batch->ice_getConnection() && p->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "bt") @@ -159,41 +160,41 @@ batchOneways(const Test::MyClassPrxPtr& p) BatchRequestInterceptorIPtr interceptor = ICE_MAKE_SHARED(BatchRequestInterceptorI); #if defined(ICE_CPP11_MAPPING) - initData.batchRequestInterceptor = [=](const Ice::BatchRequest& request, int count, int size) + initData.batchRequestInterceptor = [=](const Ice::BatchRequest& request, int countP, int size) { - interceptor->enqueue(request, count, size); + interceptor->enqueue(request, countP, size); }; #else initData.batchRequestInterceptor = interceptor; #endif Ice::CommunicatorPtr ic = Ice::initialize(initData); - Test::MyClassPrxPtr batch = + Test::MyClassPrxPtr batch4 = ICE_UNCHECKED_CAST(Test::MyClassPrx, ic->stringToProxy(p->ice_toString()))->ice_batchOneway(); test(interceptor->count() == 0); - batch->ice_ping(); - batch->ice_ping(); - batch->ice_ping(); + batch4->ice_ping(); + batch4->ice_ping(); + batch4->ice_ping(); test(interceptor->count() == 0); interceptor->enqueue(true); - batch->ice_ping(); - batch->ice_ping(); - batch->ice_ping(); + batch4->ice_ping(); + batch4->ice_ping(); + batch4->ice_ping(); test(interceptor->count() == 3); - batch->ice_flushBatchRequests(); - batch->ice_ping(); + batch4->ice_flushBatchRequests(); + batch4->ice_ping(); test(interceptor->count() == 1); - batch->opByteSOneway(bs1); + batch4->opByteSOneway(bs1); test(interceptor->count() == 2); - batch->opByteSOneway(bs1); + batch4->opByteSOneway(bs1); test(interceptor->count() == 3); - batch->opByteSOneway(bs1); // This should trigger the flush - batch->ice_ping(); + batch4->opByteSOneway(bs1); // This should trigger the flush + batch4->ice_ping(); test(interceptor->count() == 2); ic->destroy(); diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index 96651a25d4b..d23f1372a4d 100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp @@ -65,7 +65,7 @@ MyDerivedClassI::shutdown(const Ice::Current& current) } bool -MyDerivedClassI::supportsCompress(const Ice::Current& current) +MyDerivedClassI::supportsCompress(const Ice::Current&) { #if defined(ICE_OS_UWP) return false; diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index c2222899420..8730e4e7f24 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -936,28 +936,28 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) } { - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; + Test::MyStruct ms11 = { 1, 1 }; + Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[s11] = ICE_ENUM(MyEnum, enum1); - di1[s12] = ICE_ENUM(MyEnum, enum2); + di1[ms11] = ICE_ENUM(MyEnum, enum1); + di1[ms12] = ICE_ENUM(MyEnum, enum2); - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; + Test::MyStruct ms22 = { 2, 2 }; + Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[s11] = ICE_ENUM(MyEnum, enum1); - di2[s22] = ICE_ENUM(MyEnum, enum3); - di2[s23] = ICE_ENUM(MyEnum, enum2); + di2[ms11] = ICE_ENUM(MyEnum, enum1); + di2[ms22] = ICE_ENUM(MyEnum, enum3); + di2[ms23] = ICE_ENUM(MyEnum, enum2); Test::MyStructMyEnumD _do; Test::MyStructMyEnumD ro = p->opMyStructMyEnumD(di1, di2, _do); test(_do == di1); test(ro.size() == 4); - test(ro[s11] == ICE_ENUM(MyEnum, enum1)); - test(ro[s12] == ICE_ENUM(MyEnum, enum2)); - test(ro[s22] == ICE_ENUM(MyEnum, enum3)); - test(ro[s23] == ICE_ENUM(MyEnum, enum2)); + test(ro[ms11] == ICE_ENUM(MyEnum, enum1)); + test(ro[ms12] == ICE_ENUM(MyEnum, enum2)); + test(ro[ms22] == ICE_ENUM(MyEnum, enum3)); + test(ro[ms23] == ICE_ENUM(MyEnum, enum2)); } { @@ -1261,21 +1261,21 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) Test::MyStructMyEnumDS dsi2; dsi2.resize(1); - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; + Test::MyStruct ms11 = { 1, 1 }; + Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[s11] = ICE_ENUM(MyEnum, enum1); - di1[s12] = ICE_ENUM(MyEnum, enum2); + di1[ms11] = ICE_ENUM(MyEnum, enum1); + di1[ms12] = ICE_ENUM(MyEnum, enum2); - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; + Test::MyStruct ms22 = { 2, 2 }; + Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[s11] = ICE_ENUM(MyEnum, enum1); - di2[s22] = ICE_ENUM(MyEnum, enum3); - di2[s23] = ICE_ENUM(MyEnum, enum2); + di2[ms11] = ICE_ENUM(MyEnum, enum1); + di2[ms22] = ICE_ENUM(MyEnum, enum3); + di2[ms23] = ICE_ENUM(MyEnum, enum2); Test::MyStructMyEnumD di3; - di3[s23] = ICE_ENUM(MyEnum, enum3); + di3[ms23] = ICE_ENUM(MyEnum, enum3); dsi1[0] = di1; dsi1[1] = di2; @@ -1288,23 +1288,23 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) test(ro.size() == 2); test(ro[0].size() == 3); - test(ro[0][s11] == ICE_ENUM(MyEnum, enum1)); - test(ro[0][s22] == ICE_ENUM(MyEnum, enum3)); - test(ro[0][s23] == ICE_ENUM(MyEnum, enum2)); + test(ro[0][ms11] == ICE_ENUM(MyEnum, enum1)); + test(ro[0][ms22] == ICE_ENUM(MyEnum, enum3)); + test(ro[0][ms23] == ICE_ENUM(MyEnum, enum2)); test(ro[1].size() == 2); - test(ro[1][s11] == ICE_ENUM(MyEnum, enum1)); - test(ro[1][s12] == ICE_ENUM(MyEnum, enum2)); + test(ro[1][ms11] == ICE_ENUM(MyEnum, enum1)); + test(ro[1][ms12] == ICE_ENUM(MyEnum, enum2)); test(_do.size() == 3); test(_do[0].size() == 1); - test(_do[0][s23] == ICE_ENUM(MyEnum, enum3)); + test(_do[0][ms23] == ICE_ENUM(MyEnum, enum3)); test(_do[1].size() == 2); - test(_do[1][s11] == ICE_ENUM(MyEnum, enum1)); - test(_do[1][s12] == ICE_ENUM(MyEnum, enum2)); + test(_do[1][ms11] == ICE_ENUM(MyEnum, enum1)); + test(_do[1][ms12] == ICE_ENUM(MyEnum, enum2)); test(_do[2].size() == 3); - test(_do[2][s11] == ICE_ENUM(MyEnum, enum1)); - test(_do[2][s22] == ICE_ENUM(MyEnum, enum3)); - test(_do[2][s23] == ICE_ENUM(MyEnum, enum2)); + test(_do[2][ms11] == ICE_ENUM(MyEnum, enum1)); + test(_do[2][ms22] == ICE_ENUM(MyEnum, enum3)); + test(_do[2][ms23] == ICE_ENUM(MyEnum, enum2)); } catch(const Ice::OperationNotExistException&) { @@ -1710,27 +1710,29 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) } { - 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::MyClassPrxPtr p2 = ICE_CHECKED_CAST(Test::MyClassPrx, p->ice_context(ctx)); - test(p2->ice_getContext() == ctx); - Test::StringStringD r = p2->opContext(); - test(r == ctx); - r = p2->opContext(ctx); - test(r == ctx); + 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::MyClassPrxPtr p2 = ICE_CHECKED_CAST(Test::MyClassPrx, p->ice_context(ctx)); + test(p2->ice_getContext() == ctx); + Test::StringStringD r = p2->opContext(); + test(r == ctx); + r = p2->opContext(ctx); + test(r == ctx); + } } if(p->ice_getConnection() && communicator->getProperties()->getProperty("Ice.Default.Protocol") != "bt") @@ -1754,13 +1756,13 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) ctx["three"] = "THREE"; Ice::PropertiesPtr properties = ic->getProperties(); - Test::MyClassPrxPtr p = + Test::MyClassPrxPtr q = ICE_UNCHECKED_CAST(Test::MyClassPrx, ic->stringToProxy("test:" + TestHelper::getTestEndpoint(properties, 0))); ic->getImplicitContext()->setContext(ctx); test(ic->getImplicitContext()->getContext() == ctx); - test(p->opContext() == ctx); + test(q->opContext() == ctx); test(ic->getImplicitContext()->containsKey("zero") == false); string r = ic->getImplicitContext()->put("zero", "ZERO"); @@ -1769,7 +1771,7 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) test(ic->getImplicitContext()->get("zero") == "ZERO"); ctx = ic->getImplicitContext()->getContext(); - test(p->opContext() == ctx); + test(q->opContext() == ctx); Ice::Context prxContext; prxContext["one"] = "UN"; prxContext["four"] = "QUATRE"; @@ -1778,19 +1780,19 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) combined.insert(ctx.begin(), ctx.end()); test(combined["one"] == "UN"); - p = ICE_UNCHECKED_CAST(Test::MyClassPrx, p->ice_context(prxContext)); + q = ICE_UNCHECKED_CAST(Test::MyClassPrx, q->ice_context(prxContext)); ic->getImplicitContext()->setContext(Ice::Context()); - test(p->opContext() == prxContext); + test(q->opContext() == prxContext); ic->getImplicitContext()->setContext(ctx); - test(p->opContext() == combined); + test(q->opContext() == combined); test(ic->getImplicitContext()->remove("one") == "ONE"); if(impls[i] == "PerThread") { - IceUtil::ThreadPtr thread = new PerThreadContextInvokeThread(p->ice_context(Ice::Context())); + IceUtil::ThreadPtr thread = new PerThreadContextInvokeThread(q->ice_context(Ice::Context())); thread->start(); thread->getThreadControl().join(); } diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index 47451f5c41a..2dee6c11358 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -519,23 +519,23 @@ public: void opMyStructMyEnumD(const Test::MyStructMyEnumD& ro, const Test::MyStructMyEnumD& _do) { - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; + Test::MyStruct ms11 = { 1, 1 }; + Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[s11] = ICE_ENUM(Test::MyEnum, enum1); - di1[s12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); + di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); test(_do == di1); - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; + Test::MyStruct ms22 = { 2, 2 }; + Test::MyStruct ms23 = { 2, 3 }; test(ro.size() == 4); - test(ro.find(s11) != ro.end()); - test(ro.find(s11)->second == ICE_ENUM(Test::MyEnum, enum1)); - test(ro.find(s12) != ro.end()); - test(ro.find(s12)->second == ICE_ENUM(Test::MyEnum, enum2)); - test(ro.find(s22) != ro.end()); - test(ro.find(s22)->second == ICE_ENUM(Test::MyEnum, enum3)); - test(ro.find(s23) != ro.end()); - test(ro.find(s23)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro.find(ms11) != ro.end()); + test(ro.find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(ro.find(ms12) != ro.end()); + test(ro.find(ms12)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro.find(ms22) != ro.end()); + test(ro.find(ms22)->second == ICE_ENUM(Test::MyEnum, enum3)); + test(ro.find(ms23) != ro.end()); + test(ro.find(ms23)->second == ICE_ENUM(Test::MyEnum, enum2)); called(); } @@ -737,40 +737,40 @@ public: void opMyStructMyEnumDS(const Test::MyStructMyEnumDS& ro, const Test::MyStructMyEnumDS& _do) { - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; + Test::MyStruct ms11 = { 1, 1 }; + Test::MyStruct ms12 = { 1, 2 }; + Test::MyStruct ms22 = { 2, 2 }; + Test::MyStruct ms23 = { 2, 3 }; test(ro.size() == 2); test(ro[0].size() == 3); - test(ro[0].find(s11) != ro[0].end()); - test(ro[0].find(s11)->second == ICE_ENUM(Test::MyEnum, enum1)); - test(ro[0].find(s22) != ro[0].end()); - test(ro[0].find(s22)->second == ICE_ENUM(Test::MyEnum, enum3)); - test(ro[0].find(s23) != ro[0].end()); - test(ro[0].find(s23)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro[0].find(ms11) != ro[0].end()); + test(ro[0].find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(ro[0].find(ms22) != ro[0].end()); + test(ro[0].find(ms22)->second == ICE_ENUM(Test::MyEnum, enum3)); + test(ro[0].find(ms23) != ro[0].end()); + test(ro[0].find(ms23)->second == ICE_ENUM(Test::MyEnum, enum2)); test(ro[1].size() == 2); - test(ro[1].find(s11) != ro[1].end()); - test(ro[1].find(s11)->second == ICE_ENUM(Test::MyEnum, enum1)); - test(ro[1].find(s12) != ro[1].end()); - test(ro[1].find(s12)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro[1].find(ms11) != ro[1].end()); + test(ro[1].find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(ro[1].find(ms12) != ro[1].end()); + test(ro[1].find(ms12)->second == ICE_ENUM(Test::MyEnum, enum2)); test(_do.size() == 3); test(_do[0].size() == 1); - test(_do[0].find(s23) != _do[0].end()); - test(_do[0].find(s23)->second == ICE_ENUM(Test::MyEnum, enum3)); + test(_do[0].find(ms23) != _do[0].end()); + test(_do[0].find(ms23)->second == ICE_ENUM(Test::MyEnum, enum3)); test(_do[1].size() == 2); - test(_do[1].find(s11) != _do[1].end()); - test(_do[1].find(s11)->second == ICE_ENUM(Test::MyEnum, enum1)); - test(_do[1].find(s12) != _do[1].end()); - test(_do[1].find(s12)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(_do[1].find(ms11) != _do[1].end()); + test(_do[1].find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(_do[1].find(ms12) != _do[1].end()); + test(_do[1].find(ms12)->second == ICE_ENUM(Test::MyEnum, enum2)); test(_do[2].size() == 3); - test(_do[2].find(s11) != _do[2].end()); - test(_do[2].find(s11)->second == ICE_ENUM(Test::MyEnum, enum1)); - test(_do[2].find(s22) != _do[2].end()); - test(_do[2].find(s22)->second == ICE_ENUM(Test::MyEnum, enum3)); - test(_do[2].find(s23) != _do[2].end()); - test(_do[2].find(s23)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(_do[2].find(ms11) != _do[2].end()); + test(_do[2].find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(_do[2].find(ms22) != _do[2].end()); + test(_do[2].find(ms22)->second == ICE_ENUM(Test::MyEnum, enum3)); + test(_do[2].find(ms23) != _do[2].end()); + test(_do[2].find(ms23)->second == ICE_ENUM(Test::MyEnum, enum2)); called(); } @@ -1191,9 +1191,9 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& CallbackPtr cb = ICE_MAKE_SHARED(Callback); #ifdef ICE_CPP11_MAPPING p->opShortIntLongAsync(10, 11, 12, - [&](long long int l1, short s1, int i1, long long int l2) + [&](long long int l1, short s1P, int i1, long long int l2) { - cb->opShortIntLong(l1, s1, i1, l2); + cb->opShortIntLong(l1, s1P, i1, l2); }, makeExceptionClosure(cb)); #else @@ -1225,9 +1225,9 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& CallbackPtr cb = ICE_MAKE_SHARED(Callback); #ifdef ICE_CPP11_MAPPING p->opStringAsync("hello", "world", - [&](string s1, string s2) + [&](string s1P, string s2P) { - cb->opString(move(s1), move(s2)); + cb->opString(move(s1P), move(s2P)); }, makeExceptionClosure(cb)); #else @@ -1729,18 +1729,18 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& } { - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; + Test::MyStruct ms11 = { 1, 1 }; + Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[s11] = ICE_ENUM(Test::MyEnum, enum1); - di1[s12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); + di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; + Test::MyStruct ms22 = { 2, 2 }; + Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[s11] = ICE_ENUM(Test::MyEnum, enum1); - di2[s22] = ICE_ENUM(Test::MyEnum, enum3); - di2[s23] = ICE_ENUM(Test::MyEnum, enum2); + di2[ms11] = ICE_ENUM(Test::MyEnum, enum1); + di2[ms22] = ICE_ENUM(Test::MyEnum, enum3); + di2[ms23] = ICE_ENUM(Test::MyEnum, enum2); CallbackPtr cb = ICE_MAKE_SHARED(Callback); #ifdef ICE_CPP11_MAPPING @@ -1980,21 +1980,21 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::MyStructMyEnumDS dsi2; dsi2.resize(1); - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; + Test::MyStruct ms11 = { 1, 1 }; + Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[s11] = ICE_ENUM(Test::MyEnum, enum1); - di1[s12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); + di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; + Test::MyStruct ms22 = { 2, 2 }; + Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[s11] = ICE_ENUM(Test::MyEnum, enum1); - di2[s22] = ICE_ENUM(Test::MyEnum, enum3); - di2[s23] = ICE_ENUM(Test::MyEnum, enum2); + di2[ms11] = ICE_ENUM(Test::MyEnum, enum1); + di2[ms22] = ICE_ENUM(Test::MyEnum, enum3); + di2[ms23] = ICE_ENUM(Test::MyEnum, enum2); Test::MyStructMyEnumD di3; - di3[s23] = ICE_ENUM(Test::MyEnum, enum3); + di3[ms23] = ICE_ENUM(Test::MyEnum, enum3); dsi1[0] = di1; dsi1[1] = di2; @@ -2350,9 +2350,9 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& CallbackPtr cb = ICE_MAKE_SHARED(Callback); #ifdef ICE_CPP11_MAPPING p->opIntSAsync(s, - [&](Test::IntS s1) + [&](Test::IntS s1P) { - cb->opIntS(s1); + cb->opIntS(s1P); }, makeExceptionClosure(cb)); #else @@ -2365,94 +2365,96 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& } { - Test::StringStringD ctx; - ctx["one"] = "ONE"; - ctx["two"] = "TWO"; - ctx["three"] = "THREE"; { - test(p->ice_getContext().empty()); + Ice::Context ctx; + ctx["one"] = "ONE"; + ctx["two"] = "TWO"; + ctx["three"] = "THREE"; + { + test(p->ice_getContext().empty()); #ifdef ICE_CPP11_MAPPING - promise<void> prom; - p->opContextAsync( - [&](Ice::Context c) - { - test(c != ctx); - prom.set_value(); - }, - [](exception_ptr) - { - test(false); - }); - prom.get_future().get(); + promise<void> prom; + p->opContextAsync( + [&](Ice::Context c) + { + test(c != ctx); + prom.set_value(); + }, + [](exception_ptr) + { + test(false); + }); + prom.get_future().get(); #else - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); - test(c != ctx); + Ice::AsyncResultPtr r = p->begin_opContext(); + Ice::Context c = p->end_opContext(r); + test(c != ctx); #endif - } - { - test(p->ice_getContext().empty()); + } + { + test(p->ice_getContext().empty()); #ifdef ICE_CPP11_MAPPING - promise<void> prom; - p->opContextAsync( - [&](Ice::Context c) - { - test(c == ctx); - prom.set_value(); - }, - [](exception_ptr) - { - test(false); - }, nullptr, ctx); - prom.get_future().get(); + promise<void> prom; + p->opContextAsync( + [&](Ice::Context c) + { + test(c == ctx); + prom.set_value(); + }, + [](exception_ptr) + { + test(false); + }, nullptr, ctx); + prom.get_future().get(); #else - Ice::AsyncResultPtr r = p->begin_opContext(ctx); - Ice::Context c = p->end_opContext(r); - test(c == ctx); + Ice::AsyncResultPtr r = p->begin_opContext(ctx); + Ice::Context c = p->end_opContext(r); + test(c == ctx); #endif - } - Test::MyClassPrxPtr p2 = ICE_CHECKED_CAST(Test::MyClassPrx, p->ice_context(ctx)); - test(p2->ice_getContext() == ctx); - { + } + { + Test::MyClassPrxPtr p2 = ICE_CHECKED_CAST(Test::MyClassPrx, p->ice_context(ctx)); + test(p2->ice_getContext() == ctx); #ifdef ICE_CPP11_MAPPING - promise<void> prom; - p2->opContextAsync( - [&](Ice::Context c) - { - test(c == ctx); - prom.set_value(); - }, - [](exception_ptr) - { - test(false); - }); - prom.get_future().get(); + promise<void> prom; + p2->opContextAsync( + [&](Ice::Context c) + { + test(c == ctx); + prom.set_value(); + }, + [](exception_ptr) + { + test(false); + }); + prom.get_future().get(); #else - Ice::AsyncResultPtr r = p2->begin_opContext(); - Ice::Context c = p2->end_opContext(r); - test(c == ctx); + Ice::AsyncResultPtr r = p2->begin_opContext(); + Ice::Context c = p2->end_opContext(r); + test(c == ctx); #endif - } - { - Test::MyClassPrxPtr p2 = ICE_CHECKED_CAST(Test::MyClassPrx, p->ice_context(ctx)); + } + { + Test::MyClassPrxPtr p2 = ICE_CHECKED_CAST(Test::MyClassPrx, p->ice_context(ctx)); #ifdef ICE_CPP11_MAPPING - promise<void> prom; - p2->opContextAsync( - [&](Ice::Context c) - { - test(c == ctx); - prom.set_value(); - }, - [](exception_ptr) - { - test(false); - }, nullptr, ctx); - prom.get_future().get(); + promise<void> prom; + p2->opContextAsync( + [&](Ice::Context c) + { + test(c == ctx); + prom.set_value(); + }, + [](exception_ptr) + { + test(false); + }, nullptr, ctx); + prom.get_future().get(); #else - Ice::AsyncResultPtr r = p2->begin_opContext(ctx); - Ice::Context c = p2->end_opContext(r); - test(c == ctx); + Ice::AsyncResultPtr r = p2->begin_opContext(ctx); + Ice::Context c = p2->end_opContext(r); + test(c == ctx); #endif + } } if(p->ice_getConnection() && communicator->getProperties()->getProperty("Ice.Default.Protocol") != "bt") @@ -2476,7 +2478,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& ctx["three"] = "THREE"; Ice::PropertiesPtr properties = ic->getProperties(); - Test::MyClassPrxPtr p = + Test::MyClassPrxPtr q = ICE_UNCHECKED_CAST(Test::MyClassPrx, ic->stringToProxy("test:" + TestHelper::getTestEndpoint(properties))); ic->getImplicitContext()->setContext(ctx); @@ -2484,7 +2486,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { #ifdef ICE_CPP11_MAPPING promise<void> prom; - p->opContextAsync( + q->opContextAsync( [&](Ice::Context c) { test(c == ctx); @@ -2496,8 +2498,8 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& }); prom.get_future().get(); #else - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); + Ice::AsyncResultPtr r = q->begin_opContext(); + Ice::Context c = q->end_opContext(r); test(c == ctx); #endif } @@ -2508,7 +2510,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { #ifdef ICE_CPP11_MAPPING promise<void> prom; - p->opContextAsync( + q->opContextAsync( [&](Ice::Context c) { test(c == ctx); @@ -2528,8 +2530,8 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& }); prom.get_future().get(); #else - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); + Ice::AsyncResultPtr r = q->begin_opContext(); + Ice::Context c = q->end_opContext(r); test(c == ctx); #endif } @@ -2542,13 +2544,13 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& combined.insert(ctx.begin(), ctx.end()); test(combined["one"] == "UN"); - p = ICE_UNCHECKED_CAST(Test::MyClassPrx, p->ice_context(prxContext)); + q = ICE_UNCHECKED_CAST(Test::MyClassPrx, q->ice_context(prxContext)); ic->getImplicitContext()->setContext(Ice::Context()); { #ifdef ICE_CPP11_MAPPING promise<void> prom; - p->opContextAsync( + q->opContextAsync( [&](Ice::Context c) { test(c == prxContext); @@ -2560,8 +2562,8 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& }); prom.get_future().get(); #else - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); + Ice::AsyncResultPtr r = q->begin_opContext(); + Ice::Context c = q->end_opContext(r); test(c == prxContext); #endif } @@ -2570,7 +2572,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { #ifdef ICE_CPP11_MAPPING promise<void> prom; - p->opContextAsync( + q->opContextAsync( [&](Ice::Context c) { test(c == combined); @@ -2582,8 +2584,8 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& }); prom.get_future().get(); #else - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); + Ice::AsyncResultPtr r = q->begin_opContext(); + Ice::Context c = q->end_opContext(r); test(c == combined); #endif } @@ -3305,18 +3307,18 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& } { - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; + Test::MyStruct ms11 = { 1, 1 }; + Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[s11] = ICE_ENUM(Test::MyEnum, enum1); - di1[s12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); + di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; + Test::MyStruct ms22 = { 2, 2 }; + Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[s11] = ICE_ENUM(Test::MyEnum, enum1); - di2[s22] = ICE_ENUM(Test::MyEnum, enum3); - di2[s23] = ICE_ENUM(Test::MyEnum, enum2); + di2[ms11] = ICE_ENUM(Test::MyEnum, enum1); + di2[ms22] = ICE_ENUM(Test::MyEnum, enum3); + di2[ms23] = ICE_ENUM(Test::MyEnum, enum2); CallbackPtr cb = ICE_MAKE_SHARED(Callback); auto f = p->opMyStructMyEnumDAsync(di1, di2); @@ -3569,21 +3571,21 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::MyStructMyEnumDS dsi2; dsi2.resize(1); - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; + Test::MyStruct ms11 = { 1, 1 }; + Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[s11] = ICE_ENUM(Test::MyEnum, enum1); - di1[s12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); + di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; + Test::MyStruct ms22 = { 2, 2 }; + Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[s11] = ICE_ENUM(Test::MyEnum, enum1); - di2[s22] = ICE_ENUM(Test::MyEnum, enum3); - di2[s23] = ICE_ENUM(Test::MyEnum, enum2); + di2[ms11] = ICE_ENUM(Test::MyEnum, enum1); + di2[ms22] = ICE_ENUM(Test::MyEnum, enum3); + di2[ms23] = ICE_ENUM(Test::MyEnum, enum2); Test::MyStructMyEnumD di3; - di3[s23] = ICE_ENUM(Test::MyEnum, enum3); + di3[ms23] = ICE_ENUM(Test::MyEnum, enum3); dsi1[0] = di1; dsi1[1] = di2; diff --git a/cpp/test/Ice/optional/AllTests.cpp b/cpp/test/Ice/optional/AllTests.cpp index 6a5fb48be57..6d97a4401b3 100644 --- a/cpp/test/Ice/optional/AllTests.cpp +++ b/cpp/test/Ice/optional/AllTests.cpp @@ -907,24 +907,24 @@ allTests(Test::TestHelper* helper, bool) cout << "ok" << endl; cout << "testing tag marshalling... " << flush; - BPtr b = ICE_MAKE_SHARED(B); - BPtr b2 = ICE_DYNAMIC_CAST(B, initial->pingPong(b)); - test(!b2->ma); - test(!b2->mb); - test(!b2->mc); - - b->ma = 10; - b->mb = 11; - b->mc = 12; - b->md = 13; - - b2 = ICE_DYNAMIC_CAST(B, initial->pingPong(b)); - test(b2->ma == 10); - test(b2->mb == 11); - test(b2->mc == 12); - test(b2->md == 13); - { + BPtr b = ICE_MAKE_SHARED(B); + BPtr b2 = ICE_DYNAMIC_CAST(B, initial->pingPong(b)); + test(!b2->ma); + test(!b2->mb); + test(!b2->mc); + + b->ma = 10; + b->mb = 11; + b->mc = 12; + b->md = 13; + + b2 = ICE_DYNAMIC_CAST(B, initial->pingPong(b)); + test(b2->ma == 10); + test(b2->mb == 11); + test(b2->mc == 12); + test(b2->md == 13); + factory->setEnabled(true); Ice::OutputStream out(communicator); out.startEncapsulation(); diff --git a/cpp/test/Ice/optional/TestI.cpp b/cpp/test/Ice/optional/TestI.cpp index 1696df988f2..cfaac265930 100644 --- a/cpp/test/Ice/optional/TestI.cpp +++ b/cpp/test/Ice/optional/TestI.cpp @@ -39,7 +39,7 @@ InitialI::pingPong(shared_ptr<Value> obj, const Current& current) } #else Ice::ValuePtr -InitialI::pingPong(const Ice::ValuePtr& obj, const Current& current) +InitialI::pingPong(const Ice::ValuePtr& obj, const Current&) { return obj; } diff --git a/cpp/test/Ice/plugin/Plugin.cpp b/cpp/test/Ice/plugin/Plugin.cpp index 4ff2f7bccd4..0a2d9d6c900 100644 --- a/cpp/test/Ice/plugin/Plugin.cpp +++ b/cpp/test/Ice/plugin/Plugin.cpp @@ -356,7 +356,7 @@ extern "C" { ICE_DECLSPEC_EXPORT ::Ice::Plugin* -createPlugin(const Ice::CommunicatorPtr& communicator, const string&, const Ice::StringSeq& args) +createPlugin(const Ice::CommunicatorPtr& communicator, const string&, const Ice::StringSeq&) { return new Plugin(communicator); } diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp index e82b881397b..b1a6e86b336 100644 --- a/cpp/test/Ice/proxy/AllTests.cpp +++ b/cpp/test/Ice/proxy/AllTests.cpp @@ -1122,30 +1122,30 @@ allTests(Test::TestHelper* helper) cout << "ok" << endl; cout << "testing checked cast with context... " << flush; - Ice::Context c = cl->getContext(); - test(c.size() == 0); + Ice::Context ctx = cl->getContext(); + test(ctx.size() == 0); - c["one"] = "hello"; - c["two"] = "world"; + ctx["one"] = "hello"; + ctx["two"] = "world"; #ifdef ICE_CPP11_MAPPING - cl = Ice::checkedCast<Test::MyClassPrx>(base, c); + cl = Ice::checkedCast<Test::MyClassPrx>(base, ctx); #else - cl = Test::MyClassPrx::checkedCast(base, c); + cl = Test::MyClassPrx::checkedCast(base, ctx); #endif Ice::Context c2 = cl->getContext(); - test(c == c2); + test(ctx == c2); // // Now with alternate API // #ifndef ICE_CPP11_MAPPING cl = Ice::checkedCast<Test::MyClassPrx>(base); - c = cl->getContext(); - test(c.size() == 0); + ctx = cl->getContext(); + test(ctx.size() == 0); - cl = Ice::checkedCast<Test::MyClassPrx>(base, c); + cl = Ice::checkedCast<Test::MyClassPrx>(base, ctx); c2 = cl->getContext(); - test(c == c2); + test(ctx == c2); #endif cout << "ok" << endl; @@ -1161,7 +1161,7 @@ allTests(Test::TestHelper* helper) test(cl->ice_secure(true)->ice_fixed(connection)->ice_isSecure()); test(cl->ice_facet("facet")->ice_fixed(connection)->ice_getFacet() == "facet"); test(cl->ice_oneway()->ice_fixed(connection)->ice_isOneway()); - Ice::Context ctx; + ctx.clear(); ctx["one"] = "hello"; ctx["two"] = "world"; test(cl->ice_fixed(connection)->ice_getContext().empty()); @@ -1432,8 +1432,10 @@ allTests(Test::TestHelper* helper) test(pstr == "test -t -e 1.1:tcp -h 127.0.0.1 -p 12010 -t 10000"); // Opaque endpoint encoded with 1.1 encoding. - Ice::ObjectPrxPtr p2 = communicator->stringToProxy("test -e 1.1:opaque -e 1.1 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA=="); - test(communicator->proxyToString(p2) == "test -t -e 1.1:tcp -h 127.0.0.1 -p 12010 -t 10000"); + { + Ice::ObjectPrxPtr p2 = communicator->stringToProxy("test -e 1.1:opaque -e 1.1 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA=="); + test(communicator->proxyToString(p2) == "test -t -e 1.1:tcp -h 127.0.0.1 -p 12010 -t 10000"); + } if(communicator->getProperties()->getPropertyAsInt("Ice.IPv6") == 0 && communicator->getProperties()->getProperty("Ice.Default.Host") == "127.0.0.1") diff --git a/cpp/test/Ice/retry/TestI.cpp b/cpp/test/Ice/retry/TestI.cpp index ed4e611790f..05d4516b89f 100644 --- a/cpp/test/Ice/retry/TestI.cpp +++ b/cpp/test/Ice/retry/TestI.cpp @@ -32,7 +32,7 @@ RetryI::op(bool kill, const Ice::Current& current) } int -RetryI::opIdempotent(int nRetry, const Ice::Current& current) +RetryI::opIdempotent(int nRetry, const Ice::Current&) { if(nRetry < 0) { @@ -51,7 +51,7 @@ RetryI::opIdempotent(int nRetry, const Ice::Current& current) } void -RetryI::opNotIdempotent(const Ice::Current& current) +RetryI::opNotIdempotent(const Ice::Current&) { throw Ice::ConnectionLostException(__FILE__, __LINE__); } diff --git a/cpp/test/Ice/scope/AllTests.cpp b/cpp/test/Ice/scope/AllTests.cpp index 2c2977da6d2..703db8fe69f 100644 --- a/cpp/test/Ice/scope/AllTests.cpp +++ b/cpp/test/Ice/scope/AllTests.cpp @@ -63,7 +63,7 @@ public: called(); } - void error(const Ice::Exception& ex) + void error(const Ice::Exception&) { test(false); } @@ -139,7 +139,7 @@ public: called(); } - void error(const Ice::Exception& ex) + void error(const Ice::Exception&) { test(false); } @@ -215,7 +215,7 @@ public: called(); } - void error(const Ice::Exception& ex) + void error(const Ice::Exception&) { test(false); } @@ -303,7 +303,7 @@ public: called(); } - void error(const Ice::Exception& ex) + void error(const Ice::Exception&) { test(false); } diff --git a/cpp/test/Ice/servantLocator/TestAMDI.cpp b/cpp/test/Ice/servantLocator/TestAMDI.cpp index d3522bd5f30..483312ec2fd 100644 --- a/cpp/test/Ice/servantLocator/TestAMDI.cpp +++ b/cpp/test/Ice/servantLocator/TestAMDI.cpp @@ -142,7 +142,7 @@ TestAMDI::asyncResponseAsync(function<void()> response, } void -TestAMDI::asyncExceptionAsync(function<void()> response, +TestAMDI::asyncExceptionAsync(function<void()>, function<void(exception_ptr)> error, const Current&) { @@ -159,7 +159,7 @@ TestAMDI::asyncExceptionAsync(function<void()> response, void TestAMDI::shutdownAsync(function<void()> response, - function<void(exception_ptr)> error, + function<void(exception_ptr)>, const Current& current) { current.adapter->deactivate(); diff --git a/cpp/test/Ice/services/AllTests.cpp b/cpp/test/Ice/services/AllTests.cpp index c88a66a0fdc..8df1aae6499 100644 --- a/cpp/test/Ice/services/AllTests.cpp +++ b/cpp/test/Ice/services/AllTests.cpp @@ -55,12 +55,12 @@ public: } virtual void - connectFailed(const Glacier2::SessionHelperPtr&, const Ice::Exception& ex) + connectFailed(const Glacier2::SessionHelperPtr&, const Ice::Exception&) { } virtual void - createdCommunicator(const Glacier2::SessionHelperPtr& session) + createdCommunicator(const Glacier2::SessionHelperPtr&) { } }; @@ -69,7 +69,7 @@ class SessionHelperClient { public: - int run(int argc, char* argv[]) + int run(int, char*[]) { _factory = ICE_MAKE_SHARED(Glacier2::SessionFactoryHelper, ICE_MAKE_SHARED(SessionCallbackI)); return EXIT_SUCCESS; diff --git a/cpp/test/Ice/slicing/objects/AllTests.cpp b/cpp/test/Ice/slicing/objects/AllTests.cpp index 9ca6c17e42b..06e00e7a24d 100644 --- a/cpp/test/Ice/slicing/objects/AllTests.cpp +++ b/cpp/test/Ice/slicing/objects/AllTests.cpp @@ -3137,8 +3137,7 @@ allTests(Test::TestHelper* helper) // // Sending more than 254 objects exercises the encoding for object ids. // - int i; - for(i = 0; i < 300; ++i) + for(int i = 0; i < 300; ++i) { PCDerived2Ptr p2 = ICE_MAKE_SHARED(PCDerived2); p2->pi = i; diff --git a/cpp/test/Ice/slicing/objects/TestI.cpp b/cpp/test/Ice/slicing/objects/TestI.cpp index b7ab0719ecc..9b423b9d7f4 100644 --- a/cpp/test/Ice/slicing/objects/TestI.cpp +++ b/cpp/test/Ice/slicing/objects/TestI.cpp @@ -441,15 +441,21 @@ TestI::returnTest2(BPtr& p1, BPtr& p2, const ::Ice::Current&) return p1; } +#ifdef ICE_CPP11_MAPPING BPtr TestI::returnTest3(ICE_IN(BPtr) p1, ICE_IN(BPtr) p2, const ::Ice::Current&) { -#ifdef ICE_CPP11_MAPPING _values.push_back(p1); _values.push_back(p2); -#endif return p1; } +#else +BPtr +TestI::returnTest3(ICE_IN(BPtr) p1, ICE_IN(BPtr), const ::Ice::Current&) +{ + return p1; +} +#endif SS3 TestI::sequenceTest(ICE_IN(SS1Ptr) p1, ICE_IN(SS2Ptr) p2, const ::Ice::Current&) diff --git a/cpp/test/Ice/stream/Client.cpp b/cpp/test/Ice/stream/Client.cpp index a88f05ea86e..eddc65c0062 100644 --- a/cpp/test/Ice/stream/Client.cpp +++ b/cpp/test/Ice/stream/Client.cpp @@ -83,22 +83,22 @@ namespace Ice template<class S> struct StreamWriter<TestObjectWriter, S> { - static void write(S* ostr, const TestObjectWriter&) { assert(false); } + static void write(S*, const TestObjectWriter&) { assert(false); } }; template<class S> struct StreamReader<TestObjectWriter, S> { - static void read(S* istr, TestObjectWriter&) { assert(false); } + static void read(S*, TestObjectWriter&) { assert(false); } }; template<class S> struct StreamWriter<TestObjectReader, S> { - static void write(S* ostr, const TestObjectReader&) { assert(false); } + static void write(S*, const TestObjectReader&) { assert(false); } }; template<class S> struct StreamReader<TestObjectReader, S> { - static void read(S* istr, TestObjectReader&) { assert(false); } + static void read(S*, TestObjectReader&) { assert(false); } }; } #endif @@ -900,8 +900,8 @@ allTests(Test::TestHelper* helper) test(arr2S[2].size() == arrS[2].size()); #ifdef ICE_CPP11_MAPPING - auto clearS = [](MyClassS& arr) { - for(MyClassS::iterator p = arr.begin(); p != arr.end(); ++p) + auto clearS = [](MyClassS& arr3) { + for(MyClassS::iterator p = arr3.begin(); p != arr3.end(); ++p) { if(*p) { @@ -911,8 +911,8 @@ allTests(Test::TestHelper* helper) } } }; - auto clearSS = [clearS](MyClassSS& arr) { - for(MyClassSS::iterator p = arr.begin(); p != arr.end(); ++p) + auto clearSS = [clearS](MyClassSS& arr3) { + for(MyClassSS::iterator p = arr3.begin(); p != arr3.end(); ++p) { clearS(*p); } diff --git a/cpp/test/Ice/timeout/AllTests.cpp b/cpp/test/Ice/timeout/AllTests.cpp index a9787193bc1..f29c4da7839 100644 --- a/cpp/test/Ice/timeout/AllTests.cpp +++ b/cpp/test/Ice/timeout/AllTests.cpp @@ -192,8 +192,8 @@ allTests(Test::TestHelper* helper) controller->holdAdapter(100); try { - ByteSeq seq(1000000); - to->sendData(seq); + ByteSeq seq2(1000000); + to->sendData(seq2); } catch(const Ice::TimeoutException&) { @@ -485,7 +485,7 @@ allTests(Test::TestHelper* helper) Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TimeoutCollocated"); adapter->activate(); - TimeoutPrxPtr timeout = ICE_UNCHECKED_CAST(TimeoutPrx, adapter->addWithUUID(ICE_MAKE_SHARED(TimeoutI))); + timeout = ICE_UNCHECKED_CAST(TimeoutPrx, adapter->addWithUUID(ICE_MAKE_SHARED(TimeoutI))); timeout = timeout->ice_invocationTimeout(100); try { diff --git a/cpp/test/Ice/timeout/TestI.cpp b/cpp/test/Ice/timeout/TestI.cpp index 1c3daf4fa93..6b8cb63baaa 100644 --- a/cpp/test/Ice/timeout/TestI.cpp +++ b/cpp/test/Ice/timeout/TestI.cpp @@ -47,7 +47,7 @@ TimeoutI::sendData(ICE_IN(Test::ByteSeq), const Ice::Current&) } void -TimeoutI::sleep(Ice::Int to, const Ice::Current& c) +TimeoutI::sleep(Ice::Int to, const Ice::Current&) { IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(to)); } diff --git a/cpp/test/IceBridge/simple/AllTests.cpp b/cpp/test/IceBridge/simple/AllTests.cpp index d73576dae3d..a5b5ee29b1f 100644 --- a/cpp/test/IceBridge/simple/AllTests.cpp +++ b/cpp/test/IceBridge/simple/AllTests.cpp @@ -87,10 +87,10 @@ allTests(Test::TestHelper* helper) { Ice::CommunicatorPtr communicator = helper->communicator(); cout << "testing connection to bridge... " << flush; - Ice::ObjectPrx base = communicator->stringToProxy("test:" + helper->getTestEndpoint(1) + ":" + + Ice::ObjectPrx prx = communicator->stringToProxy("test:" + helper->getTestEndpoint(1) + ":" + helper->getTestEndpoint(1, "udp")); - test(base); - Test::MyClassPrx cl = Ice::checkedCast<Test::MyClassPrx>(base); + test(prx); + Test::MyClassPrx cl = Ice::checkedCast<Test::MyClassPrx>(prx); cl->ice_ping(); cout << "ok" << endl; @@ -133,7 +133,7 @@ allTests(Test::TestHelper* helper) // The bridge forwards the CloseConnectionException from the server as an // UnknownLocalException. It eventually closes the connection when notified // of the connection close. - test(ex.unknown.find("CloseConnectionException") >= 0); + test(ex.unknown.find("CloseConnectionException") != string::npos); } IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1)); } diff --git a/cpp/test/IceBridge/simple/TestI.cpp b/cpp/test/IceBridge/simple/TestI.cpp index 558323dda5e..8049c6d2702 100644 --- a/cpp/test/IceBridge/simple/TestI.cpp +++ b/cpp/test/IceBridge/simple/TestI.cpp @@ -146,7 +146,7 @@ MyClassI::incCounter(int expected, const Ice::Current& c) } void -MyClassI::waitCounter(int value, const Ice::Current& c) +MyClassI::waitCounter(int value, const Ice::Current&) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor); while(_counter != value) diff --git a/cpp/test/IceDiscovery/simple/TestI.cpp b/cpp/test/IceDiscovery/simple/TestI.cpp index 5c38cf0c801..909aefc8020 100644 --- a/cpp/test/IceDiscovery/simple/TestI.cpp +++ b/cpp/test/IceDiscovery/simple/TestI.cpp @@ -36,7 +36,7 @@ ControllerI::activateObjectAdapter(ICE_IN(string) name, } void -ControllerI::deactivateObjectAdapter(ICE_IN(string) name, const Ice::Current& current) +ControllerI::deactivateObjectAdapter(ICE_IN(string) name, const Ice::Current&) { _adapters[name]->destroy(); _adapters.erase(name); diff --git a/cpp/test/IceGrid/activation/AllTests.cpp b/cpp/test/IceGrid/activation/AllTests.cpp index 61503746c05..7eb967f9b82 100644 --- a/cpp/test/IceGrid/activation/AllTests.cpp +++ b/cpp/test/IceGrid/activation/AllTests.cpp @@ -96,13 +96,13 @@ allTests(Test::TestHelper* helper) IceGrid::QueryPrx query = IceGrid::QueryPrx::checkedCast( communicator->stringToProxy(communicator->getDefaultLocator()->ice_getIdentity().category + "/Query")); - IceGrid::AdminSessionPrx session = registry->createAdminSession("foo", "bar"); + IceGrid::AdminSessionPrx adminSession = registry->createAdminSession("foo", "bar"); - session->ice_getConnection()->setACM(registry->getACMTimeout(), + adminSession->ice_getConnection()->setACM(registry->getACMTimeout(), IceUtil::None, Ice::ICE_ENUM(ACMHeartbeat, HeartbeatAlways)); - IceGrid::AdminPrx admin = session->getAdmin(); + IceGrid::AdminPrx admin = adminSession->getAdmin(); test(admin); admin->startServer("node-1"); @@ -741,5 +741,5 @@ allTests(Test::TestHelper* helper) admin->stopServer("node-1"); admin->stopServer("node-2"); - session->destroy(); + adminSession->destroy(); } diff --git a/cpp/test/IceGrid/allocation/AllTests.cpp b/cpp/test/IceGrid/allocation/AllTests.cpp index f8ed209c2f6..09bd0d024ef 100644 --- a/cpp/test/IceGrid/allocation/AllTests.cpp +++ b/cpp/test/IceGrid/allocation/AllTests.cpp @@ -1003,8 +1003,8 @@ allTests(Test::TestHelper* helper) cout << "ok" << endl; cout << "testing application updates with allocated objects... " << flush; { - SessionPrx session1 = registry->createSession("Client1", ""); - SessionPrx session2 = registry->createSession("Client2", ""); + session1 = registry->createSession("Client1", ""); + session2 = registry->createSession("Client2", ""); ServerDescriptorPtr objectAllocOriginal = admin->getServerInfo("ObjectAllocation").descriptor; ServerDescriptorPtr objectAllocUpdate = ServerDescriptorPtr::dynamicCast(objectAllocOriginal->ice_clone()); @@ -1100,7 +1100,6 @@ allTests(Test::TestHelper* helper) test(session1); session1->ice_ping(); - Ice::ObjectPrx obj; obj = session1->allocateObjectById(allocatable)->ice_connectionId("client1")->ice_router(router1); obj->ice_ping(); session1->releaseObject(allocatable); diff --git a/cpp/test/IceGrid/deployer/Service.cpp b/cpp/test/IceGrid/deployer/Service.cpp index 53304a60142..854896094b3 100644 --- a/cpp/test/IceGrid/deployer/Service.cpp +++ b/cpp/test/IceGrid/deployer/Service.cpp @@ -35,7 +35,7 @@ extern "C" // Factory function // ICE_DECLSPEC_EXPORT ::IceBox::Service* -create(CommunicatorPtr communicator) +create(CommunicatorPtr) { return new ServiceI; } diff --git a/cpp/test/IceGrid/noRestartUpdate/Service.cpp b/cpp/test/IceGrid/noRestartUpdate/Service.cpp index 6e1d3e7b991..af091a86b53 100644 --- a/cpp/test/IceGrid/noRestartUpdate/Service.cpp +++ b/cpp/test/IceGrid/noRestartUpdate/Service.cpp @@ -35,7 +35,7 @@ extern "C" // Factory function // ICE_DECLSPEC_EXPORT ::IceBox::Service* -create(CommunicatorPtr communicator) +create(CommunicatorPtr) { return new ServiceI; } diff --git a/cpp/test/IceGrid/replicaGroup/RegistryPlugin.cpp b/cpp/test/IceGrid/replicaGroup/RegistryPlugin.cpp index e759070b0ee..7fc9d0c8929 100644 --- a/cpp/test/IceGrid/replicaGroup/RegistryPlugin.cpp +++ b/cpp/test/IceGrid/replicaGroup/RegistryPlugin.cpp @@ -80,11 +80,11 @@ public: string server = p->second; Ice::StringSeq filteredAdapters; - for(Ice::StringSeq::const_iterator p = adpts.begin(); p != adpts.end(); ++p) + for(Ice::StringSeq::const_iterator q = adpts.begin(); q != adpts.end(); ++q) { - if(_facade->getAdapterServer(*p) == server) + if(_facade->getAdapterServer(*q) == server) { - filteredAdapters.push_back(*p); + filteredAdapters.push_back(*q); } } return filteredAdapters; @@ -105,7 +105,7 @@ public: } virtual Ice::ObjectProxySeq - filter(const string& type, const Ice::ObjectProxySeq& objects, const Ice::ConnectionPtr&, const Ice::Context& ctx) + filter(const string& /*type*/, const Ice::ObjectProxySeq& objects, const Ice::ConnectionPtr&, const Ice::Context& ctx) { Ice::Context::const_iterator p = ctx.find("server"); if(p == ctx.end()) @@ -115,11 +115,11 @@ public: string server = p->second; Ice::ObjectProxySeq filteredObjects; - for(Ice::ObjectProxySeq::const_iterator p = objects.begin(); p != objects.end(); ++p) + for(Ice::ObjectProxySeq::const_iterator q = objects.begin(); q != objects.end(); ++q) { - if(_facade->getAdapterServer((*p)->ice_getAdapterId()) == server) + if(_facade->getAdapterServer((*q)->ice_getAdapterId()) == server) { - filteredObjects.push_back(*p); + filteredObjects.push_back(*q); } } return filteredObjects; @@ -140,7 +140,7 @@ public: } virtual Ice::StringSeq - filter(const string& id, const Ice::StringSeq& adapters, const Ice::ConnectionPtr& con, const Ice::Context& ctx) + filter(const string& /*id*/, const Ice::StringSeq& adapters, const Ice::ConnectionPtr& /*con*/, const Ice::Context& ctx) { Ice::Context::const_iterator p = ctx.find("server"); if(p == ctx.end() || p->second == _exclude) diff --git a/cpp/test/IceGrid/replicaGroup/Service.cpp b/cpp/test/IceGrid/replicaGroup/Service.cpp index f77a1323d48..fe01f8e57b9 100644 --- a/cpp/test/IceGrid/replicaGroup/Service.cpp +++ b/cpp/test/IceGrid/replicaGroup/Service.cpp @@ -35,7 +35,7 @@ extern "C" // Factory function // ICE_DECLSPEC_EXPORT ::IceBox::Service* -create(CommunicatorPtr communicator) +create(CommunicatorPtr) { return new ServiceI; } diff --git a/cpp/test/IceGrid/replication/AllTests.cpp b/cpp/test/IceGrid/replication/AllTests.cpp index 681b22656be..3a1c011e2fc 100644 --- a/cpp/test/IceGrid/replication/AllTests.cpp +++ b/cpp/test/IceGrid/replication/AllTests.cpp @@ -253,13 +253,13 @@ allTests(Test::TestHelper* helper) IceGrid::RegistryPrx registry = IceGrid::RegistryPrx::checkedCast( comm->stringToProxy(comm->getDefaultLocator()->ice_getIdentity().category + "/Registry")); - AdminSessionPrx session = registry->createAdminSession("foo", "bar"); + AdminSessionPrx adminSession = registry->createAdminSession("foo", "bar"); - session->ice_getConnection()->setACM(registry->getACMTimeout(), + adminSession->ice_getConnection()->setACM(registry->getACMTimeout(), IceUtil::None, Ice::ICE_ENUM(ACMHeartbeat, HeartbeatAlways)); - AdminPrx admin = session->getAdmin(); + AdminPrx admin = adminSession->getAdmin(); test(admin); map<string, string> params; @@ -782,24 +782,26 @@ allTests(Test::TestHelper* helper) params["id"] = "Node1"; instantiateServer(admin, "IceGridNode", params); - // - // Add an application which is using Node1. Otherwise, when a - // registry restarts it would throw aways the proxy of the nodes - // because the node isn't used by any application. - // - ApplicationDescriptor app; - app.name = "DummyApp"; - app.nodes["Node1"].description = "dummy node"; - try - { - masterAdmin->addApplication(app); - } - catch(const Ice::Exception& ex) { - cerr << ex << endl; - test(false); + // + // Add an application which is using Node1. Otherwise, when a + // registry restarts it would throw aways the proxy of the nodes + // because the node isn't used by any application. + // + ApplicationDescriptor app; + app.name = "DummyApp"; + app.nodes["Node1"].description = "dummy node"; + try + { + masterAdmin->addApplication(app); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + test(false); + } } - + // // Test node session establishment. // @@ -995,8 +997,8 @@ allTests(Test::TestHelper* helper) { cerr << ex << endl; - ApplicationInfo app = admin->getApplicationInfo("Test"); - cerr << "properties-override = " << app.descriptor.variables["properties-override"] << endl; + ApplicationInfo appInfo = admin->getApplicationInfo("Test"); + cerr << "properties-override = " << appInfo.descriptor.variables["properties-override"] << endl; PropertyDescriptorSeq& seq = admin->getServerInfo("Node1").descriptor->propertySet.properties; for(PropertyDescriptorSeq::const_iterator p = seq.begin(); p != seq.end(); ++p) diff --git a/cpp/test/IceGrid/session/AllTests.cpp b/cpp/test/IceGrid/session/AllTests.cpp index 742e2331f10..5448cfc3307 100644 --- a/cpp/test/IceGrid/session/AllTests.cpp +++ b/cpp/test/IceGrid/session/AllTests.cpp @@ -108,7 +108,7 @@ public: } virtual void - applicationInit(int serial, const ApplicationInfoSeq& apps, const Ice::Current&) + applicationInit(int serialP, const ApplicationInfoSeq& apps, const Ice::Current&) { Lock sync(*this); for(ApplicationInfoSeq::const_iterator p = apps.begin(); p != apps.end(); ++p) @@ -118,27 +118,27 @@ public: this->applications.insert(make_pair(p->descriptor.name, *p)); } } - updated(updateSerial(serial, "init update")); + updated(updateSerial(serialP, "init update")); } virtual void - applicationAdded(int serial, const ApplicationInfo& app, const Ice::Current&) + applicationAdded(int serialP, const ApplicationInfo& app, const Ice::Current&) { Lock sync(*this); this->applications.insert(make_pair(app.descriptor.name, app)); - updated(updateSerial(serial, "application added `" + app.descriptor.name + "'")); + updated(updateSerial(serialP, "application added `" + app.descriptor.name + "'")); } virtual void - applicationRemoved(int serial, const std::string& name, const Ice::Current&) + applicationRemoved(int serialP, const std::string& name, const Ice::Current&) { Lock sync(*this); this->applications.erase(name); - updated(updateSerial(serial, "application removed `" + name + "'")); + updated(updateSerial(serialP, "application removed `" + name + "'")); } virtual void - applicationUpdated(int serial, const ApplicationUpdateInfo& info, const Ice::Current&) + applicationUpdated(int serialP, const ApplicationUpdateInfo& info, const Ice::Current&) { Lock sync(*this); const ApplicationUpdateDescriptor& desc = info.descriptor; @@ -150,7 +150,7 @@ public: { this->applications[desc.name].descriptor.variables[p->first] = p->second; } - updated(updateSerial(serial, "application updated `" + desc.name + "'")); + updated(updateSerial(serialP, "application updated `" + desc.name + "'")); } int serial; @@ -159,9 +159,9 @@ public: private: string - updateSerial(int serial, const string& update) + updateSerial(int serialP, const string& update) { - this->serial = serial; + serial = serialP; ostringstream os; os << update << " (serial = " << serial << ")"; return os.str(); @@ -178,12 +178,12 @@ public: } virtual void - adapterInit(const AdapterInfoSeq& adapters, const Ice::Current&) + adapterInit(const AdapterInfoSeq& adaptersP, const Ice::Current&) { Lock sync(*this); - for(AdapterInfoSeq::const_iterator q = adapters.begin(); q != adapters.end(); ++q) + for(AdapterInfoSeq::const_iterator q = adaptersP.begin(); q != adaptersP.end(); ++q) { - this->adapters.insert(make_pair(q->id, *q)); + adapters.insert(make_pair(q->id, *q)); } updated(updateSerial(0, "init update")); } @@ -192,7 +192,7 @@ public: adapterAdded(const AdapterInfo& info, const Ice::Current&) { Lock sync(*this); - this->adapters.insert(make_pair(info.id, info)); + adapters.insert(make_pair(info.id, info)); updated(updateSerial(0, "adapter added `" + info.id + "'")); } @@ -200,7 +200,7 @@ public: adapterUpdated(const AdapterInfo& info, const Ice::Current&) { Lock sync(*this); - this->adapters[info.id] = info; + adapters[info.id] = info; updated(updateSerial(0, "adapter updated `" + info.id + "'")); } @@ -208,7 +208,7 @@ public: adapterRemoved(const string& id, const Ice::Current&) { Lock sync(*this); - this->adapters.erase(id); + adapters.erase(id); updated(updateSerial(0, "adapter removed `" + id + "'")); } @@ -218,9 +218,9 @@ public: private: string - updateSerial(int serial, const string& update) + updateSerial(int serialP, const string& update) { - this->serial = serial; + serial = serialP; ostringstream os; os << update << " (serial = " << serial << ")"; return os.str(); @@ -237,12 +237,12 @@ public: } virtual void - objectInit(const ObjectInfoSeq& objects, const Ice::Current&) + objectInit(const ObjectInfoSeq& objectsP, const Ice::Current&) { Lock sync(*this); - for(ObjectInfoSeq::const_iterator r = objects.begin(); r != objects.end(); ++r) + for(ObjectInfoSeq::const_iterator r = objectsP.begin(); r != objectsP.end(); ++r) { - this->objects.insert(make_pair(r->proxy->ice_getIdentity(), *r)); + objects.insert(make_pair(r->proxy->ice_getIdentity(), *r)); } updated(updateSerial(0, "init update")); } @@ -251,7 +251,7 @@ public: objectAdded(const ObjectInfo& info, const Ice::Current&) { Lock sync(*this); - this->objects.insert(make_pair(info.proxy->ice_getIdentity(), info)); + objects.insert(make_pair(info.proxy->ice_getIdentity(), info)); updated(updateSerial(0, "object added `" + info.proxy->ice_toString() + "'")); } @@ -259,7 +259,7 @@ public: objectUpdated(const ObjectInfo& info, const Ice::Current&) { Lock sync(*this); - this->objects[info.proxy->ice_getIdentity()] = info; + objects[info.proxy->ice_getIdentity()] = info; updated(updateSerial(0, "object updated `" + info.proxy->ice_toString() + "'")); } @@ -267,7 +267,7 @@ public: objectRemoved(const Ice::Identity& id, const Ice::Current& current) { Lock sync(*this); - this->objects.erase(id); + objects.erase(id); updated(updateSerial(0, "object removed `" + current.adapter->getCommunicator()->identityToString(id) + "'")); } @@ -278,9 +278,9 @@ public: private: string - updateSerial(int serial, const string& update) + updateSerial(int serialP, const string& update) { - this->serial = serial; + serial = serialP; ostringstream os; os << update << " (serial = " << serial << ")"; return os.str(); diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp index 5955947676e..851f7ffe0c9 100644 --- a/cpp/test/IceSSL/configuration/AllTests.cpp +++ b/cpp/test/IceSSL/configuration/AllTests.cpp @@ -392,7 +392,7 @@ class ImportCerts { public: - ImportCerts(const string& defaultDir, const char* certificates[]) + ImportCerts(const string& /*defaultDir*/, const char* /*certificates*/[]) { // Nothing to do. } @@ -1634,9 +1634,9 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) test(fact); { - Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_ca1", ""); + d = createServerProps(defaultProps, p12, "s_rsa_ca1", ""); d["IceSSL.VerifyPeer"] = "0"; - Test::ServerPrxPtr server = fact->createServer(d); + server = fact->createServer(d); try { info = ICE_DYNAMIC_CAST(IceSSL::ConnectionInfo, server->ice_getConnection()->getInfo()); @@ -1670,9 +1670,9 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) test(fact); { - Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_cai1", ""); + d = createServerProps(defaultProps, p12, "s_rsa_cai1", ""); d["IceSSL.VerifyPeer"] = "0"; - Test::ServerPrxPtr server = fact->createServer(d); + server = fact->createServer(d); try { server->ice_getConnection()->getInfo(); @@ -1704,9 +1704,9 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef)); test(fact); { - Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_cai1", ""); + d = createServerProps(defaultProps, p12, "s_rsa_cai1", ""); d["IceSSL.VerifyPeer"] = "0"; - Test::ServerPrxPtr server = fact->createServer(d); + server = fact->createServer(d); try { info = ICE_DYNAMIC_CAST(IceSSL::ConnectionInfo, server->ice_getConnection()->getInfo()); @@ -1723,9 +1723,9 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) } { - Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_cai2", ""); + d = createServerProps(defaultProps, p12, "s_rsa_cai2", ""); d["IceSSL.VerifyPeer"] = "0"; - Test::ServerPrxPtr server = fact->createServer(d); + server = fact->createServer(d); try { server->ice_getConnection()->getInfo(); @@ -1752,9 +1752,9 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) test(fact); { - Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_cai2", ""); + d = createServerProps(defaultProps, p12, "s_rsa_cai2", ""); d["IceSSL.VerifyPeer"] = "0"; - Test::ServerPrxPtr server = fact->createServer(d); + server = fact->createServer(d); try { info = ICE_DYNAMIC_CAST(IceSSL::ConnectionInfo, server->ice_getConnection()->getInfo()); @@ -1784,9 +1784,9 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) test(fact); { - Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_cai2", "cacert1"); + d = createServerProps(defaultProps, p12, "s_rsa_cai2", "cacert1"); d["IceSSL.VerifyPeer"] = "2"; - Test::ServerPrxPtr server = fact->createServer(d); + server = fact->createServer(d); try { server->ice_getConnection(); @@ -1811,10 +1811,10 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) } { - Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_cai2", "cacert1"); + d = createServerProps(defaultProps, p12, "s_rsa_cai2", "cacert1"); d["IceSSL.VerifyPeer"] = "2"; d["IceSSL.VerifyDepthMax"] = "4"; - Test::ServerPrxPtr server = fact->createServer(d); + server = fact->createServer(d); try { server->ice_getConnection(); @@ -1937,8 +1937,8 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) CertificateVerifierIPtr verifier = ICE_MAKE_SHARED(CertificateVerifierI); #ifdef ICE_CPP11_MAPPING - plugin->setCertificateVerifier([verifier](const shared_ptr<IceSSL::ConnectionInfo>& info) - { return verifier->verify(info); }); + plugin->setCertificateVerifier([verifier](const shared_ptr<IceSSL::ConnectionInfo>& infoP) + { return verifier->verify(infoP); }); #else plugin->setCertificateVerifier(verifier); #endif @@ -2013,8 +2013,8 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) CertificateVerifierIPtr verifier = ICE_MAKE_SHARED(CertificateVerifierI); #ifdef ICE_CPP11_MAPPING - plugin->setCertificateVerifier([verifier](const shared_ptr<IceSSL::ConnectionInfo>& info) - { return verifier->verify(info); }); + plugin->setCertificateVerifier([verifier](const shared_ptr<IceSSL::ConnectionInfo>& infoP) + { return verifier->verify(infoP); }); #else plugin->setCertificateVerifier(verifier); #endif @@ -2046,72 +2046,74 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) cout << "testing protocols... " << flush; { # ifndef ICE_USE_SECURE_TRANSPORT - // - // This should fail because the client and server have no protocol - // in common. - // - InitializationData initData; - initData.properties = createClientProps(defaultProps, p12, "c_rsa_ca1", "cacert1"); - initData.properties->setProperty("IceSSL.VerifyPeer", "0"); - initData.properties->setProperty("IceSSL.Protocols", "tls1_1"); - CommunicatorPtr comm = initialize(initData); - - Test::ServerFactoryPrxPtr fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef)); - test(fact); - Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_ca1", "cacert1"); - d["IceSSL.VerifyPeer"] = "0"; - d["IceSSL.Protocols"] = "tls1_2"; - Test::ServerPrxPtr server = fact->createServer(d); - try - { - server->ice_ping(); - test(false); - } - catch(const ProtocolException&) - { - // Expected on some platforms. - } - catch(const ConnectionLostException&) - { - // Expected on some platforms. - } - catch(const LocalException& ex) - { - cerr << ex << endl; - test(false); - } - fact->destroyServer(server); - comm->destroy(); - - // - // This should succeed. - // - comm = initialize(initData); - fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef)); - test(fact); - d = createServerProps(defaultProps, p12, "s_rsa_ca1", "cacert1"); - d["IceSSL.VerifyPeer"] = "0"; - d["IceSSL.Protocols"] = "tls1_1, tls1_2"; - server = fact->createServer(d); - try - { - server->ice_ping(); - } - catch(const LocalException& ex) { // - // OpenSSL < 1.0 doesn't support tls 1.1 so it will fail, we ignore the error in this case. + // This should fail because the client and server have no protocol + // in common. // -#ifdef ICE_USE_OPENSSL - if(openSSLVersion < 0x1000000) -#endif + InitializationData initData; + initData.properties = createClientProps(defaultProps, p12, "c_rsa_ca1", "cacert1"); + initData.properties->setProperty("IceSSL.VerifyPeer", "0"); + initData.properties->setProperty("IceSSL.Protocols", "tls1_1"); + CommunicatorPtr comm = initialize(initData); + + Test::ServerFactoryPrxPtr fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef)); + test(fact); + Test::Properties d = createServerProps(defaultProps, p12, "s_rsa_ca1", "cacert1"); + d["IceSSL.VerifyPeer"] = "0"; + d["IceSSL.Protocols"] = "tls1_2"; + Test::ServerPrxPtr server = fact->createServer(d); + try + { + server->ice_ping(); + test(false); + } + catch(const ProtocolException&) + { + // Expected on some platforms. + } + catch(const ConnectionLostException&) + { + // Expected on some platforms. + } + catch(const LocalException& ex) { cerr << ex << endl; test(false); } + fact->destroyServer(server); + comm->destroy(); + + // + // This should succeed. + // + comm = initialize(initData); + fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef)); + test(fact); + d = createServerProps(defaultProps, p12, "s_rsa_ca1", "cacert1"); + d["IceSSL.VerifyPeer"] = "0"; + d["IceSSL.Protocols"] = "tls1_1, tls1_2"; + server = fact->createServer(d); + try + { + server->ice_ping(); + } + catch(const LocalException& ex) + { + // + // OpenSSL < 1.0 doesn't support tls 1.1 so it will fail, we ignore the error in this case. + // +#ifdef ICE_USE_OPENSSL + if(openSSLVersion < 0x1000000) +#endif + { + cerr << ex << endl; + test(false); + } + } + fact->destroyServer(server); + comm->destroy(); } - fact->destroyServer(server); - comm->destroy(); // // This should fail because the client only accept SSLv3 and the server @@ -2187,69 +2189,71 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) // enabled protocol versions. See the test bellow. // - // - // This should fail because the client and server have no protocol - // in common. - // - InitializationData initData; - initData.properties = createClientProps(defaultProps, p12); - initData.properties->setProperty("IceSSL.Ciphers", "(DH_anon*)"); - initData.properties->setProperty("IceSSL.VerifyPeer", "0"); - initData.properties->setProperty("IceSSL.ProtocolVersionMax", "tls1"); - initData.properties->setProperty("IceSSL.ProtocolVersionMin", "tls1"); - CommunicatorPtr comm = initialize(initData); - Test::ServerFactoryPrxPtr fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef)); - test(fact); - Test::Properties d = createServerProps(defaultProps, p12); - d["IceSSL.Ciphers"] = "(DH_anon*)"; - d["IceSSL.VerifyPeer"] = "0"; - d["IceSSL.ProtocolVersionMax"] = "tls1_2"; - d["IceSSL.ProtocolVersionMin"] = "tls1_2"; - Test::ServerPrxPtr server = fact->createServer(d); - try - { - server->ice_ping(); - test(false); - } - catch(const ProtocolException&) - { - // Expected on some platforms. - } - catch(const ConnectionLostException&) { - // Expected on some platforms. - } - catch(const LocalException& ex) - { - cerr << ex << endl; - test(false); - } - fact->destroyServer(server); - comm->destroy(); + // + // This should fail because the client and server have no protocol + // in common. + // + InitializationData initData; + initData.properties = createClientProps(defaultProps, p12); + initData.properties->setProperty("IceSSL.Ciphers", "(DH_anon*)"); + initData.properties->setProperty("IceSSL.VerifyPeer", "0"); + initData.properties->setProperty("IceSSL.ProtocolVersionMax", "tls1"); + initData.properties->setProperty("IceSSL.ProtocolVersionMin", "tls1"); + CommunicatorPtr comm = initialize(initData); + Test::ServerFactoryPrxPtr fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef)); + test(fact); + Test::Properties d = createServerProps(defaultProps, p12); + d["IceSSL.Ciphers"] = "(DH_anon*)"; + d["IceSSL.VerifyPeer"] = "0"; + d["IceSSL.ProtocolVersionMax"] = "tls1_2"; + d["IceSSL.ProtocolVersionMin"] = "tls1_2"; + Test::ServerPrxPtr server = fact->createServer(d); + try + { + server->ice_ping(); + test(false); + } + catch(const ProtocolException&) + { + // Expected on some platforms. + } + catch(const ConnectionLostException&) + { + // Expected on some platforms. + } + catch(const LocalException& ex) + { + cerr << ex << endl; + test(false); + } + fact->destroyServer(server); + comm->destroy(); - // - // This should succeed. - // - comm = initialize(initData); - fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef)); - test(fact); - d = createServerProps(defaultProps, p12); - d["IceSSL.Ciphers"] = "(DH_anon*)"; - d["IceSSL.VerifyPeer"] = "0"; - d["IceSSL.ProtocolVersionMax"] = "tls1"; - d["IceSSL.ProtocolVersionMin"] = "ssl3"; - server = fact->createServer(d); - try - { - server->ice_ping(); - } - catch(const LocalException& ex) - { - cerr << ex << endl; - test(false); + // + // This should succeed. + // + comm = initialize(initData); + fact = ICE_CHECKED_CAST(Test::ServerFactoryPrx, comm->stringToProxy(factoryRef)); + test(fact); + d = createServerProps(defaultProps, p12); + d["IceSSL.Ciphers"] = "(DH_anon*)"; + d["IceSSL.VerifyPeer"] = "0"; + d["IceSSL.ProtocolVersionMax"] = "tls1"; + d["IceSSL.ProtocolVersionMin"] = "ssl3"; + server = fact->createServer(d); + try + { + server->ice_ping(); + } + catch(const LocalException& ex) + { + cerr << ex << endl; + test(false); + } + fact->destroyServer(server); + comm->destroy(); } - fact->destroyServer(server); - comm->destroy(); // // This should fail because the client only accept SSLv3 and the server @@ -4254,9 +4258,9 @@ allTests(Test::TestHelper* helper, const string& testDir, bool p12) { try { - Ice::WSConnectionInfoPtr info = + Ice::WSConnectionInfoPtr wsinfo = ICE_DYNAMIC_CAST(Ice::WSConnectionInfo, p->ice_getConnection()->getInfo()); - IceSSL::ConnectionInfoPtr sslInfo = ICE_DYNAMIC_CAST(IceSSL::ConnectionInfo, info->underlying); + IceSSL::ConnectionInfoPtr sslInfo = ICE_DYNAMIC_CAST(IceSSL::ConnectionInfo, wsinfo->underlying); test(sslInfo->verified); break; } diff --git a/cpp/test/IceStorm/stress/Subscriber.cpp b/cpp/test/IceStorm/stress/Subscriber.cpp index 59cfb0fabcd..4aef857a90b 100644 --- a/cpp/test/IceStorm/stress/Subscriber.cpp +++ b/cpp/test/IceStorm/stress/Subscriber.cpp @@ -169,7 +169,7 @@ public: current.adapter->deactivate(); _count = _total; { - IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(_remainingMutex); + IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync2(_remainingMutex); --_remaining; if(_remaining == 0) { diff --git a/cpp/test/IceUtil/ctrlCHandler/Client.cpp b/cpp/test/IceUtil/ctrlCHandler/Client.cpp index 05be89e95a2..a1f8514bd07 100644 --- a/cpp/test/IceUtil/ctrlCHandler/Client.cpp +++ b/cpp/test/IceUtil/ctrlCHandler/Client.cpp @@ -28,7 +28,7 @@ public: }; void -Client::run(int argc, char** argv) +Client::run(int, char**) { { cout << "First ignore CTRL+C and the like for 10 seconds (try it!)" << endl; diff --git a/cpp/test/IceUtil/priority/Client.cpp b/cpp/test/IceUtil/priority/Client.cpp index 47112d2f4ea..f613aa1925c 100644 --- a/cpp/test/IceUtil/priority/Client.cpp +++ b/cpp/test/IceUtil/priority/Client.cpp @@ -43,7 +43,7 @@ public: }; void -Client::run(int argc, char** argv) +Client::run(int, char**) { initializeTestSuite(); diff --git a/cpp/test/IceUtil/sha1/Client.cpp b/cpp/test/IceUtil/sha1/Client.cpp index 6e47a29045a..c03fb34713e 100644 --- a/cpp/test/IceUtil/sha1/Client.cpp +++ b/cpp/test/IceUtil/sha1/Client.cpp @@ -83,7 +83,7 @@ public: }; void -Client::run(int argc, char* argv[]) +Client::run(int, char*[]) { cout << "Testing sha1 hash computation... "; for(int i = 0; i < itemsSize; ++i) diff --git a/cpp/test/IceUtil/stacktrace/Client.cpp b/cpp/test/IceUtil/stacktrace/Client.cpp index 7a5d2a50aa1..9055a00ef41 100644 --- a/cpp/test/IceUtil/stacktrace/Client.cpp +++ b/cpp/test/IceUtil/stacktrace/Client.cpp @@ -104,7 +104,7 @@ public: }; void -Client::run(int argc, char* argv[]) +Client::run(int, char*[]) { if(IceUtilInternal::stackTraceImpl() == IceUtilInternal::STNone) { diff --git a/cpp/test/IceUtil/thread/Client.cpp b/cpp/test/IceUtil/thread/Client.cpp index 23464f642d0..574bb220424 100644 --- a/cpp/test/IceUtil/thread/Client.cpp +++ b/cpp/test/IceUtil/thread/Client.cpp @@ -23,7 +23,7 @@ public: }; void -Client::run(int argc, char** argv) +Client::run(int, char**) { initializeTestSuite(); diff --git a/cpp/test/IceUtil/thread/StartTest.cpp b/cpp/test/IceUtil/thread/StartTest.cpp index eef50038b47..6f32a98bf41 100644 --- a/cpp/test/IceUtil/thread/StartTest.cpp +++ b/cpp/test/IceUtil/thread/StartTest.cpp @@ -64,8 +64,8 @@ StartTest::run() { for(int j = 0; j < 40; j++) { - Thread* t = new StartTestThread; - t->start().detach(); + Thread* thread = new StartTestThread; + thread->start().detach(); } ThreadControl::sleep(Time::milliSeconds(5)); } diff --git a/cpp/test/IceUtil/timer/Client.cpp b/cpp/test/IceUtil/timer/Client.cpp index 1c8a1c5166a..41e528f8c38 100644 --- a/cpp/test/IceUtil/timer/Client.cpp +++ b/cpp/test/IceUtil/timer/Client.cpp @@ -161,7 +161,7 @@ public: }; void -Client::run(int, char* argv[]) +Client::run(int, char*[]) { cout << "testing timer... " << flush; { diff --git a/cpp/test/Slice/macros/Client.cpp b/cpp/test/Slice/macros/Client.cpp index 308a5e53e70..7ef1075ee13 100644 --- a/cpp/test/Slice/macros/Client.cpp +++ b/cpp/test/Slice/macros/Client.cpp @@ -22,7 +22,7 @@ public: }; void -Client::run(int argc, char** argv) +Client::run(int, char**) { cout << "testing Slice predefined macros... " << flush; DefaultPtr d = ICE_MAKE_SHARED(Default); |