summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/ami/AllTests.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2018-11-13 15:52:14 -0500
committerBernard Normier <bernard@zeroc.com>2018-11-13 15:52:14 -0500
commita5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c (patch)
tree58b9f74f2132985fe15913f1a7f65e82121b8eba /cpp/test/Ice/ami/AllTests.cpp
parentFix failure related to Slice Scanner fixes (diff)
downloadice-a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c.tar.bz2
ice-a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c.tar.xz
ice-a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c.zip
More bidir tests. Fixes #51.
Diffstat (limited to 'cpp/test/Ice/ami/AllTests.cpp')
-rw-r--r--cpp/test/Ice/ami/AllTests.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/cpp/test/Ice/ami/AllTests.cpp b/cpp/test/Ice/ami/AllTests.cpp
index f1de69154ef..47aebe2ecf5 100644
--- a/cpp/test/Ice/ami/AllTests.cpp
+++ b/cpp/test/Ice/ami/AllTests.cpp
@@ -17,6 +17,30 @@ using namespace std;
namespace
{
+class PingReplyI : public Test::PingReply
+{
+public:
+ PingReplyI() :
+ _received(false)
+ {
+ }
+
+ virtual void reply(const Ice::Current&)
+ {
+ _received = true;
+ }
+
+ bool checkReceived()
+ {
+ return _received;
+ }
+
+private:
+ bool _received;
+};
+
+ICE_DEFINE_PTR(PingReplyIPtr, PingReplyI);
+
enum ThrowType { LocalException, UserException, StandardException, OtherException };
#ifdef ICE_CPP11_MAPPING
@@ -2418,6 +2442,22 @@ allTests(Test::TestHelper* helper, bool collocated)
cout << "ok" << endl;
}
+ if(p->ice_getConnection())
+ {
+ cout << "testing bidir... " << flush;
+ auto adapter = communicator->createObjectAdapter("");
+ auto replyI = make_shared<PingReplyI>();
+ auto reply = Ice::uncheckedCast<Test::PingReplyPrx>(adapter->addWithUUID(replyI));
+ adapter->activate();
+
+ p->ice_getConnection()->setAdapter(adapter);
+ p->pingBiDir(reply);
+ test(replyI->checkReceived());
+ adapter->destroy();
+
+ cout << "ok" << endl;
+ }
+
p->shutdown();
#else
@@ -4085,6 +4125,22 @@ allTests(Test::TestHelper* helper, bool collocated)
cout << "ok" << endl;
}
+ if(p->ice_getConnection())
+ {
+ cout << "testing bidir... " << flush;
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("");
+ PingReplyIPtr replyI = new PingReplyI();
+ Test::PingReplyPrx reply = Test::PingReplyPrx::uncheckedCast(adapter->addWithUUID(replyI));
+ adapter->activate();
+
+ p->ice_getConnection()->setAdapter(adapter);
+ p->pingBiDir(reply);
+ test(replyI->checkReceived());
+ adapter->destroy();
+
+ cout << "ok" << endl;
+ }
+
p->shutdown();
#endif
}