summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-05-22 11:17:24 +0200
committerJose <jose@zeroc.com>2017-05-22 11:17:24 +0200
commitaf8386af5b3a88730db7deceeda0fa0698be8c48 (patch)
tree3604c4a196c09c5e5a10c43f590a090d3cfccab7 /cpp
parentAdded check for Android SDK installation (diff)
downloadice-af8386af5b3a88730db7deceeda0fa0698be8c48.tar.bz2
ice-af8386af5b3a88730db7deceeda0fa0698be8c48.tar.xz
ice-af8386af5b3a88730db7deceeda0fa0698be8c48.zip
Result struct test
Diffstat (limited to 'cpp')
-rw-r--r--cpp/test/Ice/ami/AllTests.cpp27
-rw-r--r--cpp/test/Ice/ami/Collocated.cpp1
-rw-r--r--cpp/test/Ice/ami/Server.cpp1
-rw-r--r--cpp/test/Ice/ami/Test.ice15
-rw-r--r--cpp/test/Ice/ami/TestI.cpp7
-rw-r--r--cpp/test/Ice/ami/TestI.h7
6 files changed, 57 insertions, 1 deletions
diff --git a/cpp/test/Ice/ami/AllTests.cpp b/cpp/test/Ice/ami/AllTests.cpp
index 35fe85d9638..da4b801009c 100644
--- a/cpp/test/Ice/ami/AllTests.cpp
+++ b/cpp/test/Ice/ami/AllTests.cpp
@@ -1298,7 +1298,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
{
}
}
-
}
cout << "ok" << endl;
@@ -2386,6 +2385,32 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
}
}
+ {
+ cout << "testing result struct... " << flush;
+
+ auto q = Ice::uncheckedCast<Test::Outer::Inner::TestIntfPrx>(
+ communicator->stringToProxy("test2:" + getTestEndpoint(communicator, 0)));
+
+ promise<void> promise;
+ q->opAsync(1,
+ [&promise](int i, int j)
+ {
+ test(i == j);
+ promise.set_value();
+ },
+ [](const exception_ptr& ex)
+ {
+ test(false);
+ });
+ promise.get_future().get();
+
+ auto f = q->opAsync(1);
+ auto r = f.get();
+ test(r.returnValue == r.j);
+ test(r.returnValue == 1);
+ cout << "ok" << endl;
+ }
+
p->shutdown();
#else
diff --git a/cpp/test/Ice/ami/Collocated.cpp b/cpp/test/Ice/ami/Collocated.cpp
index a21d5a2f324..3d887510dd1 100644
--- a/cpp/test/Ice/ami/Collocated.cpp
+++ b/cpp/test/Ice/ami/Collocated.cpp
@@ -28,6 +28,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator)
TestIntfControllerIPtr testController = ICE_MAKE_SHARED(TestIntfControllerI, adapter);
adapter->add(ICE_MAKE_SHARED(TestIntfI), Ice::stringToIdentity("test"));
+ adapter->add(ICE_MAKE_SHARED(TestIntfII), Ice::stringToIdentity("test2"));
//adapter->activate(); // Collocated test doesn't need to activate the OA
adapter2->add(testController, Ice::stringToIdentity("testController"));
diff --git a/cpp/test/Ice/ami/Server.cpp b/cpp/test/Ice/ami/Server.cpp
index e153cd12b5e..6e1eba0d663 100644
--- a/cpp/test/Ice/ami/Server.cpp
+++ b/cpp/test/Ice/ami/Server.cpp
@@ -28,6 +28,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator)
TestIntfControllerIPtr testController = ICE_MAKE_SHARED(TestIntfControllerI, adapter);
adapter->add(ICE_MAKE_SHARED(TestIntfI), Ice::stringToIdentity("test"));
+ adapter->add(ICE_MAKE_SHARED(TestIntfII), Ice::stringToIdentity("test2"));
adapter->activate();
adapter2->add(testController, Ice::stringToIdentity("testController"));
diff --git a/cpp/test/Ice/ami/Test.ice b/cpp/test/Ice/ami/Test.ice
index 8ef2be51924..ccbe33822ca 100644
--- a/cpp/test/Ice/ami/Test.ice
+++ b/cpp/test/Ice/ami/Test.ice
@@ -64,4 +64,19 @@ interface TestIntfController
void resumeAdapter();
}
+module Outer
+{
+
+module Inner
+{
+
+interface TestIntf
+{
+ int op(int i, out int j);
+}
+
+}
+
+}
+
}
diff --git a/cpp/test/Ice/ami/TestI.cpp b/cpp/test/Ice/ami/TestI.cpp
index c9d2869e80a..c9eddb8283d 100644
--- a/cpp/test/Ice/ami/TestI.cpp
+++ b/cpp/test/Ice/ami/TestI.cpp
@@ -194,3 +194,10 @@ TestIntfControllerI::resumeAdapter(const Ice::Current&)
TestIntfControllerI::TestIntfControllerI(const Ice::ObjectAdapterPtr& adapter) : _adapter(adapter)
{
}
+
+Ice::Int
+TestIntfII::op(Ice::Int i, Ice::Int& j, const Ice::Current&)
+{
+ j = i;
+ return i;
+}
diff --git a/cpp/test/Ice/ami/TestI.h b/cpp/test/Ice/ami/TestI.h
index 1748f89284a..2f6c75e1438 100644
--- a/cpp/test/Ice/ami/TestI.h
+++ b/cpp/test/Ice/ami/TestI.h
@@ -72,4 +72,11 @@ private:
Ice::ObjectAdapterPtr _adapter;
};
+class TestIntfII : public virtual Test::Outer::Inner::TestIntf
+{
+public:
+
+ Ice::Int op(Ice::Int, Ice::Int&, const Ice::Current&);
+};
+
#endif