diff options
author | Jose <jose@zeroc.com> | 2014-09-24 21:06:55 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2014-09-24 21:06:55 +0200 |
commit | b1087d646fa93c4208dd227d0c9df323ff7c858b (patch) | |
tree | 48532138bffdfac0dc5c818593d9c1958cfeeeb5 /cpp/test | |
parent | PHP dependency fixes (diff) | |
download | ice-b1087d646fa93c4208dd227d0c9df323ff7c858b.tar.bz2 ice-b1087d646fa93c4208dd227d0c9df323ff7c858b.tar.xz ice-b1087d646fa93c4208dd227d0c9df323ff7c858b.zip |
Fixed (ICE-5511) - Consider removing the deprecated AMI mapping
Diffstat (limited to 'cpp/test')
-rw-r--r-- | cpp/test/Ice/custom/AllTests.cpp | 1476 | ||||
-rw-r--r-- | cpp/test/Ice/custom/Test.ice | 2 | ||||
-rw-r--r-- | cpp/test/Ice/custom/TestAMD.ice | 2 | ||||
-rw-r--r-- | cpp/test/Ice/custom/Wstring.ice | 4 | ||||
-rw-r--r-- | cpp/test/Ice/custom/WstringAMD.ice | 4 | ||||
-rw-r--r-- | cpp/test/Ice/exceptions/AllTests.cpp | 643 | ||||
-rw-r--r-- | cpp/test/Ice/exceptions/Test.ice | 4 | ||||
-rw-r--r-- | cpp/test/Ice/exceptions/TestAMD.ice | 4 | ||||
-rw-r--r-- | cpp/test/Ice/operations/AllTests.cpp | 11 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Makefile | 4 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Makefile.mak | 4 | ||||
-rw-r--r-- | cpp/test/Ice/operations/OnewaysAMI.cpp | 215 | ||||
-rw-r--r-- | cpp/test/Ice/operations/OnewaysNewAMI.cpp | 239 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Test.ice | 4 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMD.ice | 4 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TwowaysAMI.cpp | 1414 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TwowaysNewAMI.cpp | 1665 | ||||
-rw-r--r-- | cpp/test/Slice/keyword/Client.cpp | 10 | ||||
-rw-r--r-- | cpp/test/Slice/keyword/Key.ice | 2 |
19 files changed, 902 insertions, 4809 deletions
diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp index 32a8c7c93be..0dd933cd77a 100644 --- a/cpp/test/Ice/custom/AllTests.cpp +++ b/cpp/test/Ice/custom/AllTests.cpp @@ -83,1006 +83,6 @@ private: bool _called; }; -class AMI_TestIntf_opDoubleArrayI : public Test::AMI_TestIntf_opDoubleArray, public CallbackBase -{ -public: - - AMI_TestIntf_opDoubleArrayI(const ::std::pair<const double*, const double*>& in) - : _in(in) - { - } - - virtual void ice_response(const ::std::pair<const double*, const double*>& ret, - const ::std::pair<const double*, const double*>& out) - { - test(arrayRangeEquals<double>(out, _in)); - test(arrayRangeEquals<double>(ret, _in)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - const ::std::pair<const double*, const double*> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opDoubleArrayI> AMI_TestIntf_opDoubleArrayIPtr; - -class AMI_TestIntf_opBoolArrayI : public Test::AMI_TestIntf_opBoolArray, public CallbackBase -{ -public: - - AMI_TestIntf_opBoolArrayI(const ::std::pair<const bool*, const bool*>& in) - : _in(in) - { - } - - virtual void ice_response(const ::std::pair<const bool*, const bool*>& ret, - const ::std::pair<const bool*, const bool*>& out) - { - test(arrayRangeEquals<bool>(out, _in)); - test(arrayRangeEquals<bool>(ret, _in)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - const ::std::pair<const bool*, const bool*> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opBoolArrayI> AMI_TestIntf_opBoolArrayIPtr; - -class AMI_TestIntf_opByteArrayI : public Test::AMI_TestIntf_opByteArray, public CallbackBase -{ -public: - - AMI_TestIntf_opByteArrayI(const pair<const Ice::Byte*, const Ice::Byte*>& in) - : _in(in) - { - } - - virtual void ice_response(const pair<const Ice::Byte*, const Ice::Byte*>& ret, - const pair<const Ice::Byte*, const Ice::Byte*>& out) - { - test(arrayRangeEquals<Ice::Byte>(out, _in)); - test(arrayRangeEquals<Ice::Byte>(ret, _in)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - pair<const Ice::Byte*, const Ice::Byte*> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opByteArrayI> AMI_TestIntf_opByteArrayIPtr; - -class AMI_TestIntf_opVariableArrayI : public Test::AMI_TestIntf_opVariableArray, public CallbackBase -{ -public: - - AMI_TestIntf_opVariableArrayI(pair<const Test::Variable*, const Test::Variable*> in) - : _in(in) - { - } - - virtual void ice_response(const pair<const Test::Variable*, const Test::Variable*>& ret, - const pair<const Test::Variable*, const Test::Variable*>& out) - { - test(arrayRangeEquals<Test::Variable>(out, _in)); - test(arrayRangeEquals<Test::Variable>(ret, _in)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - pair<const Test::Variable*, const Test::Variable*> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opVariableArrayI> AMI_TestIntf_opVariableArrayIPtr; - -class AMI_TestIntf_opBoolRangeI : public Test::AMI_TestIntf_opBoolRange, public CallbackBase -{ -public: - - AMI_TestIntf_opBoolRangeI(pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> in) - : _in(in) - { - } - - virtual void ice_response(const pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>& ret, - const pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>& out) - { - test(equal(out.first, out.second, _in.first)); - test(equal(ret.first, ret.second, _in.first)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opBoolRangeI> AMI_TestIntf_opBoolRangeIPtr; - -class AMI_TestIntf_opByteRangeI : public Test::AMI_TestIntf_opByteRange, public CallbackBase -{ -public: - - AMI_TestIntf_opByteRangeI(const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& in) - : _in(in) - { - } - - virtual void ice_response(const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& ret, - const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& out) - { - test(equal(out.first, out.second, _in.first)); - test(equal(ret.first, ret.second, _in.first)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opByteRangeI> AMI_TestIntf_opByteRangeIPtr; - -class AMI_TestIntf_opVariableRangeI : public Test::AMI_TestIntf_opVariableRange, public CallbackBase -{ -public: - - AMI_TestIntf_opVariableRangeI(const pair<Test::VariableList::const_iterator, - Test::VariableList::const_iterator>& in) - : _in(in) - { - } - - virtual void ice_response(const pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>& ret, - const pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>& out) - { - test(equal(out.first, out.second, _in.first)); - test(equal(ret.first, ret.second, _in.first)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opVariableRangeI> AMI_TestIntf_opVariableRangeIPtr; - -class AMI_TestIntf_opBoolRangeTypeI : public Test::AMI_TestIntf_opBoolRangeType, public CallbackBase -{ -public: - - AMI_TestIntf_opBoolRangeTypeI(const pair<const bool*, const bool*>& in) - : _in(in) - { - } - - virtual void ice_response(const pair<const bool*, const bool*>& ret, - const pair<const bool*, const bool*>& out) - { - test(arrayRangeEquals<bool>(out, _in)); - test(arrayRangeEquals<bool>(ret, _in)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - pair<const bool*, const bool*> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opBoolRangeTypeI> AMI_TestIntf_opBoolRangeTypeIPtr; - -class AMI_TestIntf_opByteRangeTypeI : public Test::AMI_TestIntf_opByteRangeType, public CallbackBase -{ -public: - - AMI_TestIntf_opByteRangeTypeI(const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& in) - : _in(in) - { - } - - virtual void ice_response(const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& ret, - const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& out) - { - test(equal(out.first, out.second, _in.first)); - test(equal(ret.first, ret.second, _in.first)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opByteRangeTypeI> AMI_TestIntf_opByteRangeTypeIPtr; - -class AMI_TestIntf_opVariableRangeTypeI : public Test::AMI_TestIntf_opVariableRangeType, public CallbackBase -{ -public: - - AMI_TestIntf_opVariableRangeTypeI(const pair<deque<Test::Variable>::const_iterator, - deque<Test::Variable>::const_iterator>& in) - : _in(in) - { - } - - virtual void ice_response(const pair<deque<Test::Variable>::const_iterator, - deque<Test::Variable>::const_iterator>& ret, - const pair<deque<Test::Variable>::const_iterator, - deque<Test::Variable>::const_iterator>& out) - { - test(equal(out.first, out.second, _in.first)); - test(equal(ret.first, ret.second, _in.first)); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opVariableRangeTypeI> AMI_TestIntf_opVariableRangeTypeIPtr; - -class AMI_TestIntf_opBoolSeqI : public Test::AMI_TestIntf_opBoolSeq, public CallbackBase -{ -public: - - AMI_TestIntf_opBoolSeqI(deque<bool> in) - : _in(in) - { - } - - virtual void ice_response(const deque<bool>& ret, const deque<bool>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - deque<bool> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opBoolSeqI> AMI_TestIntf_opBoolSeqIPtr; - -class AMI_TestIntf_opBoolListI : public Test::AMI_TestIntf_opBoolList, public CallbackBase -{ -public: - - AMI_TestIntf_opBoolListI(list<bool> in) - : _in(in) - { - } - - virtual void ice_response(const list<bool>& ret, const list<bool>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - list<bool> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opBoolListI> AMI_TestIntf_opBoolListIPtr; - -class AMI_TestIntf_opByteSeqI : public Test::AMI_TestIntf_opByteSeq, public CallbackBase -{ -public: - - AMI_TestIntf_opByteSeqI(deque<Ice::Byte> in) - : _in(in) - { - } - - virtual void ice_response(const deque<Ice::Byte>& ret, const deque<Ice::Byte>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - deque<Ice::Byte> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opByteSeqI> AMI_TestIntf_opByteSeqIPtr; - -class AMI_TestIntf_opByteListI : public Test::AMI_TestIntf_opByteList, public CallbackBase -{ -public: - - AMI_TestIntf_opByteListI(list<Ice::Byte> in) - : _in(in) - { - } - - virtual void ice_response(const list<Ice::Byte>& ret, const list<Ice::Byte>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - list<Ice::Byte> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opByteListI> AMI_TestIntf_opByteListIPtr; - -class AMI_TestIntf_opMyByteSeqI : public Test::AMI_TestIntf_opMyByteSeq, public CallbackBase -{ -public: - - AMI_TestIntf_opMyByteSeqI(MyByteSeq in) - : _in(in) - { - } - - virtual void ice_response(const MyByteSeq& ret, const MyByteSeq& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - MyByteSeq _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opMyByteSeqI> AMI_TestIntf_opMyByteSeqIPtr; - -class AMI_TestIntf_opStringSeqI : public Test::AMI_TestIntf_opStringSeq, public CallbackBase -{ -public: - - AMI_TestIntf_opStringSeqI(deque<string> in) - : _in(in) - { - } - - virtual void ice_response(const deque<string>& ret, const deque<string>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - deque<string> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opStringSeqI> AMI_TestIntf_opStringSeqIPtr; - -class AMI_TestIntf_opStringListI : public Test::AMI_TestIntf_opStringList, public CallbackBase -{ -public: - - AMI_TestIntf_opStringListI(list<string> in) - : _in(in) - { - } - - virtual void ice_response(const list<string>& ret, const list<string>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - list<string> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opStringListI> AMI_TestIntf_opStringListIPtr; - -class AMI_TestIntf_opFixedSeqI : public Test::AMI_TestIntf_opFixedSeq, public CallbackBase -{ -public: - - AMI_TestIntf_opFixedSeqI(deque<Test::Fixed> in) - : _in(in) - { - } - - virtual void ice_response(const deque<Test::Fixed>& ret, const deque<Test::Fixed>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - deque<Test::Fixed> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opFixedSeqI> AMI_TestIntf_opFixedSeqIPtr; - -class AMI_TestIntf_opFixedListI : public Test::AMI_TestIntf_opFixedList, public CallbackBase -{ -public: - - AMI_TestIntf_opFixedListI(list<Test::Fixed> in) - : _in(in) - { - } - - virtual void ice_response(const list<Test::Fixed>& ret, const list<Test::Fixed>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - list<Test::Fixed> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opFixedListI> AMI_TestIntf_opFixedListIPtr; - -class AMI_TestIntf_opVariableSeqI : public Test::AMI_TestIntf_opVariableSeq, public CallbackBase -{ -public: - - AMI_TestIntf_opVariableSeqI(deque<Test::Variable> in) - : _in(in) - { - } - - virtual void ice_response(const deque<Test::Variable>& ret, const deque<Test::Variable>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - deque<Test::Variable> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opVariableSeqI> AMI_TestIntf_opVariableSeqIPtr; - -class AMI_TestIntf_opVariableListI : public Test::AMI_TestIntf_opVariableList, public CallbackBase -{ -public: - - AMI_TestIntf_opVariableListI(list<Test::Variable> in) - : _in(in) - { - } - - virtual void ice_response(const list<Test::Variable>& ret, const list<Test::Variable>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - list<Test::Variable> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opVariableListI> AMI_TestIntf_opVariableListIPtr; - -class AMI_TestIntf_opStringStringDictSeqI : public Test::AMI_TestIntf_opStringStringDictSeq, public CallbackBase -{ -public: - - AMI_TestIntf_opStringStringDictSeqI(deque<Test::StringStringDict> in) - : _in(in) - { - } - - virtual void ice_response(const deque<Test::StringStringDict>& ret, const deque<Test::StringStringDict>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - deque<Test::StringStringDict> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opStringStringDictSeqI> AMI_TestIntf_opStringStringDictSeqIPtr; - -class AMI_TestIntf_opStringStringDictListI : public Test::AMI_TestIntf_opStringStringDictList, public CallbackBase -{ -public: - - AMI_TestIntf_opStringStringDictListI(list<Test::StringStringDict> in) - : _in(in) - { - } - - virtual void ice_response(const list<Test::StringStringDict>& ret, const list<Test::StringStringDict>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - list<Test::StringStringDict> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opStringStringDictListI> AMI_TestIntf_opStringStringDictListIPtr; - -class AMI_TestIntf_opESeqI : public Test::AMI_TestIntf_opESeq, public CallbackBase -{ -public: - - AMI_TestIntf_opESeqI(deque<Test::E> in) - : _in(in) - { - } - - virtual void ice_response(const deque<Test::E>& ret, const deque<Test::E>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - deque<Test::E> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opESeqI> AMI_TestIntf_opESeqIPtr; - -class AMI_TestIntf_opEListI : public Test::AMI_TestIntf_opEList, public CallbackBase -{ -public: - - AMI_TestIntf_opEListI(list<Test::E> in) - : _in(in) - { - } - - virtual void ice_response(const list<Test::E>& ret, const list<Test::E>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - list<Test::E> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opEListI> AMI_TestIntf_opEListIPtr; - -class AMI_TestIntf_opCPrxSeqI : public Test::AMI_TestIntf_opCPrxSeq, public CallbackBase -{ -public: - - AMI_TestIntf_opCPrxSeqI(deque<Test::CPrx> in) - : _in(in) - { - } - - virtual void ice_response(const deque<Test::CPrx>& ret, const deque<Test::CPrx>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - deque<Test::CPrx> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opCPrxSeqI> AMI_TestIntf_opCPrxSeqIPtr; - -class AMI_TestIntf_opCPrxListI : public Test::AMI_TestIntf_opCPrxList, public CallbackBase -{ -public: - - AMI_TestIntf_opCPrxListI(list<Test::CPrx> in) - : _in(in) - { - } - - virtual void ice_response(const list<Test::CPrx>& ret, const list<Test::CPrx>& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - list<Test::CPrx> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opCPrxListI> AMI_TestIntf_opCPrxListIPtr; - -class AMI_TestIntf_opCSeqI : public Test::AMI_TestIntf_opCSeq, public CallbackBase -{ -public: - - AMI_TestIntf_opCSeqI(deque<Test::CPtr> in) - : _in(in) - { - } - - virtual void ice_response(const deque<Test::CPtr>& ret, const deque<Test::CPtr>& out) - { - test(out.size() == _in.size()); - test(ret.size() == _in.size()); - for(unsigned int i = 1; i < _in.size(); ++i) - { - test(out[i] == out[0]); - test(ret[i] == out[i]); - } - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - deque<Test::CPtr> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opCSeqI> AMI_TestIntf_opCSeqIPtr; - -class AMI_TestIntf_opCListI : public Test::AMI_TestIntf_opCList, public CallbackBase -{ -public: - - AMI_TestIntf_opCListI(list<Test::CPtr> in) - : _in(in) - { - } - - virtual void ice_response(const list<Test::CPtr>& ret, const list<Test::CPtr>& out) - { - test(out.size() == _in.size()); - test(ret.size() == _in.size()); - list<Test::CPtr>::const_iterator p1; - list<Test::CPtr>::const_iterator p2; - for(p1 = out.begin(), p2 = ret.begin(); p1 != out.end(); ++p1, ++p2) - { - test(*p1 == *p2); - } - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - list<Test::CPtr> _in; -}; - -typedef IceUtil::Handle<AMI_TestIntf_opCListI> AMI_TestIntf_opCListIPtr; - -class AMI_TestIntf_opClassStructI : public Test::AMI_TestIntf_opClassStruct, public CallbackBase -{ -public: - - AMI_TestIntf_opClassStructI(const Test::ClassStructPtr& cs, const Test::ClassStructSeq& csseq1) : - _cs(cs), _csseq1(csseq1) - { - } - - virtual void ice_response(const ::Test::ClassStructPtr& ret, - const ::Test::ClassStructPtr& cs1, - const ::Test::ClassStructSeq& seq) - { - test(ret == _cs); - test(cs1 == _cs); - test(seq == _csseq1); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - const Test::ClassStructPtr _cs; - const Test::ClassStructSeq _csseq1; -}; -typedef IceUtil::Handle<AMI_TestIntf_opClassStructI> AMI_TestIntf_opClassStructIPtr; - -class AMI_Test1_opStringI : public Test1::AMI_WstringClass_opString, public CallbackBase -{ -public: - - AMI_Test1_opStringI(wstring in) - : _in(in) - { - } - - virtual void ice_response(const wstring& ret, const wstring& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - wstring _in; -}; - -typedef IceUtil::Handle<AMI_Test1_opStringI> AMI_Test1_opStringIPtr; - -class AMI_Test2_opStringI : public Test2::AMI_WstringClass_opString, public CallbackBase -{ -public: - - AMI_Test2_opStringI(wstring in) - : _in(in) - { - } - - virtual void ice_response(const wstring& ret, const wstring& out) - { - test(out == _in); - test(ret == _in); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - wstring _in; -}; - -typedef IceUtil::Handle<AMI_Test2_opStringI> AMI_Test2_opStringIPtr; - -class AMI_Test1_throwExceptI : public Test1::AMI_WstringClass_throwExcept, public CallbackBase -{ -public: - - AMI_Test1_throwExceptI(wstring in) - : _in(in) - { - } - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const ::Ice::Exception& ex) - { - try - { - ex.ice_throw(); - } - catch(const Test1::WstringException& e) - { - test(e.reason == _in); - called(); - } - catch(...) - { - test(false); - } - } - -private: - - wstring _in; -}; - -typedef IceUtil::Handle<AMI_Test1_throwExceptI> AMI_Test1_throwExceptIPtr; - -class AMI_Test2_throwExceptI : public Test2::AMI_WstringClass_throwExcept, public CallbackBase -{ -public: - - AMI_Test2_throwExceptI(wstring in) - : _in(in) - { - } - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const ::Ice::Exception& ex) - { - try - { - ex.ice_throw(); - } - catch(const Test2::WstringException& e) - { - test(e.reason == _in); - called(); - } - catch(...) - { - test(false); - } - } - -private: - - wstring _in; -}; - -typedef IceUtil::Handle<AMI_Test2_throwExceptI> AMI_Test2_throwExceptIPtr; - class InParam : public Ice::LocalObject { }; @@ -2227,452 +1227,8 @@ allTests(const Ice::CommunicatorPtr& communicator) test(rs == rs2); } cout << "ok" << endl; - - cout << "testing alternate sequences with AMI... " << flush; - - { - Test::DoubleSeq in(5); - in[0] = 3.14; - in[1] = 1 / 3; - in[2] = 0.375; - in[3] = 4 / 3; - in[4] = -5.725; - Ice::Double inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const Ice::Double*, const Ice::Double*> inPair(inArray, inArray + 5); - - AMI_TestIntf_opDoubleArrayIPtr cb = new AMI_TestIntf_opDoubleArrayI(inPair); - t->opDoubleArray_async(cb, inPair); - cb->check(); - } - - { - Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - bool inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const bool*, const bool*> inPair(inArray, inArray + 5); - - AMI_TestIntf_opBoolArrayIPtr cb = new AMI_TestIntf_opBoolArrayI(inPair); - t->opBoolArray_async(cb, inPair); - cb->check(); - } - - { - Ice::Byte in[5]; - in[0] = '1'; - in[1] = '2'; - in[2] = '3'; - in[3] = '4'; - in[4] = '5'; - pair<const Ice::Byte*, const Ice::Byte*> inPair(in, in + 5); - - AMI_TestIntf_opByteArrayIPtr cb = new AMI_TestIntf_opByteArrayI(inPair); - t->opByteArray_async(cb, inPair); - cb->check(); - } - - { - Test::VariableList in; - Test::Variable inArray[5]; - inArray[0].s = "These"; - in.push_back(inArray[0]); - inArray[1].s = "are"; - in.push_back(inArray[1]); - inArray[2].s = "five"; - in.push_back(inArray[2]); - inArray[3].s = "short"; - in.push_back(inArray[3]); - inArray[4].s = "strings."; - in.push_back(inArray[4]); - pair<const Test::Variable*, const Test::Variable*> inPair(inArray, inArray + 5); - - AMI_TestIntf_opVariableArrayIPtr cb = new AMI_TestIntf_opVariableArrayI(inPair); - t->opVariableArray_async(cb, inPair); - cb->check(); - } - - { - Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> inPair(in.begin(), in.end()); - - AMI_TestIntf_opBoolRangeIPtr cb = new AMI_TestIntf_opBoolRangeI(inPair); - t->opBoolRange_async(cb, inPair); - cb->check(); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); - - AMI_TestIntf_opByteRangeIPtr cb = new AMI_TestIntf_opByteRangeI(inPair); - t->opByteRange_async(cb, inPair); - cb->check(); - } - - { - Test::VariableList in; - Test::Variable v; - v.s = "These"; - in.push_back(v); - v.s = "are"; - in.push_back(v); - v.s = "five"; - in.push_back(v); - v.s = "short"; - in.push_back(v); - v.s = "strings."; - in.push_back(v); - pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator> inPair(in.begin(), in.end()); - - AMI_TestIntf_opVariableRangeIPtr cb = new AMI_TestIntf_opVariableRangeI(inPair); - t->opVariableRange_async(cb, inPair); - cb->check(); - } - - { - Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - bool inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const bool*, const bool*> inPair(inArray, inArray + 5); - - AMI_TestIntf_opBoolRangeTypeIPtr cb = new AMI_TestIntf_opBoolRangeTypeI(inPair); - t->opBoolRangeType_async(cb, inPair); - cb->check(); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); - - AMI_TestIntf_opByteRangeTypeIPtr cb = new AMI_TestIntf_opByteRangeTypeI(inPair); - t->opByteRangeType_async(cb, inPair); - cb->check(); - } - - { - Test::VariableList in; - deque<Test::Variable> inSeq; - Test::Variable v; - v.s = "These"; - in.push_back(v); - inSeq.push_back(v); - v.s = "are"; - in.push_back(v); - inSeq.push_back(v); - v.s = "five"; - in.push_back(v); - inSeq.push_back(v); - v.s = "short"; - in.push_back(v); - inSeq.push_back(v); - v.s = "strings."; - in.push_back(v); - inSeq.push_back(v); - pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator> inPair(inSeq.begin(), - inSeq.end()); - - AMI_TestIntf_opVariableRangeTypeIPtr cb = new AMI_TestIntf_opVariableRangeTypeI(inPair); - t->opVariableRangeType_async(cb, inPair); - cb->check(); - } - - { - deque<bool> in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - - AMI_TestIntf_opBoolSeqIPtr cb = new AMI_TestIntf_opBoolSeqI(in); - t->opBoolSeq_async(cb, in); - cb->check(); - } - - { - list<bool> in; - in.push_back(false); - in.push_back(true); - in.push_back(true); - in.push_back(false); - in.push_back(true); - - AMI_TestIntf_opBoolListIPtr cb = new AMI_TestIntf_opBoolListI(in); - t->opBoolList_async(cb, in); - cb->check(); - } - - { - deque< ::Ice::Byte> in(5); - in[0] = '1'; - in[1] = '2'; - in[2] = '3'; - in[3] = '4'; - in[4] = '5'; - - AMI_TestIntf_opByteSeqIPtr cb = new AMI_TestIntf_opByteSeqI(in); - t->opByteSeq_async(cb, in); - cb->check(); - } - - { - list< ::Ice::Byte> in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - - AMI_TestIntf_opByteListIPtr cb = new AMI_TestIntf_opByteListI(in); - t->opByteList_async(cb, in); - cb->check(); - } - - { - MyByteSeq in(5); - int i = 0; - for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p) - { - *p = '1' + i++; - } - - AMI_TestIntf_opMyByteSeqIPtr cb = new AMI_TestIntf_opMyByteSeqI(in); - t->opMyByteSeq_async(cb, in); - cb->check(); - } - - { - deque<string> in(5); - in[0] = "These"; - in[1] = "are"; - in[2] = "five"; - in[3] = "short"; - in[4] = "strings."; - - AMI_TestIntf_opStringSeqIPtr cb = new AMI_TestIntf_opStringSeqI(in); - t->opStringSeq_async(cb, in); - cb->check(); - } - - { - list<string> in; - in.push_back("These"); - in.push_back("are"); - in.push_back("five"); - in.push_back("short"); - in.push_back("strings."); - - AMI_TestIntf_opStringListIPtr cb = new AMI_TestIntf_opStringListI(in); - t->opStringList_async(cb, in); - cb->check(); - } - - { - deque<Test::Fixed> in(5); - in[0].s = 1; - in[1].s = 2; - in[2].s = 3; - in[3].s = 4; - in[4].s = 5; - - AMI_TestIntf_opFixedSeqIPtr cb = new AMI_TestIntf_opFixedSeqI(in); - t->opFixedSeq_async(cb, in); - cb->check(); - } - - { - list<Test::Fixed> in(5); - short num = 1; - for(list<Test::Fixed>::iterator p = in.begin(); p != in.end(); ++p) - { - (*p).s = num++; - } - - AMI_TestIntf_opFixedListIPtr cb = new AMI_TestIntf_opFixedListI(in); - t->opFixedList_async(cb, in); - cb->check(); - } - - { - deque<Test::Variable> in(5); - in[0].s = "These"; - in[1].s = "are"; - in[2].s = "five"; - in[3].s = "short"; - in[4].s = "strings."; - - AMI_TestIntf_opVariableSeqIPtr cb = new AMI_TestIntf_opVariableSeqI(in); - t->opVariableSeq_async(cb, in); - cb->check(); - } - - { - list<Test::Variable> in; - Test::Variable v; - v.s = "These"; - in.push_back(v); - v.s = "are"; - in.push_back(v); - v.s = "five"; - in.push_back(v); - v.s = "short"; - in.push_back(v); - v.s = "strings."; - in.push_back(v); - - AMI_TestIntf_opVariableListIPtr cb = new AMI_TestIntf_opVariableListI(in); - t->opVariableList_async(cb, in); - cb->check(); - } - - { - deque<Test::StringStringDict> in(5); - in[0]["A"] = "a"; - in[1]["B"] = "b"; - in[2]["C"] = "c"; - in[3]["D"] = "d"; - in[4]["E"] = "e"; - - AMI_TestIntf_opStringStringDictSeqIPtr cb = new AMI_TestIntf_opStringStringDictSeqI(in); - t->opStringStringDictSeq_async(cb, in); - cb->check(); - } - - { - list<Test::StringStringDict> in; - Test::StringStringDict ssd; - ssd["A"] = "a"; - in.push_back(ssd); - ssd["B"] = "b"; - in.push_back(ssd); - ssd["C"] = "c"; - in.push_back(ssd); - ssd["D"] = "d"; - in.push_back(ssd); - ssd["E"] = "e"; - in.push_back(ssd); - - AMI_TestIntf_opStringStringDictListIPtr cb = new AMI_TestIntf_opStringStringDictListI(in); - t->opStringStringDictList_async(cb, in); - cb->check(); - } - - { - deque<Test::E> in(5); - in[0] = Test::E1; - in[1] = Test::E2; - in[2] = Test::E3; - in[3] = Test::E1; - in[4] = Test::E3; - - AMI_TestIntf_opESeqIPtr cb = new AMI_TestIntf_opESeqI(in); - t->opESeq_async(cb, in); - cb->check(); - } - - { - list<Test::E> in; - in.push_back(Test::E1); - in.push_back(Test::E2); - in.push_back(Test::E3); - in.push_back(Test::E1); - in.push_back(Test::E3); - - AMI_TestIntf_opEListIPtr cb = new AMI_TestIntf_opEListI(in); - t->opEList_async(cb, in); - cb->check(); - } - - { - deque<Test::CPrx> in(5); - in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")); - in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")); - in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")); - in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")); - in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")); - - AMI_TestIntf_opCPrxSeqIPtr cb = new AMI_TestIntf_opCPrxSeqI(in); - t->opCPrxSeq_async(cb, in); - cb->check(); - } - - { - list<Test::CPrx> in; - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"))); - - AMI_TestIntf_opCPrxListIPtr cb = new AMI_TestIntf_opCPrxListI(in); - t->opCPrxList_async(cb, in); - cb->check(); - } - - { - deque<Test::CPtr> in(5); - in[0] = new Test::C(); - in[1] = in[0]; - in[2] = in[0]; - in[3] = in[0]; - in[4] = in[0]; - - AMI_TestIntf_opCSeqIPtr cb = new AMI_TestIntf_opCSeqI(in); - t->opCSeq_async(cb, in); - cb->check(); - } - - { - list<Test::CPtr> in; - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - - AMI_TestIntf_opCListIPtr cb = new AMI_TestIntf_opCListI(in); - t->opCList_async(cb, in); - cb->check(); - } - - cout << "ok" << endl; - - cout << "testing alternate strings with new AMI... " << flush; + cout << "testing alternate strings with AMI... " << flush; { Util::string_view in = "Hello World!"; @@ -2685,7 +1241,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing alternate sequences with new AMI... " << flush; + cout << "testing alternate sequences with AMI... " << flush; { { Test::DoubleSeq in(5); @@ -4758,14 +3314,6 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing class mapped structs with AMI... " << flush; { - AMI_TestIntf_opClassStructIPtr cb = new AMI_TestIntf_opClassStructI(cs, csseq1); - t->opClassStruct_async(cb, cs, csseq1); - cb->check(); - } - cout << "ok" << endl; - - cout << "testing class mapped structs with new AMI... " << flush; - { Test::ClassStructPtr cs2; Test::ClassStructSeq csseq2; Ice::AsyncResultPtr r = t->begin_opClassStruct(cs, csseq1); @@ -4835,11 +3383,6 @@ allTests(const Ice::CommunicatorPtr& communicator) test(ret == wstr); { - AMI_Test1_opStringIPtr cb = new AMI_Test1_opStringI(wstr); - wsc1->opString_async(cb, wstr); - cb->check(); - } - { Ice::AsyncResultPtr r = wsc1->begin_opString(wstr); wstring out; wstring ret = wsc1->end_opString(out, r); @@ -4873,11 +3416,6 @@ allTests(const Ice::CommunicatorPtr& communicator) test(ret == wstr); { - AMI_Test2_opStringIPtr cb = new AMI_Test2_opStringI(wstr); - wsc2->opString_async(cb, wstr); - cb->check(); - } - { Ice::AsyncResultPtr r = wsc2->begin_opString(wstr); wstring out; wstring ret = wsc2->end_opString(out, r); @@ -4936,11 +3474,6 @@ allTests(const Ice::CommunicatorPtr& communicator) } { - AMI_Test1_throwExceptIPtr cb = new AMI_Test1_throwExceptI(wstr); - wsc1->throwExcept_async(cb, wstr); - cb->check(); - } - { Ice::AsyncResultPtr r = wsc1->begin_throwExcept(wstr); try { @@ -4979,11 +3512,6 @@ allTests(const Ice::CommunicatorPtr& communicator) } { - AMI_Test2_throwExceptIPtr cb = new AMI_Test2_throwExceptI(wstr); - wsc2->throwExcept_async(cb, wstr); - cb->check(); - } - { Ice::AsyncResultPtr r = wsc2->begin_throwExcept(wstr); try { diff --git a/cpp/test/Ice/custom/Test.ice b/cpp/test/Ice/custom/Test.ice index 30926c6542e..4a3a79a5e67 100644 --- a/cpp/test/Ice/custom/Test.ice +++ b/cpp/test/Ice/custom/Test.ice @@ -138,7 +138,7 @@ class DictClass DoubleBuffer doubleBuf; }; -["ami"] class TestIntf +class TestIntf { ["cpp:array"] DoubleSeq opDoubleArray(["cpp:array"] DoubleSeq inSeq, out ["cpp:array"] DoubleSeq outSeq); diff --git a/cpp/test/Ice/custom/TestAMD.ice b/cpp/test/Ice/custom/TestAMD.ice index 2047de07e15..044b897deca 100644 --- a/cpp/test/Ice/custom/TestAMD.ice +++ b/cpp/test/Ice/custom/TestAMD.ice @@ -136,7 +136,7 @@ struct BufferStruct DoubleBuffer doubleBuf; }; -["amd", "ami"] class TestIntf +["amd"] class TestIntf { DoubleSeq opDoubleArray(["cpp:array"] DoubleSeq inSeq, out DoubleSeq outSeq); diff --git a/cpp/test/Ice/custom/Wstring.ice b/cpp/test/Ice/custom/Wstring.ice index 74b5fd51f1a..01ab6ef5eac 100644 --- a/cpp/test/Ice/custom/Wstring.ice +++ b/cpp/test/Ice/custom/Wstring.ice @@ -26,7 +26,7 @@ exception WstringException string reason; }; -["ami"] class WstringClass +class WstringClass { string opString(string s1, out string s2); @@ -57,7 +57,7 @@ dictionary<["cpp:type:wstring"] string, ["cpp:type:wstring"] string> WstringWStr string reason; }; -["ami", "cpp:type:wstring"] class WstringClass +["cpp:type:wstring"] class WstringClass { string opString(string s1, out string s2); diff --git a/cpp/test/Ice/custom/WstringAMD.ice b/cpp/test/Ice/custom/WstringAMD.ice index 74b27c153b0..c50f1376da3 100644 --- a/cpp/test/Ice/custom/WstringAMD.ice +++ b/cpp/test/Ice/custom/WstringAMD.ice @@ -26,7 +26,7 @@ exception WstringException string reason; }; -["amd", "ami"] class WstringClass +["amd"] class WstringClass { string opString(string s1, out string s2); @@ -57,7 +57,7 @@ dictionary<["cpp:type:wstring"] string, ["cpp:type:wstring"] string> WstringWStr string reason; }; -["amd", "ami", "cpp:type:wstring"] class WstringClass +["amd", "cpp:type:wstring"] class WstringClass { string opString(string s1, out string s2); diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp index 81a093f5c2c..5432ff35ee0 100644 --- a/cpp/test/Ice/exceptions/AllTests.cpp +++ b/cpp/test/Ice/exceptions/AllTests.cpp @@ -72,502 +72,6 @@ private: bool _called; }; -class AMI_Thrower_throwAasAI : public AMI_Thrower_throwAasA, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const A& ex) - { - test(ex.aMem == 1); - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwAasAI> AMI_Thrower_throwAasAIPtr; - -class AMI_Thrower_throwAasAObjectNotExistI : public AMI_Thrower_throwAasA, public CallbackBase -{ -public: - - AMI_Thrower_throwAasAObjectNotExistI(const Ice::CommunicatorPtr& communicator) : - _communicator(communicator) - { - } - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const Ice::ObjectNotExistException& ex) - { - Ice::Identity id = _communicator->stringToIdentity("does not exist"); - test(ex.id == id); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - test(false); - } - catch(...) - { - test(false); - } - called(); - } - -private: - - Ice::CommunicatorPtr _communicator; -}; - -typedef IceUtil::Handle<AMI_Thrower_throwAasAObjectNotExistI> AMI_Thrower_throwAasAObjectNotExistIPtr; - -class AMI_Thrower_throwAasAFacetNotExistI : public AMI_Thrower_throwAasA, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const Ice::FacetNotExistException& ex) - { - test(ex.facet == "no such facet"); - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwAasAFacetNotExistI> AMI_Thrower_throwAasAFacetNotExistIPtr; - -class AMI_Thrower_throwAorDasAorDI : public AMI_Thrower_throwAorDasAorD, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const A& ex) - { - test(ex.aMem == 1); - } - catch(const D& ex) - { - test(ex.dMem == -1); - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwAorDasAorDI> AMI_Thrower_throwAorDasAorDIPtr; - -class AMI_Thrower_throwBasAI : public AMI_Thrower_throwBasA, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const B& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwBasAI> AMI_Thrower_throwBasAIPtr; - -class AMI_Thrower_throwCasAI : public AMI_Thrower_throwCasA, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const C& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwCasAI> AMI_Thrower_throwCasAIPtr; - -class AMI_Thrower_throwBasBI : public AMI_Thrower_throwBasB, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const B& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwBasBI> AMI_Thrower_throwBasBIPtr; - -class AMI_Thrower_throwCasBI : public AMI_Thrower_throwCasB, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const C& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwCasBI> AMI_Thrower_throwCasBIPtr; - -class AMI_Thrower_throwCasCI : public AMI_Thrower_throwCasC, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const C& ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwCasCI> AMI_Thrower_throwCasCIPtr; - - -class AMI_Thrower_throwModAI : public AMI_Thrower_throwModA, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const Mod::A& ex) - { - test(ex.aMem == 1); - test(ex.a2Mem == 2); - } - catch(const Ice::OperationNotExistException&) - { - // - // This operation is not supported in Java. - // - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwModAI> AMI_Thrower_throwModAIPtr; - - - -class AMI_Thrower_throwUndeclaredAI : public AMI_Thrower_throwUndeclaredA, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownUserException&) - { - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwUndeclaredAI> AMI_Thrower_throwUndeclaredAIPtr; - -class AMI_Thrower_throwUndeclaredBI : public AMI_Thrower_throwUndeclaredB, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownUserException&) - { - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwUndeclaredBI> AMI_Thrower_throwUndeclaredBIPtr; - -class AMI_Thrower_throwUndeclaredCI : public AMI_Thrower_throwUndeclaredC, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownUserException&) - { - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwUndeclaredCI> AMI_Thrower_throwUndeclaredCIPtr; - -class AMI_Thrower_throwLocalExceptionI : public AMI_Thrower_throwLocalException, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownLocalException&) - { - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwLocalExceptionI> AMI_Thrower_throwLocalExceptionIPtr; - -class AMI_Thrower_throwNonIceExceptionI : public AMI_Thrower_throwNonIceException, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const Ice::UnknownException&) - { - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_Thrower_throwNonIceExceptionI> AMI_Thrower_throwNonIceExceptionIPtr; - -class AMI_WrongOperation_noSuchOperationI : public AMI_WrongOperation_noSuchOperation, public CallbackBase -{ -public: - - virtual void ice_response() - { - test(false); - } - - virtual void ice_exception(const Ice::Exception& exc) - { - try - { - exc.ice_throw(); - } - catch(const Ice::OperationNotExistException& ex) - { - test(ex.operation == "noSuchOperation"); - } - catch(...) - { - test(false); - } - called(); - } -}; - -typedef IceUtil::Handle<AMI_WrongOperation_noSuchOperationI> AMI_WrongOperation_noSuchOperationIPtr; - class Callback : public CallbackBase, public IceUtil::Shared { public: @@ -1540,151 +1044,6 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - - cout << "catching exact types with AMI... " << flush; - - { - AMI_Thrower_throwAasAIPtr cb = new AMI_Thrower_throwAasAI; - thrower->throwAasA_async(cb, 1); - cb->check(); - // Let's check if we can reuse the same callback object for another call. - thrower->throwAasA_async(cb, 1); - cb->check(); - } - - { - AMI_Thrower_throwAorDasAorDIPtr cb = new AMI_Thrower_throwAorDasAorDI; - thrower->throwAorDasAorD_async(cb, 1); - cb->check(); - } - - { - AMI_Thrower_throwAorDasAorDIPtr cb = new AMI_Thrower_throwAorDasAorDI; - thrower->throwAorDasAorD_async(cb, -1); - cb->check(); - } - - { - AMI_Thrower_throwBasBIPtr cb = new AMI_Thrower_throwBasBI; - thrower->throwBasB_async(cb, 1, 2); - cb->check(); - } - - { - AMI_Thrower_throwCasCIPtr cb = new AMI_Thrower_throwCasCI; - thrower->throwCasC_async(cb, 1, 2, 3); - cb->check(); - // Let's check if we can reuse the same callback object for another call. - thrower->throwCasC_async(cb, 1, 2, 3); - cb->check(); - } - - { - AMI_Thrower_throwModAIPtr cb = new AMI_Thrower_throwModAI; - thrower->throwModA_async(cb, 1, 2); - cb->check(); - } - - cout << "ok" << endl; - - cout << "catching derived types... " << flush; - - { - AMI_Thrower_throwBasAIPtr cb = new AMI_Thrower_throwBasAI; - thrower->throwBasA_async(cb, 1, 2); - cb->check(); - } - - { - AMI_Thrower_throwCasAIPtr cb = new AMI_Thrower_throwCasAI; - thrower->throwCasA_async(cb, 1, 2, 3); - cb->check(); - } - - { - AMI_Thrower_throwCasBIPtr cb = new AMI_Thrower_throwCasBI; - thrower->throwCasB_async(cb, 1, 2, 3); - cb->check(); - } - - cout << "ok" << endl; - - if(thrower->supportsUndeclaredExceptions()) - { - cout << "catching unknown user exception with AMI... " << flush; - - { - AMI_Thrower_throwUndeclaredAIPtr cb = new AMI_Thrower_throwUndeclaredAI; - thrower->throwUndeclaredA_async(cb, 1); - cb->check(); - } - - { - AMI_Thrower_throwUndeclaredBIPtr cb = new AMI_Thrower_throwUndeclaredBI; - thrower->throwUndeclaredB_async(cb, 1, 2); - cb->check(); - } - - { - AMI_Thrower_throwUndeclaredCIPtr cb = new AMI_Thrower_throwUndeclaredCI; - thrower->throwUndeclaredC_async(cb, 1, 2, 3); - cb->check(); - } - - cout << "ok" << endl; - } - - cout << "catching object not exist exception with AMI... " << flush; - - { - id = communicator->stringToIdentity("does not exist"); - ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower->ice_identity(id)); - AMI_Thrower_throwAasAObjectNotExistIPtr cb = new AMI_Thrower_throwAasAObjectNotExistI(communicator); - thrower2->throwAasA_async(cb, 1); - cb->check(); - } - - cout << "ok" << endl; - - cout << "catching facet not exist exception with AMI... " << flush; - - ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower, "no such facet"); - { - AMI_Thrower_throwAasAFacetNotExistIPtr cb = new AMI_Thrower_throwAasAFacetNotExistI; - thrower2->throwAasA_async(cb, 1); - cb->check(); - } - - cout << "ok" << endl; - - cout << "catching operation not exist exception with AMI... " << flush; - - { - AMI_WrongOperation_noSuchOperationIPtr cb = new AMI_WrongOperation_noSuchOperationI; - WrongOperationPrx thrower4 = WrongOperationPrx::uncheckedCast(thrower); - thrower4->noSuchOperation_async(cb); - cb->check(); - } - - cout << "ok" << endl; - - cout << "catching unknown local exception with AMI... " << flush; - - { - AMI_Thrower_throwLocalExceptionIPtr cb = new AMI_Thrower_throwLocalExceptionI; - thrower->throwLocalException_async(cb); - cb->check(); - } - - cout << "ok" << endl; - - cout << "catching unknown non-Ice exception with AMI... " << flush; - - AMI_Thrower_throwNonIceExceptionIPtr cb = new AMI_Thrower_throwNonIceExceptionI; - thrower->throwNonIceException_async(cb); - cb->check(); - - cout << "ok" << endl; cout << "catching exact types with new AMI mapping... " << flush; @@ -1813,8 +1172,8 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "catching facet not exist exception with new AMI mapping... " << flush; - thrower2 = ThrowerPrx::uncheckedCast(thrower, "no such facet"); { + ThrowerPrx thrower2 = ThrowerPrx::uncheckedCast(thrower, "no such facet"); CallbackPtr cb = new Callback; Callback_Thrower_throwAasAPtr callback = newCallback_Thrower_throwAasA(cb, &Callback::response, &Callback::exception_AasAFacetNotExist); diff --git a/cpp/test/Ice/exceptions/Test.ice b/cpp/test/Ice/exceptions/Test.ice index 471a30769a0..68c3559a6dc 100644 --- a/cpp/test/Ice/exceptions/Test.ice +++ b/cpp/test/Ice/exceptions/Test.ice @@ -70,7 +70,7 @@ module Mod }; }; -["ami"] interface Thrower +interface Thrower { void shutdown(); bool supportsUndeclaredExceptions(); @@ -100,7 +100,7 @@ module Mod void throwAfterException() throws A; }; -["ami"] interface WrongOperation +interface WrongOperation { void noSuchOperation(); }; diff --git a/cpp/test/Ice/exceptions/TestAMD.ice b/cpp/test/Ice/exceptions/TestAMD.ice index c59d27a0d2e..a0764371dcc 100644 --- a/cpp/test/Ice/exceptions/TestAMD.ice +++ b/cpp/test/Ice/exceptions/TestAMD.ice @@ -71,7 +71,7 @@ module Mod }; -["ami", "amd"] interface Thrower +["amd"] interface Thrower { void shutdown(); bool supportsUndeclaredExceptions(); @@ -106,7 +106,7 @@ module Mod void throwH(); }; -["ami", "amd"] interface WrongOperation +["amd"] interface WrongOperation { void noSuchOperation(); }; diff --git a/cpp/test/Ice/operations/AllTests.cpp b/cpp/test/Ice/operations/AllTests.cpp index 62ca357166d..e81186f18f4 100644 --- a/cpp/test/Ice/operations/AllTests.cpp +++ b/cpp/test/Ice/operations/AllTests.cpp @@ -40,22 +40,11 @@ allTests(const Ice::CommunicatorPtr& communicator) twowaysAMI(communicator, derived); cout << "ok" << endl; - cout << "testing twoway operations with new AMI mapping... " << flush; - void twowaysNewAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx&); - twowaysNewAMI(communicator, cl); - twowaysNewAMI(communicator, derived); - cout << "ok" << endl; - cout << "testing oneway operations with AMI... " << flush; void onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx&); onewaysAMI(communicator, cl); cout << "ok" << endl; - cout << "testing oneway operations with new AMI mapping... " << flush; - void onewaysNewAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx&); - onewaysNewAMI(communicator, cl); - cout << "ok" << endl; - cout << "testing batch oneway operations... " << flush; void batchOneways(const Test::MyClassPrx&); batchOneways(cl); diff --git a/cpp/test/Ice/operations/Makefile b/cpp/test/Ice/operations/Makefile index 23db66b2101..f8e06334dc9 100644 --- a/cpp/test/Ice/operations/Makefile +++ b/cpp/test/Ice/operations/Makefile @@ -24,9 +24,7 @@ COBJS = Test.o \ Twoways.o \ Oneways.o \ TwowaysAMI.o \ - TwowaysNewAMI.o \ OnewaysAMI.o \ - OnewaysNewAMI.o \ BatchOneways.o \ BatchOnewaysAMI.o @@ -45,9 +43,7 @@ COLOBJS = Test.o \ Twoways.o \ Oneways.o \ TwowaysAMI.o \ - TwowaysNewAMI.o \ OnewaysAMI.o \ - OnewaysNewAMI.o \ BatchOneways.o \ BatchOnewaysAMI.o diff --git a/cpp/test/Ice/operations/Makefile.mak b/cpp/test/Ice/operations/Makefile.mak index c3593a12b26..a0cebb019bb 100644 --- a/cpp/test/Ice/operations/Makefile.mak +++ b/cpp/test/Ice/operations/Makefile.mak @@ -33,8 +33,6 @@ COBJS = .\Test.obj \ .\Oneways.obj \ .\TwowaysAMI.obj \ .\OnewaysAMI.obj \ - .\TwowaysNewAMI.obj \ - .\OnewaysNewAMI.obj \ .\BatchOneways.obj \ .\BatchOnewaysAMI.obj @@ -54,8 +52,6 @@ COLOBJS = .\Test.obj \ .\Oneways.obj \ .\TwowaysAMI.obj \ .\OnewaysAMI.obj \ - .\TwowaysNewAMI.obj \ - .\OnewaysNewAMI.obj \ .\BatchOneways.obj \ .\BatchOnewaysAMI.obj diff --git a/cpp/test/Ice/operations/OnewaysAMI.cpp b/cpp/test/Ice/operations/OnewaysAMI.cpp index a6749d69d2d..2c870f46891 100644 --- a/cpp/test/Ice/operations/OnewaysAMI.cpp +++ b/cpp/test/Ice/operations/OnewaysAMI.cpp @@ -10,14 +10,13 @@ #include <Ice/Ice.h> #include <TestCommon.h> #include <Test.h> -#include <limits> using namespace std; namespace { -class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> +class CallbackBase : public Ice::LocalObject { public: @@ -32,10 +31,10 @@ public: void check() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_m); while(!_called) { - wait(); + _m.wait(); } _called = false; } @@ -44,147 +43,197 @@ protected: void called() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_m); assert(!_called); _called = true; - notify(); + _m.notify(); } private: + IceUtil::Monitor<IceUtil::Mutex> _m; bool _called; }; -class AMI_MyClass_onewayOpVoidI : public Test::AMI_MyClass_opVoid, public CallbackBase +typedef IceUtil::Handle<CallbackBase> CallbackBasePtr; + +class Callback : public CallbackBase { public: - virtual void ice_response() + Callback() { - called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_onewayOpVoidI> AMI_MyClass_onewayOpVoidIPtr; - -class AMI_MyClass_onewayOpIdempotentI : public Test::AMI_MyClass_opIdempotent, public CallbackBase -{ -public: - - virtual void ice_response() + void sent(bool) { called(); } - virtual void ice_exception(const ::Ice::Exception&) + void noException(const Ice::Exception&) { test(false); } }; +typedef IceUtil::Handle<Callback> CallbackPtr; -typedef IceUtil::Handle<AMI_MyClass_onewayOpIdempotentI> AMI_MyClass_onewayOpIdempotentIPtr; +} -class AMI_MyClass_onewayOpNonmutatingI : public Test::AMI_MyClass_opNonmutating, public CallbackBase +void +onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) { -public: + Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast(proxy->ice_oneway()); - virtual void ice_response() { - called(); + 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); + cb->check(); } - virtual void ice_exception(const ::Ice::Exception&) { - test(false); + try + { + p->begin_ice_isA(Test::MyClass::ice_staticId()); + test(false); + } + catch(const IceUtil::IllegalArgumentException&) + { + } } -}; - -typedef IceUtil::Handle<AMI_MyClass_onewayOpNonmutatingI> AMI_MyClass_onewayOpNonmutatingIPtr; - -class AMI_MyClass_onewayOpVoidExI : public Test::AMI_MyClass_opVoid, public CallbackBase -{ -public: - - virtual void ice_response() + { - test(false); + try + { + p->begin_ice_id(); + test(false); + } + catch(const IceUtil::IllegalArgumentException&) + { + } } - - virtual void ice_exception(const ::Ice::Exception& ex) + { - test(dynamic_cast<const ::Ice::NoEndpointException*>(&ex)); - called(); + try + { + p->begin_ice_ids(); + test(false); + } + catch(const IceUtil::IllegalArgumentException&) + { + } } -}; -typedef IceUtil::Handle<AMI_MyClass_onewayOpVoidExI> AMI_MyClass_onewayOpVoidExIPtr; - -class AMI_MyClass_onewayOpByteExI : public Test::AMI_MyClass_opByte, public CallbackBase -{ -public: - - virtual void ice_response(::Ice::Byte, ::Ice::Byte) { - test(false); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opVoidPtr callback = + Test::newCallback_MyClass_opVoid(cb, &Callback::noException, &Callback::sent); + p->begin_opVoid(callback); + cb->check(); } - virtual void ice_exception(const ::Ice::Exception& ex) { - test(dynamic_cast<const ::Ice::TwowayOnlyException*>(&ex)); - called(); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opIdempotentPtr callback = + Test::newCallback_MyClass_opIdempotent(cb, &Callback::noException, &Callback::sent); + p->begin_opIdempotent(callback); + cb->check(); } -}; - -typedef IceUtil::Handle<AMI_MyClass_onewayOpByteExI> AMI_MyClass_onewayOpByteExIPtr; - -} - -void -onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) -{ - Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast(proxy->ice_oneway()); { - AMI_MyClass_onewayOpVoidIPtr cb = new AMI_MyClass_onewayOpVoidI(); - p->opVoid_async(cb); - // Let's check if we can reuse the same callback object for another call. - p->opVoid_async(cb); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opNonmutatingPtr callback = + Test::newCallback_MyClass_opNonmutating(cb, &Callback::noException, &Callback::sent); + p->begin_opNonmutating(callback); + cb->check(); } { - AMI_MyClass_onewayOpIdempotentIPtr cb = new AMI_MyClass_onewayOpIdempotentI(); - p->opIdempotent_async(cb); + try + { + p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f)); + test(false); + } + catch(const IceUtil::IllegalArgumentException&) + { + } } - +#ifdef ICE_CPP11 { - AMI_MyClass_onewayOpNonmutatingIPtr cb = new AMI_MyClass_onewayOpNonmutatingI(); - p->opNonmutating_async(cb); + CallbackPtr cb = new Callback; + p->begin_ice_ping(nullptr, + [=](const Ice::Exception& ex){ cb->noException(ex); }, + [=](bool sent){ cb->sent(sent); }); + cb->check(); } { - // Check that a call to a void operation raises NoEndpointException - // in the ice_exception() callback instead of at the point of call. - Test::MyClassPrx indirect = Test::MyClassPrx::uncheckedCast(p->ice_adapterId("dummy")); - AMI_MyClass_onewayOpVoidExIPtr cb = new AMI_MyClass_onewayOpVoidExI(); try { - indirect->opVoid_async(cb); + 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 Ice::Exception&) + 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(); } { - AMI_MyClass_onewayOpByteExIPtr cb = new AMI_MyClass_onewayOpByteExI(); - p->opByte_async(cb, 0, 0); + 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 } diff --git a/cpp/test/Ice/operations/OnewaysNewAMI.cpp b/cpp/test/Ice/operations/OnewaysNewAMI.cpp deleted file mode 100644 index 4dd9a79031d..00000000000 --- a/cpp/test/Ice/operations/OnewaysNewAMI.cpp +++ /dev/null @@ -1,239 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Ice/Ice.h> -#include <TestCommon.h> -#include <Test.h> - -using namespace std; - -namespace -{ - -class CallbackBase : public Ice::LocalObject -{ -public: - - CallbackBase() : - _called(false) - { - } - - virtual ~CallbackBase() - { - } - - void check() - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_m); - while(!_called) - { - _m.wait(); - } - _called = false; - } - -protected: - - void called() - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_m); - assert(!_called); - _called = true; - _m.notify(); - } - -private: - - IceUtil::Monitor<IceUtil::Mutex> _m; - bool _called; -}; - -typedef IceUtil::Handle<CallbackBase> CallbackBasePtr; - -class Callback : public CallbackBase -{ -public: - - Callback() - { - } - - void sent(bool) - { - called(); - } - - void noException(const Ice::Exception&) - { - test(false); - } -}; -typedef IceUtil::Handle<Callback> CallbackPtr; - -} - -void -onewaysNewAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrx& proxy) -{ - Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast(proxy->ice_oneway()); - - { - 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); - cb->check(); - } - - { - try - { - p->begin_ice_isA(Test::MyClass::ice_staticId()); - test(false); - } - catch(const IceUtil::IllegalArgumentException&) - { - } - } - - { - try - { - p->begin_ice_id(); - test(false); - } - catch(const IceUtil::IllegalArgumentException&) - { - } - } - - { - try - { - p->begin_ice_ids(); - test(false); - } - catch(const IceUtil::IllegalArgumentException&) - { - } - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opVoidPtr callback = - Test::newCallback_MyClass_opVoid(cb, &Callback::noException, &Callback::sent); - p->begin_opVoid(callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opIdempotentPtr callback = - Test::newCallback_MyClass_opIdempotent(cb, &Callback::noException, &Callback::sent); - p->begin_opIdempotent(callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opNonmutatingPtr callback = - Test::newCallback_MyClass_opNonmutating(cb, &Callback::noException, &Callback::sent); - p->begin_opNonmutating(callback); - cb->check(); - } - - { - try - { - p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f)); - test(false); - } - catch(const IceUtil::IllegalArgumentException&) - { - } - } -#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 -} diff --git a/cpp/test/Ice/operations/Test.ice b/cpp/test/Ice/operations/Test.ice index b3893d7fe3f..ba8e8996747 100644 --- a/cpp/test/Ice/operations/Test.ice +++ b/cpp/test/Ice/operations/Test.ice @@ -75,7 +75,7 @@ dictionary<MyStruct, MyEnum> MyStructMyEnumD; exception SomeException {}; -["ami"] class MyClass +class MyClass { void shutdown(); @@ -173,7 +173,7 @@ exception SomeException {}; ["nonmutating"] idempotent void opNonmutating(); }; -["ami"] class MyDerivedClass extends MyClass +class MyDerivedClass extends MyClass { void opDerived(); }; diff --git a/cpp/test/Ice/operations/TestAMD.ice b/cpp/test/Ice/operations/TestAMD.ice index ee39ee0edd4..951d81bfe2b 100644 --- a/cpp/test/Ice/operations/TestAMD.ice +++ b/cpp/test/Ice/operations/TestAMD.ice @@ -73,7 +73,7 @@ dictionary<string, MyEnum> StringMyEnumD; dictionary<MyEnum, string> MyEnumStringD; dictionary<MyStruct, MyEnum> MyStructMyEnumD; -["ami", "amd"] class MyClass +["amd"] class MyClass { void shutdown(); @@ -171,7 +171,7 @@ dictionary<MyStruct, MyEnum> MyStructMyEnumD; ["nonmutating"] idempotent void opNonmutating(); }; -["ami", "amd"] class MyDerivedClass extends MyClass +["amd"] class MyDerivedClass extends MyClass { void opDerived(); }; diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index 4723440088c..d7f6bc06dbd 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -10,7 +10,6 @@ #include <Ice/Ice.h> #include <TestCommon.h> #include <Test.h> -#include <limits> // // Work-around for GCC warning bug @@ -24,7 +23,7 @@ using namespace std; namespace { -class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> +class CallbackBase : public Ice::LocalObject { public: @@ -39,10 +38,10 @@ public: void check() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_m); while(!_called) { - wait(); + _m.wait(); } _called = false; } @@ -51,114 +50,84 @@ protected: void called() { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_m); assert(!_called); _called = true; - notify(); + _m.notify(); } private: + IceUtil::Monitor<IceUtil::Mutex> _m; bool _called; }; -class AMI_MyClass_opVoidI : public Test::AMI_MyClass_opVoid, public CallbackBase +typedef IceUtil::Handle<CallbackBase> CallbackBasePtr; + +class Callback : public CallbackBase { public: - virtual void ice_response() + Callback() { - called(); } - virtual void ice_exception(const ::Ice::Exception&) + Callback(const Ice::CommunicatorPtr& communicator) + : _communicator(communicator) { - test(false); } -}; - -typedef IceUtil::Handle<AMI_MyClass_opVoidI> AMI_MyClass_opVoidIPtr; -class AMI_MyClass_opVoidExI : public Test::AMI_MyClass_opVoid, public CallbackBase -{ -public: - - virtual void ice_response() + void ping() { - test(false); + called(); } - virtual void ice_exception(const ::Ice::Exception& ex) + void isA(bool result) { - test(dynamic_cast<const ::Ice::NoEndpointException*>(&ex)); + test(result); called(); } -}; -typedef IceUtil::Handle<AMI_MyClass_opVoidExI> AMI_MyClass_opVoidExIPtr; - -class AMI_MyClass_opByteI : public Test::AMI_MyClass_opByte, public CallbackBase -{ -public: - - virtual void ice_response(::Ice::Byte r, ::Ice::Byte b) + void id(const string& id) { - test(b == Ice::Byte(0xf0)); - test(r == Ice::Byte(0xff)); + test(id == Test::MyDerivedClass::ice_staticId()); called(); } - virtual void ice_exception(const ::Ice::Exception&) + void ids(const Ice::StringSeq& ids) { - test(false); + test(ids.size() == 3); + test(ids[0] == "::Ice::Object"); + test(ids[1] == "::Test::MyClass"); + test(ids[2] == "::Test::MyDerivedClass"); + called(); } -}; - -typedef IceUtil::Handle<AMI_MyClass_opByteI> AMI_MyClass_opByteIPtr; - -class AMI_MyClass_opByteExI : public Test::AMI_MyClass_opByte, public CallbackBase -{ -public: - virtual void ice_response(::Ice::Byte, ::Ice::Byte) + void opVoid() { - test(false); + called(); } - virtual void ice_exception(const ::Ice::Exception& ex) + void opContext(const Ice::Context&) { - test(dynamic_cast<const ::Ice::NoEndpointException*>(&ex)); called(); } -}; - -typedef IceUtil::Handle<AMI_MyClass_opByteExI> AMI_MyClass_opByteExIPtr; + void opByte(Ice::Byte r, Ice::Byte b) + { + test(b == Ice::Byte(0xf0)); + test(r == Ice::Byte(0xff)); + called(); + } -class AMI_MyClass_opBoolI : public Test::AMI_MyClass_opBool, public CallbackBase -{ -public: - - virtual void ice_response(bool r, bool b) + void opBool(bool r, bool b) { test(b); test(!r); called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opBoolI> AMI_MyClass_opBoolIPtr; - -class AMI_MyClass_opShortIntLongI : public Test::AMI_MyClass_opShortIntLong, public CallbackBase -{ -public: - - virtual void ice_response(::Ice::Long r, ::Ice::Short s, ::Ice::Int i, ::Ice::Long l) + void opShortIntLong(Ice::Long r, Ice::Short s, Ice::Int i, Ice::Long l) { test(s == 10); test(i == 11); @@ -167,19 +136,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opShortIntLongI> AMI_MyClass_opShortIntLongIPtr; - -class AMI_MyClass_opFloatDoubleI : public Test::AMI_MyClass_opFloatDouble, public CallbackBase -{ -public: - - virtual void ice_response(::Ice::Double r, ::Ice::Float f, ::Ice::Double d) + void opFloatDouble(Ice::Double r, Ice::Float f, Ice::Double d) { test(f == Ice::Float(3.14)); test(d == Ice::Double(1.1E10)); @@ -187,67 +144,29 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opFloatDoubleI> AMI_MyClass_opFloatDoubleIPtr; - -class AMI_MyClass_opStringI : public Test::AMI_MyClass_opString, public CallbackBase -{ -public: - - virtual void ice_response(const ::std::string& r, const ::std::string& s) + void opString(const ::std::string& r, const ::std::string& s) { test(s == "world hello"); test(r == "hello world"); called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opStringI> AMI_MyClass_opStringIPtr; - -class AMI_MyClass_opMyEnumI : public Test::AMI_MyClass_opMyEnum, public CallbackBase -{ -public: - - virtual void ice_response(::Test::MyEnum r, ::Test::MyEnum e) + void opMyEnum(Test::MyEnum r, Test::MyEnum e) { test(e == Test::enum2); test(r == Test::enum3); called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opMyEnumI> AMI_MyClass_opMyEnumIPtr; - -class AMI_MyClass_opMyClassI : public Test::AMI_MyClass_opMyClass, public CallbackBase -{ -public: - - AMI_MyClass_opMyClassI(const Ice::CommunicatorPtr& communicator) : - _communicator(communicator) - { - } - - virtual void ice_response(const ::Test::MyClassPrx& r, const ::Test::MyClassPrx& c1, const ::Test::MyClassPrx& c2) + void opMyClass(const Test::MyClassPrx& r, const Test::MyClassPrx& c1, const Test::MyClassPrx& c2) { test(c1->ice_getIdentity() == _communicator->stringToIdentity("test")); test(c2->ice_getIdentity() == _communicator->stringToIdentity("noSuchIdentity")); test(r->ice_getIdentity() == _communicator->stringToIdentity("test")); + + // // We can't do the callbacks below in connection serialization mode. + // if(_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPool.Client.Serialize")) { r->opVoid(); @@ -264,35 +183,17 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - Ice::CommunicatorPtr _communicator; -}; - -typedef IceUtil::Handle<AMI_MyClass_opMyClassI> AMI_MyClass_opMyClassIPtr; - -class AMI_MyClass_opStructI : public Test::AMI_MyClass_opStruct, public CallbackBase -{ -public: - - AMI_MyClass_opStructI(const Ice::CommunicatorPtr& communicator) : - _communicator(communicator) - { - } - - virtual void ice_response(const ::Test::Structure& rso, const ::Test::Structure& so) + void opStruct(const Test::Structure& rso, const Test::Structure& so) { test(rso.p == 0); test(rso.e == Test::enum2); test(rso.s.s == "def"); test(so.e == Test::enum3); test(so.s.s == "a new string"); + + // // We can't do the callbacks below in connection serialization mode. + // if(_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPool.Client.Serialize")) { so.p->opVoid(); @@ -300,23 +201,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - Ice::CommunicatorPtr _communicator; -}; - -typedef IceUtil::Handle<AMI_MyClass_opStructI> AMI_MyClass_opStructIPtr; - -class AMI_MyClass_opByteSI : public Test::AMI_MyClass_opByteS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::ByteS& rso, const ::Test::ByteS& bso) + void opByteS(const Test::ByteS& rso, const Test::ByteS& bso) { test(bso.size() == 4); test(bso[0] == Ice::Byte(0x22)); @@ -335,19 +220,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opByteSI> AMI_MyClass_opByteSIPtr; - -class AMI_MyClass_opBoolSI : public Test::AMI_MyClass_opBoolS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::BoolS& rso, const ::Test::BoolS& bso) + void opBoolS(const Test::BoolS& rso, const Test::BoolS& bso) { test(bso.size() == 4); test(bso[0]); @@ -361,20 +234,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opBoolSI> AMI_MyClass_opBoolSIPtr; - -class AMI_MyClass_opShortIntLongSI : public Test::AMI_MyClass_opShortIntLongS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::LongS& rso, const ::Test::ShortS& sso, const ::Test::IntS& iso, - const ::Test::LongS& lso) + void opShortIntLongS(const Test::LongS& rso, const Test::ShortS& sso, const Test::IntS& iso, const Test::LongS& lso) { test(sso.size() == 3); test(sso[0] == 1); @@ -399,19 +259,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opShortIntLongSI> AMI_MyClass_opShortIntLongSIPtr; - -class AMI_MyClass_opFloatDoubleSI : public Test::AMI_MyClass_opFloatDoubleS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::DoubleS& rso, const ::Test::FloatS& fso, const ::Test::DoubleS& dso) + void opFloatDoubleS(const Test::DoubleS& rso, const Test::FloatS& fso, const Test::DoubleS& dso) { test(fso.size() == 2); test(fso[0] == ::Ice::Float(3.14)); @@ -429,19 +277,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opFloatDoubleSI> AMI_MyClass_opFloatDoubleSIPtr; - -class AMI_MyClass_opStringSI : public Test::AMI_MyClass_opStringS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::StringS& rso, const ::Test::StringS& sso) + void opStringS(const Test::StringS& rso, const Test::StringS& sso) { test(sso.size() == 4); test(sso[0] == "abc"); @@ -455,19 +291,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opStringSI> AMI_MyClass_opStringSIPtr; - -class AMI_MyClass_opByteSSI : public Test::AMI_MyClass_opByteSS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::ByteSS& rso, const ::Test::ByteSS& bso) + void opByteSS(const Test::ByteSS& rso, const Test::ByteSS& bso) { test(bso.size() == 2); test(bso[0].size() == 1); @@ -491,19 +315,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opByteSSI> AMI_MyClass_opByteSSIPtr; - -class AMI_MyClass_opBoolSSI : public Test::AMI_MyClass_opBoolSS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::BoolSS& rso, const ::Test::BoolSS& bso) + void opBoolSS(const Test::BoolSS& rso, const Test::BoolSS& bso) { test(bso.size() == 4); test(bso[0].size() == 1); @@ -528,20 +340,10 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opBoolSSI> AMI_MyClass_opBoolSSIPtr; - -class AMI_MyClass_opShortIntLongSSI : public Test::AMI_MyClass_opShortIntLongSS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::LongSS& rso, const ::Test::ShortSS& sso, const ::Test::IntSS& iso, - const ::Test::LongSS& lso) + void opShortIntLongSS(const Test::LongSS& rso, + const Test::ShortSS& sso, + const Test::IntSS& iso, + const Test::LongSS& lso) { test(rso.size() == 1); test(rso[0].size() == 2); @@ -571,19 +373,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opShortIntLongSSI> AMI_MyClass_opShortIntLongSSIPtr; - -class AMI_MyClass_opFloatDoubleSSI : public Test::AMI_MyClass_opFloatDoubleSS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::DoubleSS& rso, const ::Test::FloatSS& fso, const ::Test::DoubleSS& dso) + void opFloatDoubleSS(const Test::DoubleSS& rso, const Test::FloatSS& fso, const Test::DoubleSS& dso) { test(fso.size() == 3); test(fso[0].size() == 1); @@ -608,19 +398,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opFloatDoubleSSI> AMI_MyClass_opFloatDoubleSSIPtr; - -class AMI_MyClass_opStringSSI : public Test::AMI_MyClass_opStringSS, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::StringSS& rso, const ::Test::StringSS& sso) + void opStringSS(const Test::StringSS& rso, const Test::StringSS& sso) { test(sso.size() == 5); test(sso[0].size() == 1); @@ -640,19 +418,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opStringSSI> AMI_MyClass_opStringSSIPtr; - -class AMI_MyClass_opByteBoolDI : public Test::AMI_MyClass_opByteBoolD, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::ByteBoolD& ro, const ::Test::ByteBoolD& _do) + void opByteBoolD(const Test::ByteBoolD& ro, const Test::ByteBoolD& _do) { Test::ByteBoolD di1; di1[10] = true; @@ -670,19 +436,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opByteBoolDI> AMI_MyClass_opByteBoolDIPtr; - -class AMI_MyClass_opShortIntDI : public Test::AMI_MyClass_opShortIntD, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::ShortIntD& ro, const ::Test::ShortIntD& _do) + void opShortIntD(const Test::ShortIntD& ro, const Test::ShortIntD& _do) { Test::ShortIntD di1; di1[110] = -1; @@ -700,19 +454,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opShortIntDI> AMI_MyClass_opShortIntDIPtr; - -class AMI_MyClass_opLongFloatDI : public Test::AMI_MyClass_opLongFloatD, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::LongFloatD& ro, const ::Test::LongFloatD& _do) + void opLongFloatD(const Test::LongFloatD& ro, const Test::LongFloatD& _do) { Test::LongFloatD di1; di1[999999110] = Ice::Float(-1.1); @@ -730,19 +472,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opLongFloatDI> AMI_MyClass_opLongFloatDIPtr; - -class AMI_MyClass_opStringStringDI : public Test::AMI_MyClass_opStringStringD, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::StringStringD& ro, const ::Test::StringStringD& _do) + void opStringStringD(const Test::StringStringD& ro, const Test::StringStringD& _do) { Test::StringStringD di1; di1["foo"] = "abc -1.1"; @@ -760,19 +490,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opStringStringDI> AMI_MyClass_opStringStringDIPtr; - -class AMI_MyClass_opStringMyEnumDI : public Test::AMI_MyClass_opStringMyEnumD, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::StringMyEnumD& ro, const ::Test::StringMyEnumD& _do) + void opStringMyEnumD(const Test::StringMyEnumD& ro, const Test::StringMyEnumD& _do) { Test::StringMyEnumD di1; di1["abc"] = Test::enum1; @@ -790,46 +508,7 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opStringMyEnumDI> AMI_MyClass_opStringMyEnumDIPtr; - -class AMI_MyClass_opMyEnumStringDI : public Test::AMI_MyClass_opMyEnumStringD, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::MyEnumStringD& ro, const ::Test::MyEnumStringD& _do) - { - Test::MyEnumStringD di1; - di1[Test::enum1] = "abc"; - test(_do == di1); - test(ro.size() == 3); - test(ro.find(Test::enum1) != ro.end()); - test(ro.find(Test::enum1)->second == "abc"); - test(ro.find(Test::enum2) != ro.end()); - test(ro.find(Test::enum2)->second == "Hello!!"); - test(ro.find(Test::enum3) != ro.end()); - test(ro.find(Test::enum3)->second == "qwerty"); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opMyEnumStringDI> AMI_MyClass_opMyEnumStringDIPtr; - -class AMI_MyClass_opMyStructMyEnumDI : public Test::AMI_MyClass_opMyStructMyEnumD, public CallbackBase -{ -public: - - virtual void ice_response(const ::Test::MyStructMyEnumD& ro, const ::Test::MyStructMyEnumD& _do) + void opMyStructMyEnumD(const Test::MyStructMyEnumD& ro, const Test::MyStructMyEnumD& _do) { Test::MyStruct s11 = { 1, 1 }; Test::MyStruct s12 = { 1, 2 }; @@ -851,161 +530,45 @@ public: called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opMyStructMyEnumDI> AMI_MyClass_opMyStructMyEnumDIPtr; - -class AMI_MyClass_opIntSI : public Test::AMI_MyClass_opIntS, public CallbackBase -{ -public: - - AMI_MyClass_opIntSI(int l) : _l(l) {} - - virtual void ice_response(const Test::IntS& r) + void opIntS(const Test::IntS& r) { - test(r.size() == static_cast<size_t>(_l)); - for(int j = 0; j < _l; ++j) + for(int j = 0; j < static_cast<int>(r.size()); ++j) { test(r[j] == -j); } called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - int _l; -}; - -typedef IceUtil::Handle<AMI_MyClass_opIntSI> AMI_MyClass_opIntSIPtr; - -class AMI_MyClass_opContextEqualI : public Test::AMI_MyClass_opContext, public CallbackBase -{ -public: - - AMI_MyClass_opContextEqualI(const Test::StringStringD &d) : _d(d) - { - } - - virtual void ice_response(const Test::StringStringD& r) - { - test(r == _d); - called(); - } - - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - Test::StringStringD _d; -}; - -typedef IceUtil::Handle<AMI_MyClass_opContextEqualI> AMI_MyClass_opContextEqualIPtr; - -class AMI_MyClass_opContextNotEqualI : public Test::AMI_MyClass_opContext, public CallbackBase -{ -public: - - AMI_MyClass_opContextNotEqualI(const Test::StringStringD &d) : _d(d) - { - } - - virtual void ice_response(const Test::StringStringD& r) + void opDoubleMarshaling() { - test(r != _d); called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } - -private: - - Test::StringStringD _d; -}; - -typedef IceUtil::Handle<AMI_MyClass_opContextNotEqualI> AMI_MyClass_opContextNotEqualIPtr; - -class AMI_MyDerivedClass_opDerivedI : public Test::AMI_MyDerivedClass_opDerived, public CallbackBase -{ -public: - - virtual void ice_response() + void opIdempotent() { called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyDerivedClass_opDerivedI> AMI_MyDerivedClass_opDerivedIPtr; - -class AMI_MyClass_opDoubleMarshalingI : public Test::AMI_MyClass_opDoubleMarshaling, public CallbackBase -{ -public: - - virtual void ice_response() + void opNonmutating() { called(); } - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } -}; - -typedef IceUtil::Handle<AMI_MyClass_opDoubleMarshalingI> AMI_MyClass_opDoubleMarshalingIPtr; - -class AMI_MyClass_opIdempotentI : public Test::AMI_MyClass_opIdempotent, public CallbackBase -{ -public: - - virtual void ice_response() + void opDerived() { called(); } - virtual void ice_exception(const ::Ice::Exception&) + void exCB(const Ice::Exception&) { test(false); } -}; - -typedef IceUtil::Handle<AMI_MyClass_opIdempotentI> AMI_MyClass_opIdempotentIPtr; - -class AMI_MyClass_opNonmutatingI : public Test::AMI_MyClass_opNonmutating, public CallbackBase -{ -public: - virtual void ice_response() - { - called(); - } +private: - virtual void ice_exception(const ::Ice::Exception&) - { - test(false); - } + Ice::CommunicatorPtr _communicator; }; - -typedef IceUtil::Handle<AMI_MyClass_opNonmutatingI> AMI_MyClass_opNonmutatingIPtr; +typedef IceUtil::Handle<Callback> CallbackPtr; } @@ -1013,114 +576,108 @@ void twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) { { - // Check that a call to a void operation raises NoEndpointException - // in the ice_exception() callback instead of at the point of call. - Test::MyClassPrx indirect = Test::MyClassPrx::uncheckedCast(p->ice_adapterId("dummy")); - AMI_MyClass_opVoidExIPtr cb = new AMI_MyClass_opVoidExI; - try - { - test(!indirect->opVoid_async(cb)); - } - catch(const Ice::Exception&) - { - test(false); - } + CallbackPtr cb = new Callback; + Ice::Callback_Object_ice_pingPtr callback = Ice::newCallback_Object_ice_ping(cb, + &Callback::ping, + &Callback::exCB); + p->begin_ice_ping(callback); cb->check(); } { - // - // Check that a call to a twoway operation raises NoEndpointException - // in the ice_exception() callback instead of at the point of call. - // - Test::MyClassPrx indirect = Test::MyClassPrx::uncheckedCast(p->ice_adapterId("dummy")); - AMI_MyClass_opByteExIPtr cb = new AMI_MyClass_opByteExI; - try - { - test(!indirect->opByte_async(cb, 0, 0)); - } - catch(const Ice::Exception&) - { - test(false); - } + CallbackPtr cb = new Callback; + Ice::Callback_Object_ice_isAPtr callback = Ice::newCallback_Object_ice_isA(cb, + &Callback::isA, + &Callback::exCB); + p->begin_ice_isA(Test::MyClass::ice_staticId(), callback); cb->check(); } { - AMI_MyClass_opVoidIPtr cb = new AMI_MyClass_opVoidI; - p->opVoid_async(cb); - cb->check(); - // Let's check if we can reuse the same callback object for another call. - p->opVoid_async(cb); + CallbackPtr cb = new Callback; + Ice::Callback_Object_ice_idPtr callback = Ice::newCallback_Object_ice_id(cb, + &Callback::id, + &Callback::exCB); + p->begin_ice_id(callback); cb->check(); } { - // - // Check that CommunicatorDestroyedException is raised directly. - // - Ice::InitializationData initData; - initData.properties = communicator->getProperties()->clone(); - Ice::CommunicatorPtr ic = Ice::initialize(initData); - Ice::ObjectPrx obj = ic->stringToProxy(p->ice_toString()); - Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(obj); - - ic->destroy(); - - AMI_MyClass_opVoidIPtr cb = new AMI_MyClass_opVoidI; - try - { - test(!p2->opVoid_async(cb)); - test(false); - } - catch(const Ice::CommunicatorDestroyedException&) - { - // Expected. - } + CallbackPtr cb = new Callback; + Ice::Callback_Object_ice_idsPtr callback = Ice::newCallback_Object_ice_ids(cb, + &Callback::ids, + &Callback::exCB); + p->begin_ice_ids(callback); + cb->check(); } { - AMI_MyClass_opByteIPtr cb = new AMI_MyClass_opByteI; - p->opByte_async(cb, Ice::Byte(0xff), Ice::Byte(0x0f)); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opVoidPtr callback = Test::newCallback_MyClass_opVoid(cb, + &Callback::opVoid, + &Callback::exCB); + p->begin_opVoid(callback); cb->check(); } { - AMI_MyClass_opBoolIPtr cb = new AMI_MyClass_opBoolI; - p->opBool_async(cb, true, false); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opBytePtr callback = Test::newCallback_MyClass_opByte(cb, + &Callback::opByte, + &Callback::exCB); + p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f), callback); cb->check(); } { - AMI_MyClass_opShortIntLongIPtr cb = new AMI_MyClass_opShortIntLongI; - p->opShortIntLong_async(cb, 10, 11, 12); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opBoolPtr callback = Test::newCallback_MyClass_opBool(cb, + &Callback::opBool, + &Callback::exCB); + p->begin_opBool(true, false, callback); cb->check(); } { - AMI_MyClass_opFloatDoubleIPtr cb = new AMI_MyClass_opFloatDoubleI; - p->opFloatDouble_async(cb, Ice::Float(3.14), Ice::Double(1.1E10)); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opShortIntLongPtr callback = + Test::newCallback_MyClass_opShortIntLong(cb, &Callback::opShortIntLong, &Callback::exCB); + p->begin_opShortIntLong(10, 11, 12, callback); cb->check(); - // Let's check if we can reuse the same callback object for another call. - p->opFloatDouble_async(cb, Ice::Float(3.14), Ice::Double(1.1E10)); + } + + { + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opFloatDoublePtr callback = + Test::newCallback_MyClass_opFloatDouble(cb, &Callback::opFloatDouble, &Callback::exCB); + p->begin_opFloatDouble(Ice::Float(3.14), Ice::Double(1.1E10), callback); cb->check(); } { - AMI_MyClass_opStringIPtr cb = new AMI_MyClass_opStringI; - p->opString_async(cb, "hello", "world"); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opStringPtr callback = Test::newCallback_MyClass_opString(cb, + &Callback::opString, + &Callback::exCB); + p->begin_opString("hello", "world", callback); cb->check(); } { - AMI_MyClass_opMyEnumIPtr cb = new AMI_MyClass_opMyEnumI; - p->opMyEnum_async(cb, Test::enum2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opMyEnumPtr callback = Test::newCallback_MyClass_opMyEnum(cb, + &Callback::opMyEnum, + &Callback::exCB); + p->begin_opMyEnum(Test::enum2, callback); cb->check(); } { - AMI_MyClass_opMyClassIPtr cb = new AMI_MyClass_opMyClassI(communicator); - p->opMyClass_async(cb, p); + CallbackPtr cb = new Callback(communicator); + Test::Callback_MyClass_opMyClassPtr callback = Test::newCallback_MyClass_opMyClass(cb, + &Callback::opMyClass, + &Callback::exCB); + p->begin_opMyClass(p, callback); cb->check(); } @@ -1134,8 +691,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) si2.e = Test::enum2; si2.s.s = "def"; - AMI_MyClass_opStructIPtr cb = new AMI_MyClass_opStructI(communicator); - p->opStruct_async(cb, si1, si2); + CallbackPtr cb = new Callback(communicator); + Test::Callback_MyClass_opStructPtr callback = Test::newCallback_MyClass_opStruct(cb, + &Callback::opStruct, + &Callback::exCB); + p->begin_opStruct(si1, si2, callback); cb->check(); } @@ -1153,8 +713,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) bsi2.push_back(Ice::Byte(0xf3)); bsi2.push_back(Ice::Byte(0xf4)); - AMI_MyClass_opByteSIPtr cb = new AMI_MyClass_opByteSI; - p->opByteS_async(cb, bsi1, bsi2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opByteSPtr callback = Test::newCallback_MyClass_opByteS(cb, + &Callback::opByteS, + &Callback::exCB); + p->begin_opByteS(bsi1, bsi2, callback); cb->check(); } @@ -1168,8 +731,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) bsi2.push_back(false); - AMI_MyClass_opBoolSIPtr cb = new AMI_MyClass_opBoolSI; - p->opBoolS_async(cb, bsi1, bsi2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opBoolSPtr callback = Test::newCallback_MyClass_opBoolS(cb, + &Callback::opBoolS, + &Callback::exCB); + p->begin_opBoolS(bsi1, bsi2, callback); cb->check(); } @@ -1191,8 +757,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) lsi.push_back(30); lsi.push_back(20); - AMI_MyClass_opShortIntLongSIPtr cb = new AMI_MyClass_opShortIntLongSI; - p->opShortIntLongS_async(cb, ssi, isi, lsi); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opShortIntLongSPtr callback = + Test::newCallback_MyClass_opShortIntLongS(cb, &Callback::opShortIntLongS, &Callback::exCB); + p->begin_opShortIntLongS(ssi, isi, lsi, callback); cb->check(); } @@ -1207,8 +775,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) dsi.push_back(Ice::Double(1.2E10)); dsi.push_back(Ice::Double(1.3E10)); - AMI_MyClass_opFloatDoubleSIPtr cb = new AMI_MyClass_opFloatDoubleSI; - p->opFloatDoubleS_async(cb, fsi, dsi); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opFloatDoubleSPtr callback = + Test::newCallback_MyClass_opFloatDoubleS(cb, &Callback::opFloatDoubleS, &Callback::exCB); + p->begin_opFloatDoubleS(fsi, dsi, callback); cb->check(); } @@ -1222,8 +792,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) ssi2.push_back("xyz"); - AMI_MyClass_opStringSIPtr cb = new AMI_MyClass_opStringSI; - p->opStringS_async(cb, ssi1, ssi2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opStringSPtr callback = Test::newCallback_MyClass_opStringS(cb, + &Callback::opStringS, + &Callback::exCB); + p->begin_opStringS(ssi1, ssi2, callback); cb->check(); } @@ -1242,8 +815,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) bsi2[1].push_back(Ice::Byte(0xf2)); bsi2[1].push_back(Ice::Byte(0xf1)); - AMI_MyClass_opByteSSIPtr cb = new AMI_MyClass_opByteSSI; - p->opByteSS_async(cb, bsi1, bsi2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opByteSSPtr callback = Test::newCallback_MyClass_opByteSS(cb, + &Callback::opByteSS, + &Callback::exCB); + p->begin_opByteSS(bsi1, bsi2, callback); cb->check(); } @@ -1261,8 +837,12 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) bsi2[0].push_back(false); bsi2[0].push_back(false); bsi2[0].push_back(true); - AMI_MyClass_opBoolSSIPtr cb = new AMI_MyClass_opBoolSSI; - p->opBoolSS_async(cb, bsi1, bsi2); + + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opBoolSSPtr callback = Test::newCallback_MyClass_opBoolSS(cb, + &Callback::opBoolSS, + &Callback::exCB); + p->begin_opBoolSS(bsi1, bsi2, callback); cb->check(); } @@ -1283,12 +863,14 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) lsi[0].push_back(496); lsi[0].push_back(1729); - AMI_MyClass_opShortIntLongSSIPtr cb = new AMI_MyClass_opShortIntLongSSI; - p->opShortIntLongSS_async(cb, ssi, isi, lsi); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opShortIntLongSSPtr callback = Test::newCallback_MyClass_opShortIntLongSS(cb, + &Callback::opShortIntLongSS, + &Callback::exCB); + p->begin_opShortIntLongSS(ssi, isi, lsi, callback); cb->check(); } - { Test::FloatSS fsi; fsi.resize(3); @@ -1302,8 +884,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) dsi[0].push_back(Ice::Double(1.2E10)); dsi[0].push_back(Ice::Double(1.3E10)); - AMI_MyClass_opFloatDoubleSSIPtr cb = new AMI_MyClass_opFloatDoubleSSI; - p->opFloatDoubleSS_async(cb, fsi, dsi); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opFloatDoubleSSPtr callback = + Test::newCallback_MyClass_opFloatDoubleSS(cb, &Callback::opFloatDoubleSS, &Callback::exCB); + p->begin_opFloatDoubleSS(fsi, dsi, callback); cb->check(); } @@ -1319,8 +903,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) ssi2[2].push_back("xyz"); - AMI_MyClass_opStringSSIPtr cb = new AMI_MyClass_opStringSSI; - p->opStringSS_async(cb, ssi1, ssi2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opStringSSPtr callback = + Test::newCallback_MyClass_opStringSS(cb, &Callback::opStringSS, &Callback::exCB); + p->begin_opStringSS(ssi1, ssi2, callback); cb->check(); } @@ -1333,8 +919,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) di2[11] = false; di2[101] = true; - AMI_MyClass_opByteBoolDIPtr cb = new AMI_MyClass_opByteBoolDI; - p->opByteBoolD_async(cb, di1, di2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opByteBoolDPtr callback = + Test::newCallback_MyClass_opByteBoolD(cb, &Callback::opByteBoolD, &Callback::exCB); + p->begin_opByteBoolD(di1, di2, callback); cb->check(); } @@ -1347,8 +935,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) di2[111] = -100; di2[1101] = 0; - AMI_MyClass_opShortIntDIPtr cb = new AMI_MyClass_opShortIntDI; - p->opShortIntD_async(cb, di1, di2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opShortIntDPtr callback = + Test::newCallback_MyClass_opShortIntD(cb, &Callback::opShortIntD, &Callback::exCB); + p->begin_opShortIntD(di1, di2, callback); cb->check(); } @@ -1361,8 +951,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) di2[999999120] = Ice::Float(-100.4); di2[999999130] = Ice::Float(0.5); - AMI_MyClass_opLongFloatDIPtr cb = new AMI_MyClass_opLongFloatDI; - p->opLongFloatD_async(cb, di1, di2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opLongFloatDPtr callback = + Test::newCallback_MyClass_opLongFloatD(cb, &Callback::opLongFloatD, &Callback::exCB); + p->begin_opLongFloatD(di1, di2, callback); cb->check(); } @@ -1375,8 +967,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) di2["FOO"] = "abc -100.4"; di2["BAR"] = "abc 0.5"; - AMI_MyClass_opStringStringDIPtr cb = new AMI_MyClass_opStringStringDI; - p->opStringStringD_async(cb, di1, di2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opStringStringDPtr callback = + Test::newCallback_MyClass_opStringStringD(cb, &Callback::opStringStringD, &Callback::exCB); + p->begin_opStringStringD(di1, di2, callback); cb->check(); } @@ -1389,20 +983,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) di2["qwerty"] = Test::enum3; di2["Hello!!"] = Test::enum2; - AMI_MyClass_opStringMyEnumDIPtr cb = new AMI_MyClass_opStringMyEnumDI; - p->opStringMyEnumD_async(cb, di1, di2); - cb->check(); - } - - { - Test::MyEnumStringD di1; - di1[Test::enum1] = "abc"; - Test::MyEnumStringD di2; - di2[Test::enum2] = "Hello!!"; - di2[Test::enum3] = "qwerty"; - - AMI_MyClass_opMyEnumStringDIPtr cb = new AMI_MyClass_opMyEnumStringDI; - p->opMyEnumStringD_async(cb, di1, di2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opStringMyEnumDPtr callback = + Test::newCallback_MyClass_opStringMyEnumD(cb, &Callback::opStringMyEnumD, &Callback::exCB); + p->begin_opStringMyEnumD(di1, di2, callback); cb->check(); } @@ -1420,8 +1004,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) di2[s22] = Test::enum3; di2[s23] = Test::enum2; - AMI_MyClass_opMyStructMyEnumDIPtr cb = new AMI_MyClass_opMyStructMyEnumDI; - p->opMyStructMyEnumD_async(cb, di1, di2); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opMyStructMyEnumDPtr callback = + Test::newCallback_MyClass_opMyStructMyEnumD(cb, &Callback::opMyStructMyEnumD, &Callback::exCB); + p->begin_opMyStructMyEnumD(di1, di2, callback); cb->check(); } @@ -1435,8 +1021,10 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) { s.push_back(i); } - AMI_MyClass_opIntSIPtr cb = new AMI_MyClass_opIntSI(lengths[l]); - p->opIntS_async(cb, s); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opIntSPtr callback = + Test::newCallback_MyClass_opIntS(cb, &Callback::opIntS, &Callback::exCB); + p->begin_opIntS(s, callback); cb->check(); } } @@ -1448,28 +1036,28 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) ctx["three"] = "THREE"; { test(p->ice_getContext().empty()); - AMI_MyClass_opContextNotEqualIPtr cb = new AMI_MyClass_opContextNotEqualI(ctx); - p->opContext_async(cb); - cb->check(); + Ice::AsyncResultPtr r = p->begin_opContext(); + Ice::Context c = p->end_opContext(r); + test(c != ctx); } { test(p->ice_getContext().empty()); - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p->opContext_async(cb, ctx); - cb->check(); + Ice::AsyncResultPtr r = p->begin_opContext(ctx); + Ice::Context c = p->end_opContext(r); + test(c == ctx); } Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); test(p2->ice_getContext() == ctx); { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p2->opContext_async(cb); - cb->check(); + Ice::AsyncResultPtr r = p2->begin_opContext(); + Ice::Context c = p2->end_opContext(r); + test(c == ctx); } { Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p2->opContext_async(cb, ctx); - cb->check(); + Ice::AsyncResultPtr r = p2->begin_opContext(ctx); + Ice::Context c = p2->end_opContext(r); + test(c == ctx); } #ifndef ICE_OS_WINRT @@ -1494,24 +1082,24 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast( - ic->stringToProxy("test:default -p 12010")); + ic->stringToProxy("test:default -p 12010")); ic->getImplicitContext()->setContext(ctx); test(ic->getImplicitContext()->getContext() == ctx); { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p->opContext_async(cb); - cb->check(); + Ice::AsyncResultPtr r = p->begin_opContext(); + Ice::Context c = p->end_opContext(r); + test(c == ctx); } ic->getImplicitContext()->put("zero", "ZERO"); ctx = ic->getImplicitContext()->getContext(); { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); - p->opContext_async(cb); - cb->check(); + Ice::AsyncResultPtr r = p->begin_opContext(); + Ice::Context c = p->end_opContext(r); + test(c == ctx); } Ice::Context prxContext; @@ -1526,16 +1114,16 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) ic->getImplicitContext()->setContext(Ice::Context()); { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(prxContext); - p->opContext_async(cb); - cb->check(); + Ice::AsyncResultPtr r = p->begin_opContext(); + Ice::Context c = p->end_opContext(r); + test(c == prxContext); } ic->getImplicitContext()->setContext(ctx); { - AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(combined); - p->opContext_async(cb); - cb->check(); + Ice::AsyncResultPtr r = p->begin_opContext(); + Ice::Context c = p->end_opContext(r); + test(c == combined); } ic->getImplicitContext()->setContext(Ice::Context()); @@ -1548,28 +1136,530 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) { Ice::Double d = 1278312346.0 / 13.0; Test::DoubleS ds(5, d); - AMI_MyClass_opDoubleMarshalingIPtr cb = new AMI_MyClass_opDoubleMarshalingI; - p->opDoubleMarshaling_async(cb, d, ds); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opDoubleMarshalingPtr callback = + Test::newCallback_MyClass_opDoubleMarshaling(cb, &Callback::opDoubleMarshaling, &Callback::exCB); + p->begin_opDoubleMarshaling(d, ds, callback); cb->check(); } { - AMI_MyClass_opIdempotentIPtr cb = new AMI_MyClass_opIdempotentI; - p->opIdempotent_async(cb); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opIdempotentPtr callback = + Test::newCallback_MyClass_opIdempotent(cb, &Callback::opIdempotent, &Callback::exCB); + p->begin_opIdempotent(callback); cb->check(); } { - AMI_MyClass_opNonmutatingIPtr cb = new AMI_MyClass_opNonmutatingI; - p->opNonmutating_async(cb); + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opNonmutatingPtr callback = + Test::newCallback_MyClass_opNonmutating(cb, &Callback::opNonmutating, &Callback::exCB); + p->begin_opNonmutating(callback); cb->check(); } { Test::MyDerivedClassPrx derived = Test::MyDerivedClassPrx::checkedCast(p); test(derived); - AMI_MyDerivedClass_opDerivedIPtr cb = new AMI_MyDerivedClass_opDerivedI; - derived->opDerived_async(cb); + CallbackPtr cb = new Callback; + Test::Callback_MyDerivedClass_opDerivedPtr callback = + Test::newCallback_MyDerivedClass_opDerived(cb, &Callback::opDerived, &Callback::exCB); + derived->begin_opDerived(callback); + cb->check(); + } +#ifdef ICE_CPP11 + + { + CallbackPtr cb = new Callback; + p->begin_ice_ping([=](){ cb->ping(); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_ice_isA(Test::MyClass::ice_staticId(), [=](bool isA){ cb->isA(isA); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_ice_id([=](const string& id){ cb->id(id); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_ice_ids([=](const Ice::StringSeq& ids){ cb->ids(ids); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); cb->check(); } + + { + CallbackPtr cb = new Callback; + p->begin_opVoid([=](){ cb->opVoid(); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f), + [=](const Ice::Byte& p1, const Ice::Byte& p2){ cb->opByte(p1, p2); }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opBoolPtr callback = Test::newCallback_MyClass_opBool(cb, + &Callback::opBool, + &Callback::exCB); + p->begin_opBool(true, false, [=](bool p1, bool p2){ cb->opBool(p1, p2); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_opShortIntLong(10, 11, 12, + [=](Ice::Long p1, Ice::Short p2, Ice::Int p3, Ice::Long p4){ cb->opShortIntLong(p1, p2, p3, p4); }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_opFloatDouble(Ice::Float(3.14), Ice::Double(1.1E10), + [=](Ice::Double p1, Ice::Float p2, Ice::Double p3){ cb->opFloatDouble(p1, p2, p3); }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_opString("hello", "world", + [=](const string& p1, const string& p2){ cb->opString(p1, p2); }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_opMyEnum(Test::enum2, + [=](Test::MyEnum p1, Test::MyEnum p2){ cb->opMyEnum(p1, p2); }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback(communicator); + p->begin_opMyClass(p, + [=](const Test::MyClassPrx& p1, const Test::MyClassPrx p2, const Test::MyClassPrx p3) + { + cb->opMyClass(p1, p2, p3); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::Structure si1; + si1.p = p; + si1.e = Test::enum3; + si1.s.s = "abc"; + Test::Structure si2; + si2.p = 0; + si2.e = Test::enum2; + si2.s.s = "def"; + + CallbackPtr cb = new Callback(communicator); + p->begin_opStruct(si1, si2, + [=](const Test::Structure& p1, const Test::Structure& p2) + { + cb->opStruct(p1, p2); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::ByteS bsi1; + Test::ByteS bsi2; + + bsi1.push_back(Ice::Byte(0x01)); + bsi1.push_back(Ice::Byte(0x11)); + bsi1.push_back(Ice::Byte(0x12)); + bsi1.push_back(Ice::Byte(0x22)); + + bsi2.push_back(Ice::Byte(0xf1)); + bsi2.push_back(Ice::Byte(0xf2)); + bsi2.push_back(Ice::Byte(0xf3)); + bsi2.push_back(Ice::Byte(0xf4)); + + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opByteSPtr callback = Test::newCallback_MyClass_opByteS(cb, + &Callback::opByteS, + &Callback::exCB); + p->begin_opByteS(bsi1, bsi2, + [=](const Test::ByteS& p1, const Test::ByteS& p2) + { + cb->opByteS(p1, p2); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::BoolS bsi1; + Test::BoolS bsi2; + + bsi1.push_back(true); + bsi1.push_back(true); + bsi1.push_back(false); + + bsi2.push_back(false); + + CallbackPtr cb = new Callback; + p->begin_opBoolS(bsi1, bsi2, + [=](const Test::BoolS& p1, const Test::BoolS& p2) + { + cb->opBoolS(p1, p2); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::ShortS ssi; + Test::IntS isi; + Test::LongS lsi; + + ssi.push_back(1); + ssi.push_back(2); + ssi.push_back(3); + + isi.push_back(5); + isi.push_back(6); + isi.push_back(7); + isi.push_back(8); + + lsi.push_back(10); + lsi.push_back(30); + lsi.push_back(20); + + CallbackPtr cb = new Callback; + p->begin_opShortIntLongS(ssi, isi, lsi, + [=](const Test::LongS& p1, const Test::ShortS& p2, const Test::IntS& p3, const Test::LongS& p4) + { + cb->opShortIntLongS(p1, p2, p3, p4); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::FloatS fsi; + Test::DoubleS dsi; + + fsi.push_back(Ice::Float(3.14)); + fsi.push_back(Ice::Float(1.11)); + + dsi.push_back(Ice::Double(1.1E10)); + dsi.push_back(Ice::Double(1.2E10)); + dsi.push_back(Ice::Double(1.3E10)); + + CallbackPtr cb = new Callback; + p->begin_opFloatDoubleS(fsi, dsi, + [=](const Test::DoubleS& p1, const Test::FloatS& p2, const Test::DoubleS& p3) + { + cb->opFloatDoubleS(p1, p2, p3); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::StringS ssi1; + Test::StringS ssi2; + + ssi1.push_back("abc"); + ssi1.push_back("de"); + ssi1.push_back("fghi"); + + ssi2.push_back("xyz"); + + CallbackPtr cb = new Callback; + p->begin_opStringS(ssi1, ssi2, + [=](const Test::StringS& p1, const Test::StringS& p2) + { + cb->opStringS(p1, p2); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::ByteSS bsi1; + bsi1.resize(2); + Test::ByteSS bsi2; + bsi2.resize(2); + + bsi1[0].push_back(Ice::Byte(0x01)); + bsi1[0].push_back(Ice::Byte(0x11)); + bsi1[0].push_back(Ice::Byte(0x12)); + bsi1[1].push_back(Ice::Byte(0xff)); + + bsi2[0].push_back(Ice::Byte(0x0e)); + bsi2[1].push_back(Ice::Byte(0xf2)); + bsi2[1].push_back(Ice::Byte(0xf1)); + + CallbackPtr cb = new Callback; + p->begin_opByteSS(bsi1, bsi2, + [=](const Test::ByteSS& p1, const Test::ByteSS& p2) + { + cb->opByteSS(p1, p2); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::FloatSS fsi; + fsi.resize(3); + Test::DoubleSS dsi; + dsi.resize(1); + + fsi[0].push_back(Ice::Float(3.14)); + fsi[1].push_back(Ice::Float(1.11)); + + dsi[0].push_back(Ice::Double(1.1E10)); + dsi[0].push_back(Ice::Double(1.2E10)); + dsi[0].push_back(Ice::Double(1.3E10)); + + CallbackPtr cb = new Callback; + p->begin_opFloatDoubleSS(fsi, dsi, + [=](const Test::DoubleSS& p1, const Test::FloatSS& p2, const Test::DoubleSS& p3) + { + cb->opFloatDoubleSS(p1, p2, p3); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::StringSS ssi1; + ssi1.resize(2); + Test::StringSS ssi2; + ssi2.resize(3); + + ssi1[0].push_back("abc"); + ssi1[1].push_back("de"); + ssi1[1].push_back("fghi"); + + ssi2[2].push_back("xyz"); + + CallbackPtr cb = new Callback; + p->begin_opStringSS(ssi1, ssi2, + [=](const Test::StringSS& p1, const Test::StringSS& p2) + { + cb->opStringSS(p1, p2); + }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::ByteBoolD di1; + di1[10] = true; + di1[100] = false; + Test::ByteBoolD di2; + di2[10] = true; + di2[11] = false; + di2[101] = true; + + CallbackPtr cb = new Callback; + p->begin_opByteBoolD(di1, di2, + [=](const Test::ByteBoolD& p1, const Test::ByteBoolD& p2) + { + cb->opByteBoolD(p1, p2); + }, + [=](const Ice::Exception& ex) + { + cb->exCB(ex); + }); + cb->check(); + } + + { + Test::ShortIntD di1; + di1[110] = -1; + di1[1100] = 123123; + Test::ShortIntD di2; + di2[110] = -1; + di2[111] = -100; + di2[1101] = 0; + + CallbackPtr cb = new Callback; + p->begin_opShortIntD(di1, di2, + [=](const Test::ShortIntD& p1, const Test::ShortIntD& p2) + { + cb->opShortIntD(p1, p2); + }, + [=](const Ice::Exception& ex) + { + cb->exCB(ex); + }); + cb->check(); + } + + { + Test::LongFloatD di1; + di1[999999110] = Ice::Float(-1.1); + di1[999999111] = Ice::Float(123123.2); + Test::LongFloatD di2; + di2[999999110] = Ice::Float(-1.1); + di2[999999120] = Ice::Float(-100.4); + di2[999999130] = Ice::Float(0.5); + + CallbackPtr cb = new Callback; + p->begin_opLongFloatD(di1, di2, + [=](const Test::LongFloatD& p1, const Test::LongFloatD& p2) + { + cb->opLongFloatD(p1, p2); + }, + [=](const Ice::Exception& ex) + { + cb->exCB(ex); + }); + cb->check(); + } + + { + Test::StringStringD di1; + di1["foo"] = "abc -1.1"; + di1["bar"] = "abc 123123.2"; + Test::StringStringD di2; + di2["foo"] = "abc -1.1"; + di2["FOO"] = "abc -100.4"; + di2["BAR"] = "abc 0.5"; + + CallbackPtr cb = new Callback; + p->begin_opStringStringD(di1, di2, + [=](const Test::StringStringD& p1, const Test::StringStringD& p2) + { + cb->opStringStringD(p1, p2); + }, + [=](const Ice::Exception& ex) + { + cb->exCB(ex); + }); + cb->check(); + } + + { + Test::StringMyEnumD di1; + di1["abc"] = Test::enum1; + di1[""] = Test::enum2; + Test::StringMyEnumD di2; + di2["abc"] = Test::enum1; + di2["qwerty"] = Test::enum3; + di2["Hello!!"] = Test::enum2; + + CallbackPtr cb = new Callback; + p->begin_opStringMyEnumD(di1, di2, + [=](const Test::StringMyEnumD& p1, const Test::StringMyEnumD& p2) + { + cb->opStringMyEnumD(p1, p2); + }, + [=](const Ice::Exception& ex) + { + cb->exCB(ex); + }); + cb->check(); + } + + { + Test::MyStruct s11 = { 1, 1 }; + Test::MyStruct s12 = { 1, 2 }; + Test::MyStructMyEnumD di1; + di1[s11] = Test::enum1; + di1[s12] = Test::enum2; + + Test::MyStruct s22 = { 2, 2 }; + Test::MyStruct s23 = { 2, 3 }; + Test::MyStructMyEnumD di2; + di2[s11] = Test::enum1; + di2[s22] = Test::enum3; + di2[s23] = Test::enum2; + + CallbackPtr cb = new Callback; + p->begin_opMyStructMyEnumD(di1, di2, + [=](const Test::MyStructMyEnumD& p1, const Test::MyStructMyEnumD& p2) + { + cb->opMyStructMyEnumD(p1, p2); + }, + [=](const Ice::Exception& ex) + { + cb->exCB(ex); + }); + cb->check(); + } + + { + const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 }; + + for(unsigned int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l) + { + Test::IntS s; + for(int i = 0; i < lengths[l]; ++i) + { + s.push_back(i); + } + CallbackPtr cb = new Callback; + p->begin_opIntS(s, + [=](const Test::IntS& p1) + { + cb->opIntS(p1); + }, + [=](const Ice::Exception& ex) + { + cb->exCB(ex); + }); + cb->check(); + } + } + + { + Ice::Double d = 1278312346.0 / 13.0; + Test::DoubleS ds(5, d); + CallbackPtr cb = new Callback; + p->begin_opDoubleMarshaling(d, ds, + [=](){ cb->opDoubleMarshaling(); }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + Test::Callback_MyClass_opIdempotentPtr callback = + Test::newCallback_MyClass_opIdempotent(cb, &Callback::opIdempotent, &Callback::exCB); + p->begin_opIdempotent([=](){ cb->opIdempotent(); }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + CallbackPtr cb = new Callback; + p->begin_opNonmutating([=](){ cb->opNonmutating(); }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } + + { + Test::MyDerivedClassPrx derived = Test::MyDerivedClassPrx::checkedCast(p); + test(derived); + CallbackPtr cb = new Callback; + derived->begin_opDerived([=](){ cb->opDerived(); }, + [=](const Ice::Exception& ex){ cb->exCB(ex); }); + cb->check(); + } +#endif } diff --git a/cpp/test/Ice/operations/TwowaysNewAMI.cpp b/cpp/test/Ice/operations/TwowaysNewAMI.cpp deleted file mode 100644 index c3b8c29f14f..00000000000 --- a/cpp/test/Ice/operations/TwowaysNewAMI.cpp +++ /dev/null @@ -1,1665 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Ice/Ice.h> -#include <TestCommon.h> -#include <Test.h> - -// -// Work-around for GCC warning bug -// -#if defined(__GNUC__) -# pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -using namespace std; - -namespace -{ - -class CallbackBase : public Ice::LocalObject -{ -public: - - CallbackBase() : - _called(false) - { - } - - virtual ~CallbackBase() - { - } - - void check() - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_m); - while(!_called) - { - _m.wait(); - } - _called = false; - } - -protected: - - void called() - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_m); - assert(!_called); - _called = true; - _m.notify(); - } - -private: - - IceUtil::Monitor<IceUtil::Mutex> _m; - bool _called; -}; - -typedef IceUtil::Handle<CallbackBase> CallbackBasePtr; - -class Callback : public CallbackBase -{ -public: - - Callback() - { - } - - Callback(const Ice::CommunicatorPtr& communicator) - : _communicator(communicator) - { - } - - void ping() - { - called(); - } - - void isA(bool result) - { - test(result); - called(); - } - - void id(const string& id) - { - test(id == Test::MyDerivedClass::ice_staticId()); - called(); - } - - void ids(const Ice::StringSeq& ids) - { - test(ids.size() == 3); - test(ids[0] == "::Ice::Object"); - test(ids[1] == "::Test::MyClass"); - test(ids[2] == "::Test::MyDerivedClass"); - called(); - } - - void opVoid() - { - called(); - } - - void opContext(const Ice::Context&) - { - called(); - } - - void opByte(Ice::Byte r, Ice::Byte b) - { - test(b == Ice::Byte(0xf0)); - test(r == Ice::Byte(0xff)); - called(); - } - - void opBool(bool r, bool b) - { - test(b); - test(!r); - called(); - } - - void opShortIntLong(Ice::Long r, Ice::Short s, Ice::Int i, Ice::Long l) - { - test(s == 10); - test(i == 11); - test(l == 12); - test(r == 12); - called(); - } - - void opFloatDouble(Ice::Double r, Ice::Float f, Ice::Double d) - { - test(f == Ice::Float(3.14)); - test(d == Ice::Double(1.1E10)); - test(r == Ice::Double(1.1E10)); - called(); - } - - void opString(const ::std::string& r, const ::std::string& s) - { - test(s == "world hello"); - test(r == "hello world"); - called(); - } - - void opMyEnum(Test::MyEnum r, Test::MyEnum e) - { - test(e == Test::enum2); - test(r == Test::enum3); - called(); - } - - void opMyClass(const Test::MyClassPrx& r, const Test::MyClassPrx& c1, const Test::MyClassPrx& c2) - { - test(c1->ice_getIdentity() == _communicator->stringToIdentity("test")); - test(c2->ice_getIdentity() == _communicator->stringToIdentity("noSuchIdentity")); - test(r->ice_getIdentity() == _communicator->stringToIdentity("test")); - - // - // We can't do the callbacks below in connection serialization mode. - // - if(_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPool.Client.Serialize")) - { - r->opVoid(); - c1->opVoid(); - try - { - c2->opVoid(); - test(false); - } - catch(const Ice::ObjectNotExistException&) - { - } - } - called(); - } - - void opStruct(const Test::Structure& rso, const Test::Structure& so) - { - test(rso.p == 0); - test(rso.e == Test::enum2); - test(rso.s.s == "def"); - test(so.e == Test::enum3); - test(so.s.s == "a new string"); - - // - // We can't do the callbacks below in connection serialization mode. - // - if(_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPool.Client.Serialize")) - { - so.p->opVoid(); - } - called(); - } - - void opByteS(const Test::ByteS& rso, const Test::ByteS& bso) - { - test(bso.size() == 4); - test(bso[0] == Ice::Byte(0x22)); - test(bso[1] == Ice::Byte(0x12)); - test(bso[2] == Ice::Byte(0x11)); - test(bso[3] == Ice::Byte(0x01)); - test(rso.size() == 8); - test(rso[0] == Ice::Byte(0x01)); - test(rso[1] == Ice::Byte(0x11)); - test(rso[2] == Ice::Byte(0x12)); - test(rso[3] == Ice::Byte(0x22)); - test(rso[4] == Ice::Byte(0xf1)); - test(rso[5] == Ice::Byte(0xf2)); - test(rso[6] == Ice::Byte(0xf3)); - test(rso[7] == Ice::Byte(0xf4)); - called(); - } - - void opBoolS(const Test::BoolS& rso, const Test::BoolS& bso) - { - test(bso.size() == 4); - test(bso[0]); - test(bso[1]); - test(!bso[2]); - test(!bso[3]); - test(rso.size() == 3); - test(!rso[0]); - test(rso[1]); - test(rso[2]); - called(); - } - - void opShortIntLongS(const Test::LongS& rso, const Test::ShortS& sso, const Test::IntS& iso, const Test::LongS& lso) - { - test(sso.size() == 3); - test(sso[0] == 1); - test(sso[1] == 2); - test(sso[2] == 3); - test(iso.size() == 4); - test(iso[0] == 8); - test(iso[1] == 7); - test(iso[2] == 6); - test(iso[3] == 5); - test(lso.size() == 6); - test(lso[0] == 10); - test(lso[1] == 30); - test(lso[2] == 20); - test(lso[3] == 10); - test(lso[4] == 30); - test(lso[5] == 20); - test(rso.size() == 3); - test(rso[0] == 10); - test(rso[1] == 30); - test(rso[2] == 20); - called(); - } - - void opFloatDoubleS(const Test::DoubleS& rso, const Test::FloatS& fso, const Test::DoubleS& dso) - { - test(fso.size() == 2); - test(fso[0] == ::Ice::Float(3.14)); - test(fso[1] == ::Ice::Float(1.11)); - test(dso.size() == 3); - test(dso[0] == ::Ice::Double(1.3E10)); - test(dso[1] == ::Ice::Double(1.2E10)); - test(dso[2] == ::Ice::Double(1.1E10)); - test(rso.size() == 5); - test(rso[0] == ::Ice::Double(1.1E10)); - test(rso[1] == ::Ice::Double(1.2E10)); - test(rso[2] == ::Ice::Double(1.3E10)); - test(::Ice::Float(rso[3]) == ::Ice::Float(3.14)); - test(::Ice::Float(rso[4]) == ::Ice::Float(1.11)); - called(); - } - - void opStringS(const Test::StringS& rso, const Test::StringS& sso) - { - test(sso.size() == 4); - test(sso[0] == "abc"); - test(sso[1] == "de"); - test(sso[2] == "fghi"); - test(sso[3] == "xyz"); - test(rso.size() == 3); - test(rso[0] == "fghi"); - test(rso[1] == "de"); - test(rso[2] == "abc"); - called(); - } - - void opByteSS(const Test::ByteSS& rso, const Test::ByteSS& bso) - { - test(bso.size() == 2); - test(bso[0].size() == 1); - test(bso[0][0] == Ice::Byte(0xff)); - test(bso[1].size() == 3); - test(bso[1][0] == Ice::Byte(0x01)); - test(bso[1][1] == Ice::Byte(0x11)); - test(bso[1][2] == Ice::Byte(0x12)); - test(rso.size() == 4); - test(rso[0].size() == 3); - test(rso[0][0] == Ice::Byte(0x01)); - test(rso[0][1] == Ice::Byte(0x11)); - test(rso[0][2] == Ice::Byte(0x12)); - test(rso[1].size() == 1); - test(rso[1][0] == Ice::Byte(0xff)); - test(rso[2].size() == 1); - test(rso[2][0] == Ice::Byte(0x0e)); - test(rso[3].size() == 2); - test(rso[3][0] == Ice::Byte(0xf2)); - test(rso[3][1] == Ice::Byte(0xf1)); - called(); - } - - void opBoolSS(const Test::BoolSS& rso, const Test::BoolSS& bso) - { - test(bso.size() == 4); - test(bso[0].size() == 1); - test(bso[0][0]); - test(bso[1].size() == 1); - test(!bso[1][0]); - test(bso[2].size() == 2); - test(bso[2][0]); - test(bso[2][1]); - test(bso[3].size() == 3); - test(!bso[3][0]); - test(!bso[3][1]); - test(bso[3][2]); - test(rso.size() == 3); - test(rso[0].size() == 2); - test(rso[0][0]); - test(rso[0][1]); - test(rso[1].size() == 1); - test(!rso[1][0]); - test(rso[2].size() == 1); - test(rso[2][0]); - called(); - } - - void opShortIntLongSS(const Test::LongSS& rso, - const Test::ShortSS& sso, - const Test::IntSS& iso, - const Test::LongSS& lso) - { - test(rso.size() == 1); - test(rso[0].size() == 2); - test(rso[0][0] == 496); - test(rso[0][1] == 1729); - test(sso.size() == 3); - test(sso[0].size() == 3); - test(sso[0][0] == 1); - test(sso[0][1] == 2); - test(sso[0][2] == 5); - test(sso[1].size() == 1); - test(sso[1][0] == 13); - test(sso[2].size() == 0); - test(iso.size() == 2); - test(iso[0].size() == 1); - test(iso[0][0] == 42); - test(iso[1].size() == 2); - test(iso[1][0] == 24); - test(iso[1][1] == 98); - test(lso.size() == 2); - test(lso[0].size() == 2); - test(lso[0][0] == 496); - test(lso[0][1] == 1729); - test(lso[1].size() == 2); - test(lso[1][0] == 496); - test(lso[1][1] == 1729); - called(); - } - - void opFloatDoubleSS(const Test::DoubleSS& rso, const Test::FloatSS& fso, const Test::DoubleSS& dso) - { - test(fso.size() == 3); - test(fso[0].size() == 1); - test(fso[0][0] == ::Ice::Float(3.14)); - test(fso[1].size() == 1); - test(fso[1][0] == ::Ice::Float(1.11)); - test(fso[2].size() == 0); - test(dso.size() == 1); - test(dso[0].size() == 3); - test(dso[0][0] == ::Ice::Double(1.1E10)); - test(dso[0][1] == ::Ice::Double(1.2E10)); - test(dso[0][2] == ::Ice::Double(1.3E10)); - test(rso.size() == 2); - test(rso[0].size() == 3); - test(rso[0][0] == ::Ice::Double(1.1E10)); - test(rso[0][1] == ::Ice::Double(1.2E10)); - test(rso[0][2] == ::Ice::Double(1.3E10)); - test(rso[1].size() == 3); - test(rso[1][0] == ::Ice::Double(1.1E10)); - test(rso[1][1] == ::Ice::Double(1.2E10)); - test(rso[1][2] == ::Ice::Double(1.3E10)); - called(); - } - - void opStringSS(const Test::StringSS& rso, const Test::StringSS& sso) - { - test(sso.size() == 5); - test(sso[0].size() == 1); - test(sso[0][0] == "abc"); - test(sso[1].size() == 2); - test(sso[1][0] == "de"); - test(sso[1][1] == "fghi"); - test(sso[2].size() == 0); - test(sso[3].size() == 0); - test(sso[4].size() == 1); - test(sso[4][0] == "xyz"); - test(rso.size() == 3); - test(rso[0].size() == 1); - test(rso[0][0] == "xyz"); - test(rso[1].size() == 0); - test(rso[2].size() == 0); - called(); - } - - void opByteBoolD(const Test::ByteBoolD& ro, const Test::ByteBoolD& _do) - { - Test::ByteBoolD di1; - di1[10] = true; - di1[100] = false; - test(_do == di1); - test(ro.size() == 4); - test(ro.find(10) != ro.end()); - test(ro.find(10)->second == true); - test(ro.find(11) != ro.end()); - test(ro.find(11)->second == false); - test(ro.find(100) != ro.end()); - test(ro.find(100)->second == false); - test(ro.find(101) != ro.end()); - test(ro.find(101)->second == true); - called(); - } - - void opShortIntD(const Test::ShortIntD& ro, const Test::ShortIntD& _do) - { - Test::ShortIntD di1; - di1[110] = -1; - di1[1100] = 123123; - test(_do == di1); - test(ro.size() == 4); - test(ro.find(110) != ro.end()); - test(ro.find(110)->second == -1); - test(ro.find(111) != ro.end()); - test(ro.find(111)->second == -100); - test(ro.find(1100) != ro.end()); - test(ro.find(1100)->second == 123123); - test(ro.find(1101) != ro.end()); - test(ro.find(1101)->second == 0); - called(); - } - - void opLongFloatD(const Test::LongFloatD& ro, const Test::LongFloatD& _do) - { - Test::LongFloatD di1; - di1[999999110] = Ice::Float(-1.1); - di1[999999111] = Ice::Float(123123.2); - test(_do == di1); - test(ro.size() == 4); - test(ro.find(999999110) != ro.end()); - test(ro.find(999999110)->second == Ice::Float(-1.1)); - test(ro.find(999999120) != ro.end()); - test(ro.find(999999120)->second == Ice::Float(-100.4)); - test(ro.find(999999111) != ro.end()); - test(ro.find(999999111)->second == Ice::Float(123123.2)); - test(ro.find(999999130) != ro.end()); - test(ro.find(999999130)->second == Ice::Float(0.5)); - called(); - } - - void opStringStringD(const Test::StringStringD& ro, const Test::StringStringD& _do) - { - Test::StringStringD di1; - di1["foo"] = "abc -1.1"; - di1["bar"] = "abc 123123.2"; - test(_do == di1); - test(ro.size() == 4); - test(ro.find("foo") != ro.end()); - test(ro.find("foo")->second == "abc -1.1"); - test(ro.find("FOO") != ro.end()); - test(ro.find("FOO")->second == "abc -100.4"); - test(ro.find("bar") != ro.end()); - test(ro.find("bar")->second == "abc 123123.2"); - test(ro.find("BAR") != ro.end()); - test(ro.find("BAR")->second == "abc 0.5"); - called(); - } - - void opStringMyEnumD(const Test::StringMyEnumD& ro, const Test::StringMyEnumD& _do) - { - Test::StringMyEnumD di1; - di1["abc"] = Test::enum1; - di1[""] = Test::enum2; - test(_do == di1); - test(ro.size() == 4); - test(ro.find("abc") != ro.end()); - test(ro.find("abc")->second == Test::enum1); - test(ro.find("qwerty") != ro.end()); - test(ro.find("qwerty")->second == Test::enum3); - test(ro.find("") != ro.end()); - test(ro.find("")->second == Test::enum2); - test(ro.find("Hello!!") != ro.end()); - test(ro.find("Hello!!")->second == Test::enum2); - called(); - } - - void opMyStructMyEnumD(const Test::MyStructMyEnumD& ro, const Test::MyStructMyEnumD& _do) - { - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; - Test::MyStructMyEnumD di1; - di1[s11] = Test::enum1; - di1[s12] = Test::enum2; - test(_do == di1); - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; - test(ro.size() == 4); - test(ro.find(s11) != ro.end()); - test(ro.find(s11)->second == Test::enum1); - test(ro.find(s12) != ro.end()); - test(ro.find(s12)->second == Test::enum2); - test(ro.find(s22) != ro.end()); - test(ro.find(s22)->second == Test::enum3); - test(ro.find(s23) != ro.end()); - test(ro.find(s23)->second == Test::enum2); - called(); - } - - void opIntS(const Test::IntS& r) - { - for(int j = 0; j < static_cast<int>(r.size()); ++j) - { - test(r[j] == -j); - } - called(); - } - - void opDoubleMarshaling() - { - called(); - } - - void opIdempotent() - { - called(); - } - - void opNonmutating() - { - called(); - } - - void opDerived() - { - called(); - } - - void exCB(const Ice::Exception&) - { - test(false); - } - -private: - - Ice::CommunicatorPtr _communicator; -}; -typedef IceUtil::Handle<Callback> CallbackPtr; - -} - -void -twowaysNewAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) -{ - { - CallbackPtr cb = new Callback; - Ice::Callback_Object_ice_pingPtr callback = Ice::newCallback_Object_ice_ping(cb, - &Callback::ping, - &Callback::exCB); - p->begin_ice_ping(callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Ice::Callback_Object_ice_isAPtr callback = Ice::newCallback_Object_ice_isA(cb, - &Callback::isA, - &Callback::exCB); - p->begin_ice_isA(Test::MyClass::ice_staticId(), callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Ice::Callback_Object_ice_idPtr callback = Ice::newCallback_Object_ice_id(cb, - &Callback::id, - &Callback::exCB); - p->begin_ice_id(callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Ice::Callback_Object_ice_idsPtr callback = Ice::newCallback_Object_ice_ids(cb, - &Callback::ids, - &Callback::exCB); - p->begin_ice_ids(callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opVoidPtr callback = Test::newCallback_MyClass_opVoid(cb, - &Callback::opVoid, - &Callback::exCB); - p->begin_opVoid(callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opBytePtr callback = Test::newCallback_MyClass_opByte(cb, - &Callback::opByte, - &Callback::exCB); - p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f), callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opBoolPtr callback = Test::newCallback_MyClass_opBool(cb, - &Callback::opBool, - &Callback::exCB); - p->begin_opBool(true, false, callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opShortIntLongPtr callback = - Test::newCallback_MyClass_opShortIntLong(cb, &Callback::opShortIntLong, &Callback::exCB); - p->begin_opShortIntLong(10, 11, 12, callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opFloatDoublePtr callback = - Test::newCallback_MyClass_opFloatDouble(cb, &Callback::opFloatDouble, &Callback::exCB); - p->begin_opFloatDouble(Ice::Float(3.14), Ice::Double(1.1E10), callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opStringPtr callback = Test::newCallback_MyClass_opString(cb, - &Callback::opString, - &Callback::exCB); - p->begin_opString("hello", "world", callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opMyEnumPtr callback = Test::newCallback_MyClass_opMyEnum(cb, - &Callback::opMyEnum, - &Callback::exCB); - p->begin_opMyEnum(Test::enum2, callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback(communicator); - Test::Callback_MyClass_opMyClassPtr callback = Test::newCallback_MyClass_opMyClass(cb, - &Callback::opMyClass, - &Callback::exCB); - p->begin_opMyClass(p, callback); - cb->check(); - } - - { - Test::Structure si1; - si1.p = p; - si1.e = Test::enum3; - si1.s.s = "abc"; - Test::Structure si2; - si2.p = 0; - si2.e = Test::enum2; - si2.s.s = "def"; - - CallbackPtr cb = new Callback(communicator); - Test::Callback_MyClass_opStructPtr callback = Test::newCallback_MyClass_opStruct(cb, - &Callback::opStruct, - &Callback::exCB); - p->begin_opStruct(si1, si2, callback); - cb->check(); - } - - { - Test::ByteS bsi1; - Test::ByteS bsi2; - - bsi1.push_back(Ice::Byte(0x01)); - bsi1.push_back(Ice::Byte(0x11)); - bsi1.push_back(Ice::Byte(0x12)); - bsi1.push_back(Ice::Byte(0x22)); - - bsi2.push_back(Ice::Byte(0xf1)); - bsi2.push_back(Ice::Byte(0xf2)); - bsi2.push_back(Ice::Byte(0xf3)); - bsi2.push_back(Ice::Byte(0xf4)); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opByteSPtr callback = Test::newCallback_MyClass_opByteS(cb, - &Callback::opByteS, - &Callback::exCB); - p->begin_opByteS(bsi1, bsi2, callback); - cb->check(); - } - - { - Test::BoolS bsi1; - Test::BoolS bsi2; - - bsi1.push_back(true); - bsi1.push_back(true); - bsi1.push_back(false); - - bsi2.push_back(false); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opBoolSPtr callback = Test::newCallback_MyClass_opBoolS(cb, - &Callback::opBoolS, - &Callback::exCB); - p->begin_opBoolS(bsi1, bsi2, callback); - cb->check(); - } - - { - Test::ShortS ssi; - Test::IntS isi; - Test::LongS lsi; - - ssi.push_back(1); - ssi.push_back(2); - ssi.push_back(3); - - isi.push_back(5); - isi.push_back(6); - isi.push_back(7); - isi.push_back(8); - - lsi.push_back(10); - lsi.push_back(30); - lsi.push_back(20); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opShortIntLongSPtr callback = - Test::newCallback_MyClass_opShortIntLongS(cb, &Callback::opShortIntLongS, &Callback::exCB); - p->begin_opShortIntLongS(ssi, isi, lsi, callback); - cb->check(); - } - - { - Test::FloatS fsi; - Test::DoubleS dsi; - - fsi.push_back(Ice::Float(3.14)); - fsi.push_back(Ice::Float(1.11)); - - dsi.push_back(Ice::Double(1.1E10)); - dsi.push_back(Ice::Double(1.2E10)); - dsi.push_back(Ice::Double(1.3E10)); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opFloatDoubleSPtr callback = - Test::newCallback_MyClass_opFloatDoubleS(cb, &Callback::opFloatDoubleS, &Callback::exCB); - p->begin_opFloatDoubleS(fsi, dsi, callback); - cb->check(); - } - - { - Test::StringS ssi1; - Test::StringS ssi2; - - ssi1.push_back("abc"); - ssi1.push_back("de"); - ssi1.push_back("fghi"); - - ssi2.push_back("xyz"); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opStringSPtr callback = Test::newCallback_MyClass_opStringS(cb, - &Callback::opStringS, - &Callback::exCB); - p->begin_opStringS(ssi1, ssi2, callback); - cb->check(); - } - - { - Test::ByteSS bsi1; - bsi1.resize(2); - Test::ByteSS bsi2; - bsi2.resize(2); - - bsi1[0].push_back(Ice::Byte(0x01)); - bsi1[0].push_back(Ice::Byte(0x11)); - bsi1[0].push_back(Ice::Byte(0x12)); - bsi1[1].push_back(Ice::Byte(0xff)); - - bsi2[0].push_back(Ice::Byte(0x0e)); - bsi2[1].push_back(Ice::Byte(0xf2)); - bsi2[1].push_back(Ice::Byte(0xf1)); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opByteSSPtr callback = Test::newCallback_MyClass_opByteSS(cb, - &Callback::opByteSS, - &Callback::exCB); - p->begin_opByteSS(bsi1, bsi2, callback); - cb->check(); - } - - { - Test::BoolSS bsi1; - bsi1.resize(3); - Test::BoolSS bsi2; - bsi2.resize(1); - - bsi1[0].push_back(true); - bsi1[1].push_back(false); - bsi1[2].push_back(true); - bsi1[2].push_back(true); - - bsi2[0].push_back(false); - bsi2[0].push_back(false); - bsi2[0].push_back(true); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opBoolSSPtr callback = Test::newCallback_MyClass_opBoolSS(cb, - &Callback::opBoolSS, - &Callback::exCB); - p->begin_opBoolSS(bsi1, bsi2, callback); - cb->check(); - } - - { - Test::ShortSS ssi; - ssi.resize(3); - Test::IntSS isi; - isi.resize(2); - Test::LongSS lsi; - lsi.resize(1); - ssi[0].push_back(1); - ssi[0].push_back(2); - ssi[0].push_back(5); - ssi[1].push_back(13); - isi[0].push_back(24); - isi[0].push_back(98); - isi[1].push_back(42); - lsi[0].push_back(496); - lsi[0].push_back(1729); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opShortIntLongSSPtr callback = Test::newCallback_MyClass_opShortIntLongSS(cb, - &Callback::opShortIntLongSS, - &Callback::exCB); - p->begin_opShortIntLongSS(ssi, isi, lsi, callback); - cb->check(); - } - - { - Test::FloatSS fsi; - fsi.resize(3); - Test::DoubleSS dsi; - dsi.resize(1); - - fsi[0].push_back(Ice::Float(3.14)); - fsi[1].push_back(Ice::Float(1.11)); - - dsi[0].push_back(Ice::Double(1.1E10)); - dsi[0].push_back(Ice::Double(1.2E10)); - dsi[0].push_back(Ice::Double(1.3E10)); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opFloatDoubleSSPtr callback = - Test::newCallback_MyClass_opFloatDoubleSS(cb, &Callback::opFloatDoubleSS, &Callback::exCB); - p->begin_opFloatDoubleSS(fsi, dsi, callback); - cb->check(); - } - - { - Test::StringSS ssi1; - ssi1.resize(2); - Test::StringSS ssi2; - ssi2.resize(3); - - ssi1[0].push_back("abc"); - ssi1[1].push_back("de"); - ssi1[1].push_back("fghi"); - - ssi2[2].push_back("xyz"); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opStringSSPtr callback = - Test::newCallback_MyClass_opStringSS(cb, &Callback::opStringSS, &Callback::exCB); - p->begin_opStringSS(ssi1, ssi2, callback); - cb->check(); - } - - { - Test::ByteBoolD di1; - di1[10] = true; - di1[100] = false; - Test::ByteBoolD di2; - di2[10] = true; - di2[11] = false; - di2[101] = true; - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opByteBoolDPtr callback = - Test::newCallback_MyClass_opByteBoolD(cb, &Callback::opByteBoolD, &Callback::exCB); - p->begin_opByteBoolD(di1, di2, callback); - cb->check(); - } - - { - Test::ShortIntD di1; - di1[110] = -1; - di1[1100] = 123123; - Test::ShortIntD di2; - di2[110] = -1; - di2[111] = -100; - di2[1101] = 0; - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opShortIntDPtr callback = - Test::newCallback_MyClass_opShortIntD(cb, &Callback::opShortIntD, &Callback::exCB); - p->begin_opShortIntD(di1, di2, callback); - cb->check(); - } - - { - Test::LongFloatD di1; - di1[999999110] = Ice::Float(-1.1); - di1[999999111] = Ice::Float(123123.2); - Test::LongFloatD di2; - di2[999999110] = Ice::Float(-1.1); - di2[999999120] = Ice::Float(-100.4); - di2[999999130] = Ice::Float(0.5); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opLongFloatDPtr callback = - Test::newCallback_MyClass_opLongFloatD(cb, &Callback::opLongFloatD, &Callback::exCB); - p->begin_opLongFloatD(di1, di2, callback); - cb->check(); - } - - { - Test::StringStringD di1; - di1["foo"] = "abc -1.1"; - di1["bar"] = "abc 123123.2"; - Test::StringStringD di2; - di2["foo"] = "abc -1.1"; - di2["FOO"] = "abc -100.4"; - di2["BAR"] = "abc 0.5"; - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opStringStringDPtr callback = - Test::newCallback_MyClass_opStringStringD(cb, &Callback::opStringStringD, &Callback::exCB); - p->begin_opStringStringD(di1, di2, callback); - cb->check(); - } - - { - Test::StringMyEnumD di1; - di1["abc"] = Test::enum1; - di1[""] = Test::enum2; - Test::StringMyEnumD di2; - di2["abc"] = Test::enum1; - di2["qwerty"] = Test::enum3; - di2["Hello!!"] = Test::enum2; - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opStringMyEnumDPtr callback = - Test::newCallback_MyClass_opStringMyEnumD(cb, &Callback::opStringMyEnumD, &Callback::exCB); - p->begin_opStringMyEnumD(di1, di2, callback); - cb->check(); - } - - { - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; - Test::MyStructMyEnumD di1; - di1[s11] = Test::enum1; - di1[s12] = Test::enum2; - - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; - Test::MyStructMyEnumD di2; - di2[s11] = Test::enum1; - di2[s22] = Test::enum3; - di2[s23] = Test::enum2; - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opMyStructMyEnumDPtr callback = - Test::newCallback_MyClass_opMyStructMyEnumD(cb, &Callback::opMyStructMyEnumD, &Callback::exCB); - p->begin_opMyStructMyEnumD(di1, di2, callback); - cb->check(); - } - - { - const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 }; - - for(unsigned int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l) - { - Test::IntS s; - for(int i = 0; i < lengths[l]; ++i) - { - s.push_back(i); - } - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opIntSPtr callback = - Test::newCallback_MyClass_opIntS(cb, &Callback::opIntS, &Callback::exCB); - p->begin_opIntS(s, callback); - cb->check(); - } - } - - { - Test::StringStringD ctx; - ctx["one"] = "ONE"; - ctx["two"] = "TWO"; - ctx["three"] = "THREE"; - { - test(p->ice_getContext().empty()); - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); - test(c != ctx); - } - { - test(p->ice_getContext().empty()); - Ice::AsyncResultPtr r = p->begin_opContext(ctx); - Ice::Context c = p->end_opContext(r); - test(c == ctx); - } - Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); - test(p2->ice_getContext() == ctx); - { - Ice::AsyncResultPtr r = p2->begin_opContext(); - Ice::Context c = p2->end_opContext(r); - test(c == ctx); - } - { - Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_context(ctx)); - Ice::AsyncResultPtr r = p2->begin_opContext(ctx); - Ice::Context c = p2->end_opContext(r); - test(c == ctx); - } - -#ifndef ICE_OS_WINRT - { - // - // Test implicit context propagation - // - - string impls[] = {"Shared", "PerThread"}; - for(int i = 0; i < 2; i++) - { - Ice::InitializationData initData; - initData.properties = communicator->getProperties()->clone(); - initData.properties->setProperty("Ice.ImplicitContext", impls[i]); - - Ice::CommunicatorPtr ic = Ice::initialize(initData); - - Ice::Context ctx; - ctx["one"] = "ONE"; - ctx["two"] = "TWO"; - ctx["three"] = "THREE"; - - - Test::MyClassPrx p = Test::MyClassPrx::uncheckedCast( - ic->stringToProxy("test:default -p 12010")); - - - ic->getImplicitContext()->setContext(ctx); - test(ic->getImplicitContext()->getContext() == ctx); - { - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); - test(c == ctx); - } - - ic->getImplicitContext()->put("zero", "ZERO"); - - ctx = ic->getImplicitContext()->getContext(); - { - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); - test(c == ctx); - } - - Ice::Context prxContext; - prxContext["one"] = "UN"; - prxContext["four"] = "QUATRE"; - - Ice::Context combined = prxContext; - combined.insert(ctx.begin(), ctx.end()); - test(combined["one"] == "UN"); - - p = Test::MyClassPrx::uncheckedCast(p->ice_context(prxContext)); - - ic->getImplicitContext()->setContext(Ice::Context()); - { - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); - test(c == prxContext); - } - - ic->getImplicitContext()->setContext(ctx); - { - Ice::AsyncResultPtr r = p->begin_opContext(); - Ice::Context c = p->end_opContext(r); - test(c == combined); - } - - ic->getImplicitContext()->setContext(Ice::Context()); - ic->destroy(); - } - } -#endif - } - - { - Ice::Double d = 1278312346.0 / 13.0; - Test::DoubleS ds(5, d); - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opDoubleMarshalingPtr callback = - Test::newCallback_MyClass_opDoubleMarshaling(cb, &Callback::opDoubleMarshaling, &Callback::exCB); - p->begin_opDoubleMarshaling(d, ds, callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opIdempotentPtr callback = - Test::newCallback_MyClass_opIdempotent(cb, &Callback::opIdempotent, &Callback::exCB); - p->begin_opIdempotent(callback); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opNonmutatingPtr callback = - Test::newCallback_MyClass_opNonmutating(cb, &Callback::opNonmutating, &Callback::exCB); - p->begin_opNonmutating(callback); - cb->check(); - } - - { - Test::MyDerivedClassPrx derived = Test::MyDerivedClassPrx::checkedCast(p); - test(derived); - CallbackPtr cb = new Callback; - Test::Callback_MyDerivedClass_opDerivedPtr callback = - Test::newCallback_MyDerivedClass_opDerived(cb, &Callback::opDerived, &Callback::exCB); - derived->begin_opDerived(callback); - cb->check(); - } -#ifdef ICE_CPP11 - - { - CallbackPtr cb = new Callback; - p->begin_ice_ping([=](){ cb->ping(); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_ice_isA(Test::MyClass::ice_staticId(), [=](bool isA){ cb->isA(isA); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_ice_id([=](const string& id){ cb->id(id); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_ice_ids([=](const Ice::StringSeq& ids){ cb->ids(ids); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_opVoid([=](){ cb->opVoid(); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f), - [=](const Ice::Byte& p1, const Ice::Byte& p2){ cb->opByte(p1, p2); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opBoolPtr callback = Test::newCallback_MyClass_opBool(cb, - &Callback::opBool, - &Callback::exCB); - p->begin_opBool(true, false, [=](bool p1, bool p2){ cb->opBool(p1, p2); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_opShortIntLong(10, 11, 12, - [=](Ice::Long p1, Ice::Short p2, Ice::Int p3, Ice::Long p4){ cb->opShortIntLong(p1, p2, p3, p4); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_opFloatDouble(Ice::Float(3.14), Ice::Double(1.1E10), - [=](Ice::Double p1, Ice::Float p2, Ice::Double p3){ cb->opFloatDouble(p1, p2, p3); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_opString("hello", "world", - [=](const string& p1, const string& p2){ cb->opString(p1, p2); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_opMyEnum(Test::enum2, - [=](Test::MyEnum p1, Test::MyEnum p2){ cb->opMyEnum(p1, p2); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback(communicator); - p->begin_opMyClass(p, - [=](const Test::MyClassPrx& p1, const Test::MyClassPrx p2, const Test::MyClassPrx p3) - { - cb->opMyClass(p1, p2, p3); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::Structure si1; - si1.p = p; - si1.e = Test::enum3; - si1.s.s = "abc"; - Test::Structure si2; - si2.p = 0; - si2.e = Test::enum2; - si2.s.s = "def"; - - CallbackPtr cb = new Callback(communicator); - p->begin_opStruct(si1, si2, - [=](const Test::Structure& p1, const Test::Structure& p2) - { - cb->opStruct(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::ByteS bsi1; - Test::ByteS bsi2; - - bsi1.push_back(Ice::Byte(0x01)); - bsi1.push_back(Ice::Byte(0x11)); - bsi1.push_back(Ice::Byte(0x12)); - bsi1.push_back(Ice::Byte(0x22)); - - bsi2.push_back(Ice::Byte(0xf1)); - bsi2.push_back(Ice::Byte(0xf2)); - bsi2.push_back(Ice::Byte(0xf3)); - bsi2.push_back(Ice::Byte(0xf4)); - - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opByteSPtr callback = Test::newCallback_MyClass_opByteS(cb, - &Callback::opByteS, - &Callback::exCB); - p->begin_opByteS(bsi1, bsi2, - [=](const Test::ByteS& p1, const Test::ByteS& p2) - { - cb->opByteS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::BoolS bsi1; - Test::BoolS bsi2; - - bsi1.push_back(true); - bsi1.push_back(true); - bsi1.push_back(false); - - bsi2.push_back(false); - - CallbackPtr cb = new Callback; - p->begin_opBoolS(bsi1, bsi2, - [=](const Test::BoolS& p1, const Test::BoolS& p2) - { - cb->opBoolS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::ShortS ssi; - Test::IntS isi; - Test::LongS lsi; - - ssi.push_back(1); - ssi.push_back(2); - ssi.push_back(3); - - isi.push_back(5); - isi.push_back(6); - isi.push_back(7); - isi.push_back(8); - - lsi.push_back(10); - lsi.push_back(30); - lsi.push_back(20); - - CallbackPtr cb = new Callback; - p->begin_opShortIntLongS(ssi, isi, lsi, - [=](const Test::LongS& p1, const Test::ShortS& p2, const Test::IntS& p3, const Test::LongS& p4) - { - cb->opShortIntLongS(p1, p2, p3, p4); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::FloatS fsi; - Test::DoubleS dsi; - - fsi.push_back(Ice::Float(3.14)); - fsi.push_back(Ice::Float(1.11)); - - dsi.push_back(Ice::Double(1.1E10)); - dsi.push_back(Ice::Double(1.2E10)); - dsi.push_back(Ice::Double(1.3E10)); - - CallbackPtr cb = new Callback; - p->begin_opFloatDoubleS(fsi, dsi, - [=](const Test::DoubleS& p1, const Test::FloatS& p2, const Test::DoubleS& p3) - { - cb->opFloatDoubleS(p1, p2, p3); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::StringS ssi1; - Test::StringS ssi2; - - ssi1.push_back("abc"); - ssi1.push_back("de"); - ssi1.push_back("fghi"); - - ssi2.push_back("xyz"); - - CallbackPtr cb = new Callback; - p->begin_opStringS(ssi1, ssi2, - [=](const Test::StringS& p1, const Test::StringS& p2) - { - cb->opStringS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::ByteSS bsi1; - bsi1.resize(2); - Test::ByteSS bsi2; - bsi2.resize(2); - - bsi1[0].push_back(Ice::Byte(0x01)); - bsi1[0].push_back(Ice::Byte(0x11)); - bsi1[0].push_back(Ice::Byte(0x12)); - bsi1[1].push_back(Ice::Byte(0xff)); - - bsi2[0].push_back(Ice::Byte(0x0e)); - bsi2[1].push_back(Ice::Byte(0xf2)); - bsi2[1].push_back(Ice::Byte(0xf1)); - - CallbackPtr cb = new Callback; - p->begin_opByteSS(bsi1, bsi2, - [=](const Test::ByteSS& p1, const Test::ByteSS& p2) - { - cb->opByteSS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::FloatSS fsi; - fsi.resize(3); - Test::DoubleSS dsi; - dsi.resize(1); - - fsi[0].push_back(Ice::Float(3.14)); - fsi[1].push_back(Ice::Float(1.11)); - - dsi[0].push_back(Ice::Double(1.1E10)); - dsi[0].push_back(Ice::Double(1.2E10)); - dsi[0].push_back(Ice::Double(1.3E10)); - - CallbackPtr cb = new Callback; - p->begin_opFloatDoubleSS(fsi, dsi, - [=](const Test::DoubleSS& p1, const Test::FloatSS& p2, const Test::DoubleSS& p3) - { - cb->opFloatDoubleSS(p1, p2, p3); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::StringSS ssi1; - ssi1.resize(2); - Test::StringSS ssi2; - ssi2.resize(3); - - ssi1[0].push_back("abc"); - ssi1[1].push_back("de"); - ssi1[1].push_back("fghi"); - - ssi2[2].push_back("xyz"); - - CallbackPtr cb = new Callback; - p->begin_opStringSS(ssi1, ssi2, - [=](const Test::StringSS& p1, const Test::StringSS& p2) - { - cb->opStringSS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::ByteBoolD di1; - di1[10] = true; - di1[100] = false; - Test::ByteBoolD di2; - di2[10] = true; - di2[11] = false; - di2[101] = true; - - CallbackPtr cb = new Callback; - p->begin_opByteBoolD(di1, di2, - [=](const Test::ByteBoolD& p1, const Test::ByteBoolD& p2) - { - cb->opByteBoolD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); - cb->check(); - } - - { - Test::ShortIntD di1; - di1[110] = -1; - di1[1100] = 123123; - Test::ShortIntD di2; - di2[110] = -1; - di2[111] = -100; - di2[1101] = 0; - - CallbackPtr cb = new Callback; - p->begin_opShortIntD(di1, di2, - [=](const Test::ShortIntD& p1, const Test::ShortIntD& p2) - { - cb->opShortIntD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); - cb->check(); - } - - { - Test::LongFloatD di1; - di1[999999110] = Ice::Float(-1.1); - di1[999999111] = Ice::Float(123123.2); - Test::LongFloatD di2; - di2[999999110] = Ice::Float(-1.1); - di2[999999120] = Ice::Float(-100.4); - di2[999999130] = Ice::Float(0.5); - - CallbackPtr cb = new Callback; - p->begin_opLongFloatD(di1, di2, - [=](const Test::LongFloatD& p1, const Test::LongFloatD& p2) - { - cb->opLongFloatD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); - cb->check(); - } - - { - Test::StringStringD di1; - di1["foo"] = "abc -1.1"; - di1["bar"] = "abc 123123.2"; - Test::StringStringD di2; - di2["foo"] = "abc -1.1"; - di2["FOO"] = "abc -100.4"; - di2["BAR"] = "abc 0.5"; - - CallbackPtr cb = new Callback; - p->begin_opStringStringD(di1, di2, - [=](const Test::StringStringD& p1, const Test::StringStringD& p2) - { - cb->opStringStringD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); - cb->check(); - } - - { - Test::StringMyEnumD di1; - di1["abc"] = Test::enum1; - di1[""] = Test::enum2; - Test::StringMyEnumD di2; - di2["abc"] = Test::enum1; - di2["qwerty"] = Test::enum3; - di2["Hello!!"] = Test::enum2; - - CallbackPtr cb = new Callback; - p->begin_opStringMyEnumD(di1, di2, - [=](const Test::StringMyEnumD& p1, const Test::StringMyEnumD& p2) - { - cb->opStringMyEnumD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); - cb->check(); - } - - { - Test::MyStruct s11 = { 1, 1 }; - Test::MyStruct s12 = { 1, 2 }; - Test::MyStructMyEnumD di1; - di1[s11] = Test::enum1; - di1[s12] = Test::enum2; - - Test::MyStruct s22 = { 2, 2 }; - Test::MyStruct s23 = { 2, 3 }; - Test::MyStructMyEnumD di2; - di2[s11] = Test::enum1; - di2[s22] = Test::enum3; - di2[s23] = Test::enum2; - - CallbackPtr cb = new Callback; - p->begin_opMyStructMyEnumD(di1, di2, - [=](const Test::MyStructMyEnumD& p1, const Test::MyStructMyEnumD& p2) - { - cb->opMyStructMyEnumD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); - cb->check(); - } - - { - const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 }; - - for(unsigned int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l) - { - Test::IntS s; - for(int i = 0; i < lengths[l]; ++i) - { - s.push_back(i); - } - CallbackPtr cb = new Callback; - p->begin_opIntS(s, - [=](const Test::IntS& p1) - { - cb->opIntS(p1); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); - cb->check(); - } - } - - { - Ice::Double d = 1278312346.0 / 13.0; - Test::DoubleS ds(5, d); - CallbackPtr cb = new Callback; - p->begin_opDoubleMarshaling(d, ds, - [=](){ cb->opDoubleMarshaling(); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - Test::Callback_MyClass_opIdempotentPtr callback = - Test::newCallback_MyClass_opIdempotent(cb, &Callback::opIdempotent, &Callback::exCB); - p->begin_opIdempotent([=](){ cb->opIdempotent(); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - CallbackPtr cb = new Callback; - p->begin_opNonmutating([=](){ cb->opNonmutating(); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } - - { - Test::MyDerivedClassPrx derived = Test::MyDerivedClassPrx::checkedCast(p); - test(derived); - CallbackPtr cb = new Callback; - derived->begin_opDerived([=](){ cb->opDerived(); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); - cb->check(); - } -#endif -} diff --git a/cpp/test/Slice/keyword/Client.cpp b/cpp/test/Slice/keyword/Client.cpp index 2a862474362..d1e2d100cdd 100644 --- a/cpp/test/Slice/keyword/Client.cpp +++ b/cpp/test/Slice/keyword/Client.cpp @@ -70,14 +70,6 @@ public: return _cpp_and::_cpp_auto(); } }; - -class fooI : public _cpp_and::AMI_switch_foo -{ -public: - - virtual void ice_response(Ice::Int) {} - virtual void ice_exception(const ::Ice::Exception&) {} -}; // // This section of the test is present to ensure that the C++ types @@ -106,8 +98,6 @@ testtypes() e->_cpp_explicit(); _cpp_and::charPtr e1 = new charI(); - _cpp_and::switchPrx f; - f->foo_async(new fooI(), e); _cpp_and::switchPtr f1 = new switchI(); _cpp_and::doPrx g; diff --git a/cpp/test/Slice/keyword/Key.ice b/cpp/test/Slice/keyword/Key.ice index 98ae7dd147f..bbf95c9bb66 100644 --- a/cpp/test/Slice/keyword/Key.ice +++ b/cpp/test/Slice/keyword/Key.ice @@ -38,7 +38,7 @@ interface char class switch { int if; - ["ami"] void foo(char* export, out int volatile); + void foo(char* export, out int volatile); }; class do extends switch implements char, break |