diff options
Diffstat (limited to 'cpp/test')
21 files changed, 451 insertions, 223 deletions
diff --git a/cpp/test/Ice/acm/AllTests.cpp b/cpp/test/Ice/acm/AllTests.cpp index f9ca74170f4..d9e81d9370d 100644 --- a/cpp/test/Ice/acm/AllTests.cpp +++ b/cpp/test/Ice/acm/AllTests.cpp @@ -166,7 +166,7 @@ public: } #ifdef ICE_CPP11_MAPPING - void join(thread& t) + void join(std::thread& t) #else void join() #endif @@ -735,11 +735,11 @@ allTests(Test::TestHelper* helper) } #ifdef ICE_CPP11_MAPPING - vector<pair<thread, TestCasePtr>> threads; + vector<pair<std::thread, TestCasePtr>> threads; for(auto p = tests.begin(); p != tests.end(); ++p) { TestCasePtr testCase = *p; - thread t([testCase]() + std::thread t([testCase]() { testCase->run(); }); diff --git a/cpp/test/Ice/impl/Makefile.mk b/cpp/test/Ice/impl/Makefile.mk index e0b294005f9..d3843d4906d 100644 --- a/cpp/test/Ice/impl/Makefile.mk +++ b/cpp/test/Ice/impl/Makefile.mk @@ -36,4 +36,8 @@ endef $(test)_component_with_config_extensions = make-impl-with-config +ifeq ($(xlc_compiler),yes) + $(test)_cppflags += -qsuppress="1540-0895" +endif + tests += $(test) diff --git a/cpp/test/Ice/interceptor/AMDInterceptorI.cpp b/cpp/test/Ice/interceptor/AMDInterceptorI.cpp index 33cfb5e0b38..158cf2736fa 100644 --- a/cpp/test/Ice/interceptor/AMDInterceptorI.cpp +++ b/cpp/test/Ice/interceptor/AMDInterceptorI.cpp @@ -4,7 +4,7 @@ #include <IceUtil/DisableWarnings.h> #include <AMDInterceptorI.h> -#include <Test.h> +#include <MyObjectI.h> #include <TestHelper.h> using namespace std; @@ -56,6 +56,24 @@ AMDInterceptorI::dispatch(Ice::Request& request) #endif Ice::Current& current = const_cast<Ice::Current&>(request.getCurrent()); + + Ice::Context::const_iterator p = current.ctx.find("raiseBeforeDispatch"); + if(p != current.ctx.end()) + { + if(p->second == "user") + { + throw Test::InvalidInputException(); + } + else if(p->second == "notExist") + { + throw Ice::ObjectNotExistException(__FILE__, __LINE__); + } + else if(p->second == "system") + { + throw MySystemException(__FILE__, __LINE__); + } + } + _lastOperation = current.operation; if(_lastOperation == "amdAddWithRetry") @@ -85,6 +103,15 @@ AMDInterceptorI::dispatch(Ice::Request& request) current.ctx["retry"] = "no"; } + else if(current.ctx.find("retry") != current.ctx.end() && current.ctx["retry"] == "yes") + { + // + // Retry the dispatch to ensure that abandoning the result of the dispatch + // works fine and is thread-safe + // + _servant->ice_dispatch(request); + _servant->ice_dispatch(request); + } #ifdef ICE_CPP11_MAPPING _lastStatus = _servant->ice_dispatch(request, []() { return true; }, [this](exception_ptr ex) { @@ -105,6 +132,24 @@ AMDInterceptorI::dispatch(Ice::Request& request) #else _lastStatus = _servant->ice_dispatch(request, _defaultCb); #endif + + p = current.ctx.find("raiseAfterDispatch"); + if(p != current.ctx.end()) + { + if(p->second == "user") + { + throw Test::InvalidInputException(); + } + else if(p->second == "notExist") + { + throw Ice::ObjectNotExistException(__FILE__, __LINE__); + } + else if(p->second == "system") + { + throw MySystemException(__FILE__, __LINE__); + } + } + return _lastStatus; } diff --git a/cpp/test/Ice/interceptor/Client.cpp b/cpp/test/Ice/interceptor/Client.cpp index fd7c8314d26..02317c19d2c 100644 --- a/cpp/test/Ice/interceptor/Client.cpp +++ b/cpp/test/Ice/interceptor/Client.cpp @@ -35,6 +35,7 @@ private: void runTest(const Test::MyObjectPrxPtr&, const InterceptorIPtr&); void runAmdTest(const Test::MyObjectPrxPtr&, const AMDInterceptorIPtr&); + void testInterceptorExceptions(const Test::MyObjectPrxPtr&); }; void @@ -169,6 +170,10 @@ Client::runTest(const Test::MyObjectPrxPtr& prx, const InterceptorIPtr& intercep test(interceptor->getLastOperation() == "amdAdd"); test(!interceptor->getLastStatus()); cout << "ok" << endl; + + cout << "testing exceptions raised by the interceptor... " << flush; + testInterceptorExceptions(prx); + cout << "ok" << endl; } void @@ -184,6 +189,16 @@ Client::runAmdTest(const Test::MyObjectPrxPtr& prx, const AMDInterceptorIPtr& in test(prx->amdAddWithRetry(33, 12) == 45); test(interceptor->getLastOperation() == "amdAddWithRetry"); test(!interceptor->getLastStatus()); + { + Ice::Context ctx; + ctx["retry"] = "yes"; + for(int i = 0; i < 10; ++i) + { + test(prx->amdAdd(33, 12, ctx) == 45); + test(interceptor->getLastOperation() == "amdAdd"); + test(!interceptor->getLastStatus()); + } + } cout << "ok" << endl; cout << "testing user exception... " << flush; try @@ -234,6 +249,59 @@ Client::runAmdTest(const Test::MyObjectPrxPtr& prx, const AMDInterceptorIPtr& in test(!interceptor->getLastStatus()); test(dynamic_cast<MySystemException*>(interceptor->getException()) != 0); cout << "ok" << endl; + + cout << "testing exceptions raised by the interceptor... " << flush; + testInterceptorExceptions(prx); + cout << "ok" << endl; +} + +void +Client::testInterceptorExceptions(const Test::MyObjectPrxPtr& prx) +{ + vector<pair<string, string> > exceptions; + exceptions.push_back(make_pair("raiseBeforeDispatch", "user")); + exceptions.push_back(make_pair("raiseBeforeDispatch", "notExist")); + exceptions.push_back(make_pair("raiseBeforeDispatch", "system")); + exceptions.push_back(make_pair("raiseAfterDispatch", "user")); + exceptions.push_back(make_pair("raiseAfterDispatch", "notExist")); + exceptions.push_back(make_pair("raiseAfterDispatch", "system")); + for(vector<pair<string, string> >::const_iterator p = exceptions.begin(); p != exceptions.end(); ++p) + { + Ice::Context ctx; + ctx[p->first] = p->second; + try + { + prx->ice_ping(ctx); + test(false); + } + catch(const Ice::UnknownUserException&) + { + test(p->second == "user"); + } + catch(const Ice::ObjectNotExistException&) + { + test(p->second == "notExist"); + } + catch(const Ice::UnknownException&) + { + test(p->second == "system"); // non-collocated + } + catch(const MySystemException&) + { + test(p->second == "system"); // collocated + } + { + Ice::ObjectPrxPtr batch = prx->ice_batchOneway(); + batch->ice_ping(ctx); + batch->ice_ping(); + batch->ice_flushBatchRequests(); + + // Force the last batch request to be dispatched by the server thread using invocation timeouts + // This is required to preven threading issue with the test interceptor implementation which + // isn't thread safe + prx->ice_invocationTimeout(10000)->ice_ping(); + } + } } DEFINE_TEST(Client) diff --git a/cpp/test/Ice/interceptor/InterceptorI.cpp b/cpp/test/Ice/interceptor/InterceptorI.cpp index 04b60f7a8f6..171aaf0c25a 100644 --- a/cpp/test/Ice/interceptor/InterceptorI.cpp +++ b/cpp/test/Ice/interceptor/InterceptorI.cpp @@ -3,7 +3,7 @@ // #include <InterceptorI.h> -#include <Test.h> +#include <MyObjectI.h> #include <TestHelper.h> using namespace std; @@ -18,6 +18,24 @@ bool InterceptorI::dispatch(Ice::Request& request) { Ice::Current& current = const_cast<Ice::Current&>(request.getCurrent()); + + Ice::Context::const_iterator p = current.ctx.find("raiseBeforeDispatch"); + if(p != current.ctx.end()) + { + if(p->second == "user") + { + throw Test::InvalidInputException(); + } + else if(p->second == "notExist") + { + throw Ice::ObjectNotExistException(__FILE__, __LINE__); + } + else if(p->second == "system") + { + throw MySystemException(__FILE__, __LINE__); + } + } + _lastOperation = current.operation; if(_lastOperation == "addWithRetry") @@ -39,7 +57,26 @@ InterceptorI::dispatch(Ice::Request& request) current.ctx["retry"] = "no"; } + _lastStatus = _servant->ice_dispatch(request); + + p = current.ctx.find("raiseAfterDispatch"); + if(p != current.ctx.end()) + { + if(p->second == "user") + { + throw Test::InvalidInputException(); + } + else if(p->second == "notExist") + { + throw Ice::ObjectNotExistException(__FILE__, __LINE__); + } + else if(p->second == "system") + { + throw MySystemException(__FILE__, __LINE__); + } + } + return _lastStatus; } diff --git a/cpp/test/Ice/interceptor/MyObjectI.cpp b/cpp/test/Ice/interceptor/MyObjectI.cpp index b21c01c7a9b..f3164ac4426 100644 --- a/cpp/test/Ice/interceptor/MyObjectI.cpp +++ b/cpp/test/Ice/interceptor/MyObjectI.cpp @@ -83,13 +83,22 @@ MyObjectI::amdAddAsync(int x, int y, function<void(int)> response, function<void(exception_ptr)>, - const Ice::Current&) + const Ice::Current& current) { - thread t( - [x, y, response]() + Ice::Context::const_iterator p = current.ctx.find("retry"); + bool retry = p != current.ctx.end(); + std::thread t( + [x, y, response, retry]() { this_thread::sleep_for(chrono::milliseconds(10)); - response(x + y); + try + { + response(x + y); + } + catch(const Ice::ResponseSentException&) + { + test(retry); + } }); t.detach(); } @@ -101,7 +110,7 @@ MyObjectI::amdAddWithRetryAsync(int x, function<void(exception_ptr)> error, const Ice::Current& current) { - thread t( + std::thread t( [x, y, response]() { try @@ -137,7 +146,7 @@ MyObjectI::amdBadAddAsync(int, function<void(exception_ptr)> error, const Ice::Current&) { - thread t( + std::thread t( [error]() { this_thread::sleep_for(chrono::milliseconds(10)); @@ -160,7 +169,7 @@ MyObjectI::amdNotExistAddAsync(int, function<void(exception_ptr)> error, const Ice::Current&) { - thread t( + std::thread t( [error]() { this_thread::sleep_for(chrono::milliseconds(10)); @@ -183,7 +192,7 @@ MyObjectI::amdBadSystemAddAsync(int, function<void(exception_ptr)> error, const Ice::Current&) { - thread t( + std::thread t( [error]() { this_thread::sleep_for(chrono::milliseconds(10)); @@ -200,31 +209,42 @@ MyObjectI::amdBadSystemAddAsync(int, } #else void -MyObjectI::amdAdd_async(const Test::AMD_MyObject_amdAddPtr& cb, int x, int y, const Ice::Current&) +MyObjectI::amdAdd_async(const Test::AMD_MyObject_amdAddPtr& cb, int x, int y, const Ice::Current& current) { class ThreadI : public Thread { public: - ThreadI(const Test::AMD_MyObject_amdAddPtr& cb, int x, int y) : + ThreadI(const Test::AMD_MyObject_amdAddPtr& cb, int x, int y, bool retry) : _cb(cb), _x(x), - _y(y) + _y(y), + _retry(retry) { } void run() { ThreadControl::sleep(Time::milliSeconds(10)); - _cb->ice_response(_x + _y); + try + { + _cb->ice_response(_x + _y); + } + catch(const Ice::ResponseSentException&) + { + test(_retry); + } } private: Test::AMD_MyObject_amdAddPtr _cb; int _x; int _y; + bool _retry; }; - ThreadPtr thread = new ThreadI(cb, x, y); + Ice::Context::const_iterator p = current.ctx.find("retry"); + bool retry = p != current.ctx.end(); + ThreadPtr thread = new ThreadI(cb, x, y, retry); thread->start().detach(); } diff --git a/cpp/test/Ice/metrics/AllTests.cpp b/cpp/test/Ice/metrics/AllTests.cpp index 3e3e40cf19e..1beef435bb5 100644 --- a/cpp/test/Ice/metrics/AllTests.cpp +++ b/cpp/test/Ice/metrics/AllTests.cpp @@ -965,7 +965,7 @@ allTests(Test::TestHelper* helper, const CommunicatorObserverIPtr& obsv) cout << "testing invocation metrics... " << flush; props["IceMX.Metrics.View.Map.Invocation.GroupBy"] = "operation"; - props["IceMX.Metrics.View.Map.Invocation.Map.Remote.GroupBy"] = "localPort"; + props["IceMX.Metrics.View.Map.Invocation.Map.Remote.GroupBy"] = "id"; props["IceMX.Metrics.View.Map.Invocation.Map.Collocated.GroupBy"] = "parent"; updateProps(clientProps, serverProps, update.get(), props, "Invocation"); test(serverMetrics->getMetricsView("View", timestamp)["Invocation"].empty()); @@ -1323,13 +1323,9 @@ allTests(Test::TestHelper* helper, const CommunicatorObserverIPtr& obsv) if(!collocated) { im1 = ICE_DYNAMIC_CAST(IceMX::InvocationMetrics, map["fail"]); - test(im1->current <= 1 && im1->total == 3 && im1->failures == 3 && im1->retry == 3 && im1->remotes.size() == 6); - test(im1->remotes[0]->current == 0 && im1->remotes[0]->total == 1 && im1->remotes[0]->failures == 1); - test(im1->remotes[1]->current == 0 && im1->remotes[1]->total == 1 && im1->remotes[1]->failures == 1); - test(im1->remotes[2]->current == 0 && im1->remotes[2]->total == 1 && im1->remotes[2]->failures == 1); - test(im1->remotes[3]->current == 0 && im1->remotes[3]->total == 1 && im1->remotes[3]->failures == 1); - test(im1->remotes[4]->current == 0 && im1->remotes[4]->total == 1 && im1->remotes[4]->failures == 1); - test(im1->remotes[5]->current == 0 && im1->remotes[5]->total == 1 && im1->remotes[5]->failures == 1); + test(im1->current <= 1 && im1->total == 3 && im1->failures == 3 && im1->retry == 3 && im1->remotes.size() == 1); + rim1 = ICE_DYNAMIC_CAST(IceMX::ChildInvocationMetrics, im1->remotes[0]); + test(rim1->current == 0 && rim1->total == 6 && rim1->failures == 6); checkFailure(clientMetrics, "Invocation", im1->id, "::Ice::ConnectionLostException", 3); } diff --git a/cpp/test/Ice/operations/BatchOnewaysAMI.cpp b/cpp/test/Ice/operations/BatchOnewaysAMI.cpp index 9684545a6ac..59de2c74fc3 100644 --- a/cpp/test/Ice/operations/BatchOnewaysAMI.cpp +++ b/cpp/test/Ice/operations/BatchOnewaysAMI.cpp @@ -8,7 +8,12 @@ using namespace std; +// Work-around for anonymous namspace bug in xlclang++ +#ifdef __ibmxl__ +namespace BatchOnewaysAMINamespace +#else namespace +#endif { class Callback : public IceUtil::Monitor<IceUtil::Mutex>, public IceUtil::Shared @@ -85,6 +90,10 @@ public: }; } +#ifdef __ibmxl__ +using namespace BatchOnewaysAMINamespace; +#endif + void batchOnewaysAMI(const Test::MyClassPrxPtr& p) { diff --git a/cpp/test/Ice/operations/OnewaysAMI.cpp b/cpp/test/Ice/operations/OnewaysAMI.cpp index bd3fc9241f7..2b73c141ee4 100644 --- a/cpp/test/Ice/operations/OnewaysAMI.cpp +++ b/cpp/test/Ice/operations/OnewaysAMI.cpp @@ -8,7 +8,12 @@ using namespace std; +// Work-around for anonymous namspace bug in xlclang++ +#ifdef __ibmxl__ +namespace OnewaysAMINamespace +#else namespace +#endif { class CallbackBase @@ -75,6 +80,10 @@ ICE_DEFINE_PTR(CallbackPtr, Callback); } +#ifdef __ibmxl__ +using namespace OnewaysAMINamespace; +#endif + void onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) { diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index e71852c300a..985a49034f5 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -22,7 +22,7 @@ #endif using namespace std; -using namespace Test; + namespace { @@ -157,8 +157,8 @@ public: void opMyEnum(Test::MyEnum r, Test::MyEnum e) { - test(e == ICE_ENUM(Test::MyEnum, enum2)); - test(r == ICE_ENUM(Test::MyEnum, enum3)); + test(e == Test::ICE_ENUM(MyEnum, enum2)); + test(r == Test::ICE_ENUM(MyEnum, enum3)); called(); } @@ -190,9 +190,9 @@ public: void opStruct(const Test::Structure& rso, const Test::Structure& so) { test(rso.p == 0); - test(rso.e == ICE_ENUM(Test::MyEnum, enum2)); + test(rso.e == Test::ICE_ENUM(MyEnum, enum2)); test(rso.s.s == "def"); - test(so.e == ICE_ENUM(Test::MyEnum, enum3)); + test(so.e == Test::ICE_ENUM(MyEnum, enum3)); test(so.s.s == "a new string"); // @@ -497,18 +497,18 @@ public: void opStringMyEnumD(const Test::StringMyEnumD& ro, const Test::StringMyEnumD& _do) { Test::StringMyEnumD di1; - di1["abc"] = ICE_ENUM(Test::MyEnum, enum1); - di1[""] = ICE_ENUM(Test::MyEnum, enum2); + di1["abc"] = Test::ICE_ENUM(MyEnum, enum1); + di1[""] = Test::ICE_ENUM(MyEnum, enum2); test(_do == di1); test(ro.size() == 4); test(ro.find("abc") != ro.end()); - test(ro.find("abc")->second == ICE_ENUM(Test::MyEnum, enum1)); + test(ro.find("abc")->second == Test::ICE_ENUM(MyEnum, enum1)); test(ro.find("qwerty") != ro.end()); - test(ro.find("qwerty")->second == ICE_ENUM(Test::MyEnum, enum3)); + test(ro.find("qwerty")->second == Test::ICE_ENUM(MyEnum, enum3)); test(ro.find("") != ro.end()); - test(ro.find("")->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro.find("")->second == Test::ICE_ENUM(MyEnum, enum2)); test(ro.find("Hello!!") != ro.end()); - test(ro.find("Hello!!")->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro.find("Hello!!")->second == Test::ICE_ENUM(MyEnum, enum2)); called(); } @@ -517,20 +517,20 @@ public: Test::MyStruct ms11 = { 1, 1 }; Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); - di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = Test::ICE_ENUM(MyEnum, enum1); + di1[ms12] = Test::ICE_ENUM(MyEnum, enum2); test(_do == di1); Test::MyStruct ms22 = { 2, 2 }; Test::MyStruct ms23 = { 2, 3 }; test(ro.size() == 4); test(ro.find(ms11) != ro.end()); - test(ro.find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(ro.find(ms11)->second == Test::ICE_ENUM(MyEnum, enum1)); test(ro.find(ms12) != ro.end()); - test(ro.find(ms12)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro.find(ms12)->second == Test::ICE_ENUM(MyEnum, enum2)); test(ro.find(ms22) != ro.end()); - test(ro.find(ms22)->second == ICE_ENUM(Test::MyEnum, enum3)); + test(ro.find(ms22)->second == Test::ICE_ENUM(MyEnum, enum3)); test(ro.find(ms23) != ro.end()); - test(ro.find(ms23)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro.find(ms23)->second == Test::ICE_ENUM(MyEnum, enum2)); called(); } @@ -675,32 +675,32 @@ public: test(ro.size() == 2); test(ro[0].size() == 3); test(ro[0].find("abc") != ro[0].end()); - test(ro[0].find("abc")->second == ICE_ENUM(Test::MyEnum, enum1)); + test(ro[0].find("abc")->second == Test::ICE_ENUM(MyEnum, enum1)); test(ro[0].find("qwerty") != ro[0].end()); - test(ro[0].find("qwerty")->second == ICE_ENUM(Test::MyEnum, enum3)); + test(ro[0].find("qwerty")->second == Test::ICE_ENUM(MyEnum, enum3)); test(ro[0].find("Hello!!") != ro[0].end()); - test(ro[0].find("Hello!!")->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro[0].find("Hello!!")->second == Test::ICE_ENUM(MyEnum, enum2)); test(ro[1].size() == 2); test(ro[1].find("abc") != ro[1].end()); - test(ro[1].find("abc")->second == ICE_ENUM(Test::MyEnum, enum1)); + test(ro[1].find("abc")->second == Test::ICE_ENUM(MyEnum, enum1)); test(ro[1].find("") != ro[1].end()); - test(ro[1].find("")->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro[1].find("")->second == Test::ICE_ENUM(MyEnum, enum2)); test(_do.size() == 3); test(_do[0].size() == 1); test(_do[0].find("Goodbye") != _do[0].end()); - test(_do[0].find("Goodbye")->second == ICE_ENUM(Test::MyEnum, enum1)); + test(_do[0].find("Goodbye")->second == Test::ICE_ENUM(MyEnum, enum1)); test(_do[1].size() == 2); test(_do[1].find("abc") != _do[1].end()); - test(_do[1].find("abc")->second == ICE_ENUM(Test::MyEnum, enum1)); + test(_do[1].find("abc")->second == Test::ICE_ENUM(MyEnum, enum1)); test(_do[1].find("") != _do[1].end()); - test(_do[1].find("")->second == ICE_ENUM(Test::MyEnum, enum2)); + test(_do[1].find("")->second == Test::ICE_ENUM(MyEnum, enum2)); test(_do[2].size() == 3); test(_do[2].find("abc") != _do[2].end()); - test(_do[2].find("abc")->second == ICE_ENUM(Test::MyEnum, enum1)); + test(_do[2].find("abc")->second == Test::ICE_ENUM(MyEnum, enum1)); test(_do[2].find("qwerty") != _do[2].end()); - test(_do[2].find("qwerty")->second == ICE_ENUM(Test::MyEnum, enum3)); + test(_do[2].find("qwerty")->second == Test::ICE_ENUM(MyEnum, enum3)); test(_do[2].find("Hello!!") != _do[2].end()); - test(_do[2].find("Hello!!")->second == ICE_ENUM(Test::MyEnum, enum2)); + test(_do[2].find("Hello!!")->second == Test::ICE_ENUM(MyEnum, enum2)); called(); } @@ -708,25 +708,25 @@ public: { test(ro.size() == 2); test(ro[0].size() == 2); - test(ro[0].find(ICE_ENUM(Test::MyEnum, enum2)) != ro[0].end()); - test(ro[0].find(ICE_ENUM(Test::MyEnum, enum2))->second == "Hello!!"); - test(ro[0].find(ICE_ENUM(Test::MyEnum, enum3)) != ro[0].end()); - test(ro[0].find(ICE_ENUM(Test::MyEnum, enum3))->second == "qwerty"); + test(ro[0].find(Test::ICE_ENUM(MyEnum, enum2)) != ro[0].end()); + test(ro[0].find(Test::ICE_ENUM(MyEnum, enum2))->second == "Hello!!"); + test(ro[0].find(Test::ICE_ENUM(MyEnum, enum3)) != ro[0].end()); + test(ro[0].find(Test::ICE_ENUM(MyEnum, enum3))->second == "qwerty"); test(ro[1].size() == 1); - test(ro[1].find(ICE_ENUM(Test::MyEnum, enum1)) != ro[1].end()); - test(ro[1].find(ICE_ENUM(Test::MyEnum, enum1))->second == "abc"); + test(ro[1].find(Test::ICE_ENUM(MyEnum, enum1)) != ro[1].end()); + test(ro[1].find(Test::ICE_ENUM(MyEnum, enum1))->second == "abc"); test(_do.size() == 3); test(_do[0].size() == 1); - test(_do[0].find(ICE_ENUM(Test::MyEnum, enum1)) != _do[0].end()); - test(_do[0].find(ICE_ENUM(Test::MyEnum, enum1))->second == "Goodbye"); + test(_do[0].find(Test::ICE_ENUM(MyEnum, enum1)) != _do[0].end()); + test(_do[0].find(Test::ICE_ENUM(MyEnum, enum1))->second == "Goodbye"); test(_do[1].size() == 1); - test(_do[1].find(ICE_ENUM(Test::MyEnum, enum1)) != _do[1].end()); - test(_do[1].find(ICE_ENUM(Test::MyEnum, enum1))->second == "abc"); + test(_do[1].find(Test::ICE_ENUM(MyEnum, enum1)) != _do[1].end()); + test(_do[1].find(Test::ICE_ENUM(MyEnum, enum1))->second == "abc"); test(_do[2].size() == 2); - test(_do[2].find(ICE_ENUM(Test::MyEnum, enum2)) != _do[2].end()); - test(_do[2].find(ICE_ENUM(Test::MyEnum, enum2))->second == "Hello!!"); - test(_do[2].find(ICE_ENUM(Test::MyEnum, enum3)) != _do[2].end()); - test(_do[2].find(ICE_ENUM(Test::MyEnum, enum3))->second == "qwerty"); + test(_do[2].find(Test::ICE_ENUM(MyEnum, enum2)) != _do[2].end()); + test(_do[2].find(Test::ICE_ENUM(MyEnum, enum2))->second == "Hello!!"); + test(_do[2].find(Test::ICE_ENUM(MyEnum, enum3)) != _do[2].end()); + test(_do[2].find(Test::ICE_ENUM(MyEnum, enum3))->second == "qwerty"); called(); } @@ -740,32 +740,32 @@ public: test(ro.size() == 2); test(ro[0].size() == 3); test(ro[0].find(ms11) != ro[0].end()); - test(ro[0].find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(ro[0].find(ms11)->second == Test::ICE_ENUM(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(ms22)->second == Test::ICE_ENUM(MyEnum, enum3)); test(ro[0].find(ms23) != ro[0].end()); - test(ro[0].find(ms23)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro[0].find(ms23)->second == Test::ICE_ENUM(MyEnum, enum2)); test(ro[1].size() == 2); test(ro[1].find(ms11) != ro[1].end()); - test(ro[1].find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(ro[1].find(ms11)->second == Test::ICE_ENUM(MyEnum, enum1)); test(ro[1].find(ms12) != ro[1].end()); - test(ro[1].find(ms12)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(ro[1].find(ms12)->second == Test::ICE_ENUM(MyEnum, enum2)); test(_do.size() == 3); test(_do[0].size() == 1); test(_do[0].find(ms23) != _do[0].end()); - test(_do[0].find(ms23)->second == ICE_ENUM(Test::MyEnum, enum3)); + test(_do[0].find(ms23)->second == Test::ICE_ENUM(MyEnum, enum3)); test(_do[1].size() == 2); test(_do[1].find(ms11) != _do[1].end()); - test(_do[1].find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(_do[1].find(ms11)->second == Test::ICE_ENUM(MyEnum, enum1)); test(_do[1].find(ms12) != _do[1].end()); - test(_do[1].find(ms12)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(_do[1].find(ms12)->second == Test::ICE_ENUM(MyEnum, enum2)); test(_do[2].size() == 3); test(_do[2].find(ms11) != _do[2].end()); - test(_do[2].find(ms11)->second == ICE_ENUM(Test::MyEnum, enum1)); + test(_do[2].find(ms11)->second == Test::ICE_ENUM(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(ms22)->second == Test::ICE_ENUM(MyEnum, enum3)); test(_do[2].find(ms23) != _do[2].end()); - test(_do[2].find(ms23)->second == ICE_ENUM(Test::MyEnum, enum2)); + test(_do[2].find(ms23)->second == Test::ICE_ENUM(MyEnum, enum2)); called(); } @@ -958,24 +958,24 @@ public: void opMyEnumMyEnumSD(const Test::MyEnumMyEnumSD& ro, const Test::MyEnumMyEnumSD& _do) { test(_do.size() == 1); - test(_do.find(ICE_ENUM(Test::MyEnum, enum1)) != _do.end()); - test(_do.find(ICE_ENUM(Test::MyEnum, enum1))->second.size() == 2); - test(_do.find(ICE_ENUM(Test::MyEnum, enum1))->second[0] == ICE_ENUM(Test::MyEnum, enum3)); - test(_do.find(ICE_ENUM(Test::MyEnum, enum1))->second[1] == ICE_ENUM(Test::MyEnum, enum3)); + test(_do.find(Test::ICE_ENUM(MyEnum, enum1)) != _do.end()); + test(_do.find(Test::ICE_ENUM(MyEnum, enum1))->second.size() == 2); + test(_do.find(Test::ICE_ENUM(MyEnum, enum1))->second[0] == Test::ICE_ENUM(MyEnum, enum3)); + test(_do.find(Test::ICE_ENUM(MyEnum, enum1))->second[1] == Test::ICE_ENUM(MyEnum, enum3)); test(ro.size() == 3); - test(ro.find(ICE_ENUM(Test::MyEnum, enum3)) != ro.end()); - test(ro.find(ICE_ENUM(Test::MyEnum, enum3))->second.size() == 3); - test(ro.find(ICE_ENUM(Test::MyEnum, enum3))->second[0] == ICE_ENUM(Test::MyEnum, enum1)); - test(ro.find(ICE_ENUM(Test::MyEnum, enum3))->second[1] == ICE_ENUM(Test::MyEnum, enum1)); - test(ro.find(ICE_ENUM(Test::MyEnum, enum3))->second[2] == ICE_ENUM(Test::MyEnum, enum2)); - test(ro.find(ICE_ENUM(Test::MyEnum, enum2)) != ro.end()); - test(ro.find(ICE_ENUM(Test::MyEnum, enum2))->second.size() == 2); - test(ro.find(ICE_ENUM(Test::MyEnum, enum2))->second[0] == ICE_ENUM(Test::MyEnum, enum1)); - test(ro.find(ICE_ENUM(Test::MyEnum, enum2))->second[1] == ICE_ENUM(Test::MyEnum, enum2)); - test(ro.find(ICE_ENUM(Test::MyEnum, enum1)) != ro.end()); - test(ro.find(ICE_ENUM(Test::MyEnum, enum1))->second.size() == 2); - test(ro.find(ICE_ENUM(Test::MyEnum, enum1))->second[0] == ICE_ENUM(Test::MyEnum, enum3)); - test(ro.find(ICE_ENUM(Test::MyEnum, enum1))->second[1] == ICE_ENUM(Test::MyEnum, enum3)); + test(ro.find(Test::ICE_ENUM(MyEnum, enum3)) != ro.end()); + test(ro.find(Test::ICE_ENUM(MyEnum, enum3))->second.size() == 3); + test(ro.find(Test::ICE_ENUM(MyEnum, enum3))->second[0] == Test::ICE_ENUM(MyEnum, enum1)); + test(ro.find(Test::ICE_ENUM(MyEnum, enum3))->second[1] == Test::ICE_ENUM(MyEnum, enum1)); + test(ro.find(Test::ICE_ENUM(MyEnum, enum3))->second[2] == Test::ICE_ENUM(MyEnum, enum2)); + test(ro.find(Test::ICE_ENUM(MyEnum, enum2)) != ro.end()); + test(ro.find(Test::ICE_ENUM(MyEnum, enum2))->second.size() == 2); + test(ro.find(Test::ICE_ENUM(MyEnum, enum2))->second[0] == Test::ICE_ENUM(MyEnum, enum1)); + test(ro.find(Test::ICE_ENUM(MyEnum, enum2))->second[1] == Test::ICE_ENUM(MyEnum, enum2)); + test(ro.find(Test::ICE_ENUM(MyEnum, enum1)) != ro.end()); + test(ro.find(Test::ICE_ENUM(MyEnum, enum1))->second.size() == 2); + test(ro.find(Test::ICE_ENUM(MyEnum, enum1))->second[0] == Test::ICE_ENUM(MyEnum, enum3)); + test(ro.find(Test::ICE_ENUM(MyEnum, enum1))->second[1] == Test::ICE_ENUM(MyEnum, enum3)); called(); } @@ -1237,8 +1237,8 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { CallbackPtr cb = ICE_MAKE_SHARED(Callback); #ifdef ICE_CPP11_MAPPING - p->opMyEnumAsync(MyEnum::enum2, - [&](MyEnum e1, MyEnum e2) + p->opMyEnumAsync(Test::MyEnum::enum2, + [&](Test::MyEnum e1, Test::MyEnum e2) { cb->opMyEnum(e1, e2); }, @@ -1256,7 +1256,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& CallbackPtr cb = ICE_MAKE_SHARED(Callback, communicator); #ifdef ICE_CPP11_MAPPING p->opMyClassAsync(p, - [&](shared_ptr<MyClassPrx> c1, shared_ptr<MyClassPrx> c2, shared_ptr<MyClassPrx> c3) + [&](shared_ptr<Test::MyClassPrx> c1, shared_ptr<Test::MyClassPrx> c2, shared_ptr<Test::MyClassPrx> c3) { cb->opMyClass(move(c1), move(c2), move(c3)); }, @@ -1273,11 +1273,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { Test::Structure si1; si1.p = p; - si1.e = ICE_ENUM(Test::MyEnum, enum3); + si1.e = Test::ICE_ENUM(MyEnum, enum3); si1.s.s = "abc"; Test::Structure si2; si2.p = 0; - si2.e = ICE_ENUM(Test::MyEnum, enum2); + si2.e = Test::ICE_ENUM(MyEnum, enum2); si2.s.s = "def"; CallbackPtr cb = ICE_MAKE_SHARED(Callback, communicator); @@ -1700,12 +1700,12 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { Test::StringMyEnumD di1; - di1["abc"] = ICE_ENUM(Test::MyEnum, enum1); - di1[""] = ICE_ENUM(Test::MyEnum, enum2); + di1["abc"] = Test::ICE_ENUM(MyEnum, enum1); + di1[""] = Test::ICE_ENUM(MyEnum, enum2); Test::StringMyEnumD di2; - di2["abc"] = ICE_ENUM(Test::MyEnum, enum1); - di2["qwerty"] = ICE_ENUM(Test::MyEnum, enum3); - di2["Hello!!"] = ICE_ENUM(Test::MyEnum, enum2); + di2["abc"] = Test::ICE_ENUM(MyEnum, enum1); + di2["qwerty"] = Test::ICE_ENUM(MyEnum, enum3); + di2["Hello!!"] = Test::ICE_ENUM(MyEnum, enum2); CallbackPtr cb = ICE_MAKE_SHARED(Callback); #ifdef ICE_CPP11_MAPPING @@ -1727,15 +1727,15 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::MyStruct ms11 = { 1, 1 }; Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); - di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = Test::ICE_ENUM(MyEnum, enum1); + di1[ms12] = Test::ICE_ENUM(MyEnum, enum2); Test::MyStruct ms22 = { 2, 2 }; Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[ms11] = ICE_ENUM(Test::MyEnum, enum1); - di2[ms22] = ICE_ENUM(Test::MyEnum, enum3); - di2[ms23] = ICE_ENUM(Test::MyEnum, enum2); + di2[ms11] = Test::ICE_ENUM(MyEnum, enum1); + di2[ms22] = Test::ICE_ENUM(MyEnum, enum3); + di2[ms23] = Test::ICE_ENUM(MyEnum, enum2); CallbackPtr cb = ICE_MAKE_SHARED(Callback); #ifdef ICE_CPP11_MAPPING @@ -1906,14 +1906,14 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2.resize(1); Test::StringMyEnumD di1; - di1["abc"] = ICE_ENUM(Test::MyEnum, enum1); - di1[""] = ICE_ENUM(Test::MyEnum, enum2); + di1["abc"] = Test::ICE_ENUM(MyEnum, enum1); + di1[""] = Test::ICE_ENUM(MyEnum, enum2); Test::StringMyEnumD di2; - di2["abc"] = ICE_ENUM(Test::MyEnum, enum1); - di2["qwerty"] = ICE_ENUM(Test::MyEnum, enum3); - di2["Hello!!"] = ICE_ENUM(Test::MyEnum, enum2); + di2["abc"] = Test::ICE_ENUM(MyEnum, enum1); + di2["qwerty"] = Test::ICE_ENUM(MyEnum, enum3); + di2["Hello!!"] = Test::ICE_ENUM(MyEnum, enum2); Test::StringMyEnumD di3; - di3["Goodbye"] = ICE_ENUM(Test::MyEnum, enum1); + di3["Goodbye"] = Test::ICE_ENUM(MyEnum, enum1); dsi1[0] = di1; dsi1[1] = di2; @@ -1942,12 +1942,12 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2.resize(1); Test::MyEnumStringD di1; - di1[ICE_ENUM(Test::MyEnum, enum1)] = "abc"; + di1[Test::ICE_ENUM(MyEnum, enum1)] = "abc"; Test::MyEnumStringD di2; - di2[ICE_ENUM(Test::MyEnum, enum2)] = "Hello!!"; - di2[ICE_ENUM(Test::MyEnum, enum3)] = "qwerty"; + di2[Test::ICE_ENUM(MyEnum, enum2)] = "Hello!!"; + di2[Test::ICE_ENUM(MyEnum, enum3)] = "qwerty"; Test::MyEnumStringD di3; - di3[ICE_ENUM(Test::MyEnum, enum1)] = "Goodbye"; + di3[Test::ICE_ENUM(MyEnum, enum1)] = "Goodbye"; dsi1[0] = di1; dsi1[1] = di2; @@ -1978,18 +1978,18 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::MyStruct ms11 = { 1, 1 }; Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); - di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = Test::ICE_ENUM(MyEnum, enum1); + di1[ms12] = Test::ICE_ENUM(MyEnum, enum2); Test::MyStruct ms22 = { 2, 2 }; Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[ms11] = ICE_ENUM(Test::MyEnum, enum1); - di2[ms22] = ICE_ENUM(Test::MyEnum, enum3); - di2[ms23] = ICE_ENUM(Test::MyEnum, enum2); + di2[ms11] = Test::ICE_ENUM(MyEnum, enum1); + di2[ms22] = Test::ICE_ENUM(MyEnum, enum3); + di2[ms23] = Test::ICE_ENUM(MyEnum, enum2); Test::MyStructMyEnumD di3; - di3[ms23] = ICE_ENUM(Test::MyEnum, enum3); + di3[ms23] = Test::ICE_ENUM(MyEnum, enum3); dsi1[0] = di1; dsi1[1] = di2; @@ -1998,7 +1998,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& CallbackPtr cb = ICE_MAKE_SHARED(Callback); #ifdef ICE_CPP11_MAPPING p->opMyStructMyEnumDSAsync(dsi1, dsi2, - [&](Test::MyStructMyEnumDS dsi3, MyStructMyEnumDS dsi4) + [&](Test::MyStructMyEnumDS dsi3, Test::MyStructMyEnumDS dsi4) { cb->opMyStructMyEnumDS(move(dsi3), move(dsi4)); }, @@ -2304,17 +2304,17 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::MyEnumS si2; Test::MyEnumS si3; - si1.push_back(ICE_ENUM(Test::MyEnum, enum1)); - si1.push_back(ICE_ENUM(Test::MyEnum, enum1)); - si1.push_back(ICE_ENUM(Test::MyEnum, enum2)); - si2.push_back(ICE_ENUM(Test::MyEnum, enum1)); - si2.push_back(ICE_ENUM(Test::MyEnum, enum2)); - si3.push_back(ICE_ENUM(Test::MyEnum, enum3)); - si3.push_back(ICE_ENUM(Test::MyEnum, enum3)); + si1.push_back(Test::ICE_ENUM(MyEnum, enum1)); + si1.push_back(Test::ICE_ENUM(MyEnum, enum1)); + si1.push_back(Test::ICE_ENUM(MyEnum, enum2)); + si2.push_back(Test::ICE_ENUM(MyEnum, enum1)); + si2.push_back(Test::ICE_ENUM(MyEnum, enum2)); + si3.push_back(Test::ICE_ENUM(MyEnum, enum3)); + si3.push_back(Test::ICE_ENUM(MyEnum, enum3)); - sdi1[ICE_ENUM(Test::MyEnum, enum3)] = si1; - sdi1[ICE_ENUM(Test::MyEnum, enum2)] = si2; - sdi2[ICE_ENUM(Test::MyEnum, enum1)] = si3; + sdi1[Test::ICE_ENUM(MyEnum, enum3)] = si1; + sdi1[Test::ICE_ENUM(MyEnum, enum2)] = si2; + sdi2[Test::ICE_ENUM(MyEnum, enum1)] = si3; CallbackPtr cb = ICE_MAKE_SHARED(Callback); #ifdef ICE_CPP11_MAPPING @@ -2475,7 +2475,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Ice::PropertiesPtr properties = ic->getProperties(); Test::MyClassPrxPtr q = ICE_UNCHECKED_CAST(Test::MyClassPrx, - ic->stringToProxy("test:" + TestHelper::getTestEndpoint(properties))); + ic->stringToProxy("test:" + Test::TestHelper::getTestEndpoint(properties))); ic->getImplicitContext()->setContext(ctx); test(ic->getImplicitContext()->getContext() == ctx); { @@ -2894,11 +2894,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { Test::Structure si1; si1.p = p; - si1.e = ICE_ENUM(Test::MyEnum, enum3); + si1.e = Test::ICE_ENUM(MyEnum, enum3); si1.s.s = "abc"; Test::Structure si2; si2.p = 0; - si2.e = ICE_ENUM(Test::MyEnum, enum2); + si2.e = Test::ICE_ENUM(MyEnum, enum2); si2.s.s = "def"; CallbackPtr cb = ICE_MAKE_SHARED(Callback, communicator); @@ -3276,12 +3276,12 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { Test::StringMyEnumD di1; - di1["abc"] = ICE_ENUM(Test::MyEnum, enum1); - di1[""] = ICE_ENUM(Test::MyEnum, enum2); + di1["abc"] = Test::ICE_ENUM(MyEnum, enum1); + di1[""] = Test::ICE_ENUM(MyEnum, enum2); Test::StringMyEnumD di2; - di2["abc"] = ICE_ENUM(Test::MyEnum, enum1); - di2["qwerty"] = ICE_ENUM(Test::MyEnum, enum3); - di2["Hello!!"] = ICE_ENUM(Test::MyEnum, enum2); + di2["abc"] = Test::ICE_ENUM(MyEnum, enum1); + di2["qwerty"] = Test::ICE_ENUM(MyEnum, enum3); + di2["Hello!!"] = Test::ICE_ENUM(MyEnum, enum2); CallbackPtr cb = ICE_MAKE_SHARED(Callback); auto f = p->opStringMyEnumDAsync(di1, di2); @@ -3305,15 +3305,15 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::MyStruct ms11 = { 1, 1 }; Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); - di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = Test::ICE_ENUM(MyEnum, enum1); + di1[ms12] = Test::ICE_ENUM(MyEnum, enum2); Test::MyStruct ms22 = { 2, 2 }; Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[ms11] = ICE_ENUM(Test::MyEnum, enum1); - di2[ms22] = ICE_ENUM(Test::MyEnum, enum3); - di2[ms23] = ICE_ENUM(Test::MyEnum, enum2); + di2[ms11] = Test::ICE_ENUM(MyEnum, enum1); + di2[ms22] = Test::ICE_ENUM(MyEnum, enum3); + di2[ms23] = Test::ICE_ENUM(MyEnum, enum2); CallbackPtr cb = ICE_MAKE_SHARED(Callback); auto f = p->opMyStructMyEnumDAsync(di1, di2); @@ -3493,14 +3493,14 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2.resize(1); Test::StringMyEnumD di1; - di1["abc"] = ICE_ENUM(Test::MyEnum, enum1); - di1[""] = ICE_ENUM(Test::MyEnum, enum2); + di1["abc"] = Test::ICE_ENUM(MyEnum, enum1); + di1[""] = Test::ICE_ENUM(MyEnum, enum2); Test::StringMyEnumD di2; - di2["abc"] = ICE_ENUM(Test::MyEnum, enum1); - di2["qwerty"] = ICE_ENUM(Test::MyEnum, enum3); - di2["Hello!!"] = ICE_ENUM(Test::MyEnum, enum2); + di2["abc"] = Test::ICE_ENUM(MyEnum, enum1); + di2["qwerty"] = Test::ICE_ENUM(MyEnum, enum3); + di2["Hello!!"] = Test::ICE_ENUM(MyEnum, enum2); Test::StringMyEnumD di3; - di3["Goodbye"] = ICE_ENUM(Test::MyEnum, enum1); + di3["Goodbye"] = Test::ICE_ENUM(MyEnum, enum1); dsi1[0] = di1; dsi1[1] = di2; @@ -3531,12 +3531,12 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2.resize(1); Test::MyEnumStringD di1; - di1[ICE_ENUM(Test::MyEnum, enum1)] = "abc"; + di1[Test::ICE_ENUM(MyEnum, enum1)] = "abc"; Test::MyEnumStringD di2; - di2[ICE_ENUM(Test::MyEnum, enum2)] = "Hello!!"; - di2[ICE_ENUM(Test::MyEnum, enum3)] = "qwerty"; + di2[Test::ICE_ENUM(MyEnum, enum2)] = "Hello!!"; + di2[Test::ICE_ENUM(MyEnum, enum3)] = "qwerty"; Test::MyEnumStringD di3; - di3[ICE_ENUM(Test::MyEnum, enum1)] = "Goodbye"; + di3[Test::ICE_ENUM(MyEnum, enum1)] = "Goodbye"; dsi1[0] = di1; dsi1[1] = di2; @@ -3569,18 +3569,18 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::MyStruct ms11 = { 1, 1 }; Test::MyStruct ms12 = { 1, 2 }; Test::MyStructMyEnumD di1; - di1[ms11] = ICE_ENUM(Test::MyEnum, enum1); - di1[ms12] = ICE_ENUM(Test::MyEnum, enum2); + di1[ms11] = Test::ICE_ENUM(MyEnum, enum1); + di1[ms12] = Test::ICE_ENUM(MyEnum, enum2); Test::MyStruct ms22 = { 2, 2 }; Test::MyStruct ms23 = { 2, 3 }; Test::MyStructMyEnumD di2; - di2[ms11] = ICE_ENUM(Test::MyEnum, enum1); - di2[ms22] = ICE_ENUM(Test::MyEnum, enum3); - di2[ms23] = ICE_ENUM(Test::MyEnum, enum2); + di2[ms11] = Test::ICE_ENUM(MyEnum, enum1); + di2[ms22] = Test::ICE_ENUM(MyEnum, enum3); + di2[ms23] = Test::ICE_ENUM(MyEnum, enum2); Test::MyStructMyEnumD di3; - di3[ms23] = ICE_ENUM(Test::MyEnum, enum3); + di3[ms23] = Test::ICE_ENUM(MyEnum, enum3); dsi1[0] = di1; dsi1[1] = di2; @@ -3914,17 +3914,17 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::MyEnumS si2; Test::MyEnumS si3; - si1.push_back(ICE_ENUM(Test::MyEnum, enum1)); - si1.push_back(ICE_ENUM(Test::MyEnum, enum1)); - si1.push_back(ICE_ENUM(Test::MyEnum, enum2)); - si2.push_back(ICE_ENUM(Test::MyEnum, enum1)); - si2.push_back(ICE_ENUM(Test::MyEnum, enum2)); - si3.push_back(ICE_ENUM(Test::MyEnum, enum3)); - si3.push_back(ICE_ENUM(Test::MyEnum, enum3)); - - sdi1[ICE_ENUM(Test::MyEnum, enum3)] = si1; - sdi1[ICE_ENUM(Test::MyEnum, enum2)] = si2; - sdi2[ICE_ENUM(Test::MyEnum, enum1)] = si3; + si1.push_back(Test::ICE_ENUM(MyEnum, enum1)); + si1.push_back(Test::ICE_ENUM(MyEnum, enum1)); + si1.push_back(Test::ICE_ENUM(MyEnum, enum2)); + si2.push_back(Test::ICE_ENUM(MyEnum, enum1)); + si2.push_back(Test::ICE_ENUM(MyEnum, enum2)); + si3.push_back(Test::ICE_ENUM(MyEnum, enum3)); + si3.push_back(Test::ICE_ENUM(MyEnum, enum3)); + + sdi1[Test::ICE_ENUM(MyEnum, enum3)] = si1; + sdi1[Test::ICE_ENUM(MyEnum, enum2)] = si2; + sdi2[Test::ICE_ENUM(MyEnum, enum1)] = si3; CallbackPtr cb = ICE_MAKE_SHARED(Callback); auto f = p->opMyEnumMyEnumSDAsync(sdi1, sdi2); diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp index bc746df14ca..e32b6e51dbe 100644 --- a/cpp/test/Ice/stringConverter/Client.cpp +++ b/cpp/test/Ice/stringConverter/Client.cpp @@ -55,7 +55,7 @@ Client::run(int argc, char** argv) narrowEncoding = "iso815"; wideEncoding = "ucs4"; -#elif defined(_AIX) +#elif defined(_AIX) && !defined(_LIBICONV_VERSION) // Always big-endian narrowEncoding = "ISO8859-15"; diff --git a/cpp/test/Ice/stringConverter/Makefile.mk b/cpp/test/Ice/stringConverter/Makefile.mk index 22c6a4d2ef0..3ca7713a6b9 100644 --- a/cpp/test/Ice/stringConverter/Makefile.mk +++ b/cpp/test/Ice/stringConverter/Makefile.mk @@ -2,6 +2,6 @@ # Copyright (c) ZeroC, Inc. All rights reserved. # -$(test)_ldflags = $(iconv_ldflags) +$(test)_libs = iconv tests += $(test) diff --git a/cpp/test/Ice/udp/AllTests.cpp b/cpp/test/Ice/udp/AllTests.cpp index c7c8dc1ce1d..cbe74f201f6 100644 --- a/cpp/test/Ice/udp/AllTests.cpp +++ b/cpp/test/Ice/udp/AllTests.cpp @@ -154,7 +154,22 @@ allTests(Test::TestHelper* helper) while(nRetry-- > 0) { replyI->reset(); - objMcast->ping(reply); + try + { + objMcast->ping(reply); + } + catch(const Ice::SocketException&) + { + // Multicast IPv6 not supported on the platform. This occurs for example + // on AIX PVP clould VMs. + if(communicator->getProperties()->getProperty("Ice.IPv6") == "1") + { + cout << "(not supported) "; + ret = true; + break; + } + throw; + } ret = replyI->waitReply(5, IceUtil::Time::seconds(2)); if(ret) { @@ -175,7 +190,6 @@ allTests(Test::TestHelper* helper) cout << "testing udp bi-dir connection... " << flush; obj->ice_getConnection()->setAdapter(adapter); - objMcast->ice_getConnection()->setAdapter(adapter); nRetry = 5; while(nRetry-- > 0) { @@ -205,6 +219,7 @@ allTests(Test::TestHelper* helper) // // cout << "testing udp bi-dir connection... " << flush; // nRetry = 5; +// objMcast->ice_getConnection()->setAdapter(adapter); // while(nRetry-- > 0) // { // replyI->reset(); diff --git a/cpp/test/Ice/udp/Server.cpp b/cpp/test/Ice/udp/Server.cpp index 34113776aba..17a8427ef46 100644 --- a/cpp/test/Ice/udp/Server.cpp +++ b/cpp/test/Ice/udp/Server.cpp @@ -56,10 +56,26 @@ Server::run(int argc, char** argv) #endif } communicator->getProperties()->setProperty("McastTestAdapter.Endpoints", endpoint.str()); - Ice::ObjectAdapterPtr mcastAdapter = communicator->createObjectAdapter("McastTestAdapter"); - mcastAdapter->add(ICE_MAKE_SHARED(TestIntfI), Ice::stringToIdentity("test")); - mcastAdapter->activate(); + try + { + Ice::ObjectAdapterPtr mcastAdapter = communicator->createObjectAdapter("McastTestAdapter"); + mcastAdapter->add(ICE_MAKE_SHARED(TestIntfI), Ice::stringToIdentity("test")); + mcastAdapter->activate(); + } + catch(const Ice::SocketException&) + { + // Multicast IPv6 not supported on the platform. This occurs for example + // on AIX PVP clould VMs. + if(communicator->getProperties()->getProperty("Ice.IPv6") == "1") + { + cout << "McastTestAdapter ready" << endl; + } + else + { + throw; + } + } serverReady(); communicator->waitForShutdown(); diff --git a/cpp/test/IceGrid/fileLock/test.py b/cpp/test/IceGrid/fileLock/test.py index 3a0cd85cbec..11055392cad 100644 --- a/cpp/test/IceGrid/fileLock/test.py +++ b/cpp/test/IceGrid/fileLock/test.py @@ -8,7 +8,7 @@ class IceGridAdminTestCase(IceGridTestCase): def runClientSide(self, current): sys.stdout.write("testing IceGrid file lock... ") - registry = IceGridRegistryMaster(portnum=25, readyCount=0, quiet=True); + registry = IceGridRegistryMaster(portnum=25, ready="", quiet=True); registry.start(current) registry.expect(current, ".*IceUtil::FileLockException.*") registry.stop(current, False) diff --git a/cpp/test/IceGrid/session/AllTests.cpp b/cpp/test/IceGrid/session/AllTests.cpp index 256236e8dd0..d265c5284a0 100644 --- a/cpp/test/IceGrid/session/AllTests.cpp +++ b/cpp/test/IceGrid/session/AllTests.cpp @@ -480,6 +480,10 @@ testFailedAndPrintObservers(const char* expr, const char* file, unsigned int lin #undef test #define test(ex) ((ex) ? ((void)0) : testFailedAndPrintObservers(#ex, __FILE__, __LINE__)) +#if defined(_AIX) && defined(__GNUC__) && !defined(__ibmxl__) +// Strange optimization bug with catching ExtendedPermissionDeniedException with GCC 8.1 on AIX +__attribute__((optimize("O0"))) +#endif void allTests(Test::TestHelper* helper) { diff --git a/cpp/test/IceStorm/single/test.py b/cpp/test/IceStorm/single/test.py index a225315302f..9e4500ac08c 100644 --- a/cpp/test/IceStorm/single/test.py +++ b/cpp/test/IceStorm/single/test.py @@ -6,16 +6,16 @@ # # Make sure the subscriber uses a larger size receive buffer size then # the IceStorm send buffer size. This ensures the test works with bogus -# OS configurations where the reicever buffer size is smaller than the +# OS configurations where the receiver buffer size is smaller than the # send buffer size (causing the received messages to be truncated). See # bug #6070 and #7558. # -props = { "Ice.UDP.SndSize" : 2048 * 1024, "Ice.Warn.Dispatch" : 0 } +props = { "Ice.UDP.SndSize" : 512 * 1024, "Ice.Warn.Dispatch" : 0 } persistent = IceStorm(props = props) transient = IceStorm(props = props, transient=True) replicated = [ IceStorm(replica=i, nreplicas=3, props = props) for i in range(0,3) ] -sub = Subscriber(args=["{testcase.parent.name}"], props = { "Ice.UDP.RcvSize" : 4096 * 1024 }, readyCount=3) +sub = Subscriber(args=["{testcase.parent.name}"], props = { "Ice.UDP.RcvSize" : 1024 * 1024 }, readyCount=3) pub = Publisher(args=["{testcase.parent.name}"]) class IceStormSingleTestCase(IceStormTestCase): diff --git a/cpp/test/IceUtil/unicode/Client.cpp b/cpp/test/IceUtil/unicode/Client.cpp index 8e09ef3618e..e40ad062532 100644 --- a/cpp/test/IceUtil/unicode/Client.cpp +++ b/cpp/test/IceUtil/unicode/Client.cpp @@ -187,8 +187,12 @@ main(int argc, char* argv[]) // // Euro sign (U+20AC) is encoded with 1 UTF-16 code unit, and 3 UTF-8 code units // U+10437 is a Deseret character, encoded with 2 UTF-16 code units, and 4 UTF-8 code units - // + // xlC in 32-bit mode truncates U+10437 into a single UTF-16 character +#if defined(__IBMCPP__) && !defined(__64BIT__) + wstring ws = L"\u20ac\u20ac\ud801\udc37"; +#else wstring ws = L"\u20ac\u20ac\U00010437"; +#endif if(sizeof(wchar_t) == 2) { diff --git a/cpp/test/Slice/errorDetection/test.py b/cpp/test/Slice/errorDetection/test.py index 001543cb0e6..ede8e665bbf 100644 --- a/cpp/test/Slice/errorDetection/test.py +++ b/cpp/test/Slice/errorDetection/test.py @@ -33,20 +33,21 @@ class SliceErrorDetectionTestCase(ClientTestCase): regex1 = re.compile("\.ice$", re.IGNORECASE) lines1 = output.strip().splitlines() - lines2 = open(os.path.join(testdir, regex1.sub(".err", file)), "r").readlines() - if len(lines1) != len(lines2): - raise RuntimeError("failed (lines1 = {0}, lines2 = {1})!".format(len(lines1), len(lines2))) - - regex2 = re.compile("^.*(?=" + os.path.basename(file) + ")") - i = 0 - while i < len(lines1): - line1 = regex2.sub("", lines1[i]).strip() - line2 = regex2.sub("", lines2[i]).strip() - if line1 != line2: - raise RuntimeError("failed! (line1 = \"{0}\", line2 = \"{1}\"".format(line1, line2)) - i = i + 1 - else: - current.writeln("ok") + with open(os.path.join(testdir, regex1.sub(".err", file)), "r") as f: + lines2 = f.readlines() + if len(lines1) != len(lines2): + raise RuntimeError("failed (lines1 = {0}, lines2 = {1})!".format(len(lines1), len(lines2))) + + regex2 = re.compile("^.*(?=" + os.path.basename(file) + ")") + i = 0 + while i < len(lines1): + line1 = regex2.sub("", lines1[i]).strip() + line2 = regex2.sub("", lines2[i]).strip() + if line1 != line2: + raise RuntimeError("failed! (line1 = \"{0}\", line2 = \"{1}\"".format(line1, line2)) + i = i + 1 + else: + current.writeln("ok") for language in ["cpp", "cs", "html", "java", "js", "matlab", "objc", "php", "py", "rb"]: compiler = SliceTranslator('slice2%s' % language) diff --git a/cpp/test/Slice/headers/test.py b/cpp/test/Slice/headers/test.py index 2ded9c53337..7b66e895638 100644 --- a/cpp/test/Slice/headers/test.py +++ b/cpp/test/Slice/headers/test.py @@ -93,7 +93,7 @@ class SliceHeadersTestCase(ClientTestCase): os.system("mkdir -p tmp/Ice-x.y.z/slice/Ice") os.system("cd tmp && ln -s Ice-x.y.z Ice-x.y") f = open("tmp/Ice-x.y.z/slice/Ice/Identity.ice", "w") - f.write("// dumy file") + f.write("// dummy file") os.system("mkdir -p project1") f = open("project1/A.ice", "w") @@ -108,23 +108,24 @@ class SliceHeadersTestCase(ClientTestCase): # # symlink directory with extra / at end + # (the symlink with / at the end fails on AIX) # - # - os.system("mkdir -p tmp/Ice-x.y.z/slice/Ice") - os.system("mkdir -p tmp/Ice") - os.system("cd tmp/Ice && ln -s ../Ice-x.y.z/slice/ .") - f = open("tmp/Ice-x.y.z/slice/Ice/Identity.ice", "w") - f.write("// dumy file") - f.close() - os.system("mkdir -p project1") - f = open("project1/A.ice", "w") - f.write("#include <Ice/Identity.ice>") - f.close() - os.system("cd project1 && %s -I%s/tmp/Ice/slice A.ice" % (slice2cpp, basedir)) - f = open("project1/A.h") - if not re.search(re.escape('#include <Ice/Identity.h>'), f.read()): - raise RuntimeError("failed!") - self.clean() + if not isinstance(platform, AIX): + os.system("mkdir -p tmp/Ice-x.y.z/slice/Ice") + os.system("mkdir -p tmp/Ice") + os.system("cd tmp/Ice && ln -s ../Ice-x.y.z/slice/ .") + f = open("tmp/Ice-x.y.z/slice/Ice/Identity.ice", "w") + f.write("// dummy file") + f.close() + os.system("mkdir -p project1") + f = open("project1/A.ice", "w") + f.write("#include <Ice/Identity.ice>") + f.close() + os.system("cd project1 && %s -I%s/tmp/Ice/slice A.ice" % (slice2cpp, basedir)) + f = open("project1/A.h") + if not re.search(re.escape('#include <Ice/Identity.h>'), f.read()): + raise RuntimeError("failed!") + self.clean() current.writeln("ok") diff --git a/cpp/test/Slice/parser/Makefile.mk b/cpp/test/Slice/parser/Makefile.mk index c46cfbb48ab..38686ff72f5 100644 --- a/cpp/test/Slice/parser/Makefile.mk +++ b/cpp/test/Slice/parser/Makefile.mk @@ -3,7 +3,6 @@ # $(test)_libraries := SliceParser - -$(test)_sliceflags := -I$(test) +$(test)_sliceflags := -I$(test) tests += $(test) |