summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/operations/OnewaysAMI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/operations/OnewaysAMI.cpp')
-rw-r--r--cpp/test/Ice/operations/OnewaysAMI.cpp107
1 files changed, 103 insertions, 4 deletions
diff --git a/cpp/test/Ice/operations/OnewaysAMI.cpp b/cpp/test/Ice/operations/OnewaysAMI.cpp
index ee48f534b0b..c4342818256 100644
--- a/cpp/test/Ice/operations/OnewaysAMI.cpp
+++ b/cpp/test/Ice/operations/OnewaysAMI.cpp
@@ -80,22 +80,43 @@ typedef IceUtil::Handle<Callback> CallbackPtr;
}
void
-onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy)
+onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy)
{
- Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast(proxy->ice_oneway());
+ Test::MyClassPrxPtr p = ICE_UNCHECKED_CAST(Test::MyClassPrx, proxy->ice_oneway());
{
CallbackPtr cb = new Callback;
+#ifdef ICE_CPP11_MAPPING
+ p->ice_ping_async(
+ nullptr,
+ [](exception_ptr)
+ {
+ test(false);
+ },
+ [&](bool sent)
+ {
+ cb->sent(sent);
+ });
+#else
Ice::Callback_Object_ice_pingPtr callback =
Ice::newCallback_Object_ice_ping(cb, &Callback::noException, &Callback::sent);
p->begin_ice_ping(callback);
+#endif
cb->check();
}
{
try
{
+#ifdef ICE_CPP11_MAPPING
+ p->ice_isA_async(Test::MyClass::ice_staticId(),
+ [&](bool)
+ {
+ test(false);
+ });
+#else
p->begin_ice_isA(Test::MyClass::ice_staticId());
+#endif
test(false);
}
catch(const IceUtil::IllegalArgumentException&)
@@ -106,7 +127,15 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy)
{
try
{
+#ifdef ICE_CPP11_MAPPING
+ p->ice_id_async(
+ [&](string)
+ {
+ test(false);
+ });
+#else
p->begin_ice_id();
+#endif
test(false);
}
catch(const IceUtil::IllegalArgumentException&)
@@ -117,7 +146,14 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy)
{
try
{
+#ifdef ICE_CPP11_MAPPING
+ p->ice_ids_async(
+ [&](vector<string>)
+ {
+ });
+#else
p->begin_ice_ids();
+#endif
test(false);
}
catch(const IceUtil::IllegalArgumentException&)
@@ -127,51 +163,104 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy)
{
CallbackPtr cb = new Callback;
+#ifdef ICE_CPP11_MAPPING
+ p->opVoid_async(
+ nullptr,
+ [](exception_ptr)
+ {
+ test(false);
+ },
+ [&](bool sent)
+ {
+ cb->sent(sent);
+ });
+#else
Test::Callback_MyClass_opVoidPtr callback =
Test::newCallback_MyClass_opVoid(cb, &Callback::noException, &Callback::sent);
p->begin_opVoid(callback);
+#endif
cb->check();
}
{
CallbackPtr cb = new Callback;
+#ifdef ICE_CPP11_MAPPING
+ p->opIdempotent_async(
+ nullptr,
+ [](exception_ptr)
+ {
+ test(false);
+ },
+ [&](bool sent)
+ {
+ cb->sent(sent);
+ });
+#else
Test::Callback_MyClass_opIdempotentPtr callback =
Test::newCallback_MyClass_opIdempotent(cb, &Callback::noException, &Callback::sent);
p->begin_opIdempotent(callback);
+#endif
cb->check();
}
{
CallbackPtr cb = new Callback;
+#ifdef ICE_CPP11_MAPPING
+ p->opNonmutating_async(
+ nullptr,
+ [](exception_ptr)
+ {
+ test(false);
+ },
+ [&](bool sent)
+ {
+ cb->sent(sent);
+ });
+#else
Test::Callback_MyClass_opNonmutatingPtr callback =
Test::newCallback_MyClass_opNonmutating(cb, &Callback::noException, &Callback::sent);
p->begin_opNonmutating(callback);
+#endif
cb->check();
}
{
try
{
+#ifdef ICE_CPP11_MAPPING
+ p->opByte_async(Ice::Byte(0xff), Ice::Byte(0x0f),
+ [](Ice::Byte, Ice::Byte)
+ {
+ test(false);
+ });
+#else
p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f));
+#endif
test(false);
}
catch(const IceUtil::IllegalArgumentException&)
{
}
}
-#ifdef ICE_CPP11
+#ifdef ICE_CPP11_COMPILER
+# ifndef ICE_CPP11_MAPPING
{
CallbackPtr cb = new Callback;
p->begin_ice_ping(nullptr,
[=](const Ice::Exception& ex){ cb->noException(ex); },
[=](bool sent){ cb->sent(sent); });
cb->check();
- }
+ }
+# endif
{
try
{
+# ifdef ICE_CPP11_MAPPING
+ p->ice_isA_async(Test::MyClass::ice_staticId());
+# else
p->begin_ice_isA(Test::MyClass::ice_staticId(), [=](bool){ test(false); });
+# endif
test(false);
}
catch(const IceUtil::IllegalArgumentException&)
@@ -182,7 +271,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy)
{
try
{
+# ifdef ICE_CPP11_MAPPING
+ p->ice_id_async();
+# else
p->begin_ice_id([=](const string&){ test(false); });
+# endif
test(false);
}
catch(const IceUtil::IllegalArgumentException&)
@@ -193,7 +286,11 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy)
{
try
{
+# ifdef ICE_CPP11_MAPPING
+ p->ice_ids_async();
+# else
p->begin_ice_ids([=](const Ice::StringSeq&){ test(false); });
+# endif
test(false);
}
catch(const IceUtil::IllegalArgumentException&)
@@ -201,6 +298,7 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy)
}
}
+# ifndef ICE_CPP11_MAPPING
{
CallbackPtr cb = new Callback;
p->begin_opVoid(nullptr,
@@ -235,5 +333,6 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy)
{
}
}
+# endif
#endif
}