diff options
author | Jose <jose@zeroc.com> | 2012-08-10 23:53:37 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-08-10 23:53:37 +0200 |
commit | 1d5c04bb8c0e786a717e36467e17f34bcc4f1d95 (patch) | |
tree | c1c91f034589260e97033131061d536ecfc2b9cb /cpp/test/Ice/operations/OnewaysNewAMI.cpp | |
parent | ICE-4702 - Poor hash algorithm (diff) | |
download | ice-1d5c04bb8c0e786a717e36467e17f34bcc4f1d95.tar.bz2 ice-1d5c04bb8c0e786a717e36467e17f34bcc4f1d95.tar.xz ice-1d5c04bb8c0e786a717e36467e17f34bcc4f1d95.zip |
C++11 ami lambda support
Diffstat (limited to 'cpp/test/Ice/operations/OnewaysNewAMI.cpp')
-rw-r--r-- | cpp/test/Ice/operations/OnewaysNewAMI.cpp | 79 |
1 files changed, 78 insertions, 1 deletions
diff --git a/cpp/test/Ice/operations/OnewaysNewAMI.cpp b/cpp/test/Ice/operations/OnewaysNewAMI.cpp index 21127c66d3c..e82afcab5f9 100644 --- a/cpp/test/Ice/operations/OnewaysNewAMI.cpp +++ b/cpp/test/Ice/operations/OnewaysNewAMI.cpp @@ -85,7 +85,7 @@ onewaysNewAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast(proxy->ice_oneway()); { - CallbackPtr cb = new Callback; + CallbackPtr cb = new Callback; Ice::Callback_Object_ice_pingPtr callback = Ice::newCallback_Object_ice_ping(cb, &Callback::noException, &Callback::sent); p->begin_ice_ping(callback); @@ -159,4 +159,81 @@ onewaysNewAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& { } } +#ifdef ICE_CPP11 + { + CallbackPtr cb = new Callback; + p->begin_ice_ping(nullptr, + [=](const Ice::Exception& ex){ cb->noException(ex); }, + [=](bool sent){ cb->sent(sent); }); + cb->check(); + } + + { + try + { + p->begin_ice_isA(Test::MyClass::ice_staticId(), [=](bool){ test(false); }); + test(false); + } + catch(const IceUtil::IllegalArgumentException&) + { + } + } + + { + try + { + p->begin_ice_id([=](const string&){ test(false); }); + test(false); + } + catch(const IceUtil::IllegalArgumentException&) + { + } + } + + { + try + { + p->begin_ice_ids([=](const Ice::StringSeq&){ test(false); }); + test(false); + } + catch(const IceUtil::IllegalArgumentException&) + { + } + } + + { + CallbackPtr cb = new Callback; + p->begin_opVoid(nullptr, + [=](const Ice::Exception& ex){ cb->noException(ex); }, + [=](bool sent){ cb->sent(sent); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_opIdempotent(nullptr, + [=](const Ice::Exception& ex){ cb->noException(ex); }, + [=](bool sent){ cb->sent(sent); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_opNonmutating(nullptr, + [=](const Ice::Exception& ex){ cb->noException(ex); }, + [=](bool sent){ cb->sent(sent); }); + cb->check(); + } + + { + try + { + p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f), [=](const Ice::Byte&, const Ice::Byte&){ test(false); }); + test(false); + } + catch(const IceUtil::IllegalArgumentException&) + { + } + } +#endif } |