diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-08-04 17:36:25 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-08-04 17:36:25 -0400 |
commit | dc2f88ef6643b235a82be44b0682b75b7534c5e6 (patch) | |
tree | d9084cd31009402bc5bad8ff4cd7e20f764387ea | |
parent | Refactored shared_from_this/enable_shared_from_this (diff) | |
download | ice-dc2f88ef6643b235a82be44b0682b75b7534c5e6.tar.bz2 ice-dc2f88ef6643b235a82be44b0682b75b7534c5e6.tar.xz ice-dc2f88ef6643b235a82be44b0682b75b7534c5e6.zip |
New TargetCompare template, renamed targetEquals to targetEqualTo
-rw-r--r-- | cpp/include/Ice/Comparable.h | 57 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.h | 2 | ||||
-rw-r--r-- | cpp/src/Ice/LocatorInfo.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/RouterInfo.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/RouterInfo.h | 2 | ||||
-rw-r--r-- | cpp/src/Ice/WSEndpoint.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceSSL/EndpointI.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/adapterDeactivation/AllTests.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/custom/AllTests.cpp | 26 | ||||
-rw-r--r-- | cpp/test/Ice/exceptions/AllTests.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/facets/AllTests.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/faultTolerance/AllTests.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/hold/AllTests.cpp | 4 | ||||
-rw-r--r-- | cpp/test/Ice/inheritance/AllTests.cpp | 160 | ||||
-rw-r--r-- | cpp/test/Ice/objects/AllTests.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Twoways.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/optional/AllTests.cpp | 16 | ||||
-rw-r--r-- | cpp/test/Ice/proxy/AllTests.cpp | 154 | ||||
-rw-r--r-- | cpp/test/Ice/retry/AllTests.cpp | 4 | ||||
-rw-r--r-- | cpp/test/Ice/servantLocator/AllTests.cpp | 2 | ||||
-rw-r--r-- | cpp/test/IceSSL/configuration/AllTests.cpp | 18 |
22 files changed, 250 insertions, 223 deletions
diff --git a/cpp/include/Ice/Comparable.h b/cpp/include/Ice/Comparable.h index 8f7a7eb7787..aa630de3581 100644 --- a/cpp/include/Ice/Comparable.h +++ b/cpp/include/Ice/Comparable.h @@ -10,11 +10,13 @@ #ifndef ICE_COMPARABLE_H #define ICE_COMPARABLE_H +#include <functional> + namespace Ice { template<typename T, typename U> -inline bool targetEquals(const T& lhs, const U& rhs) +inline bool targetEqualTo(const T& lhs, const U& rhs) { if(lhs && rhs) { @@ -26,16 +28,6 @@ inline bool targetEquals(const T& lhs, const U& rhs) } } -template<typename T> -struct TargetEquals -{ - bool operator()(const T& lhs, const T& rhs) const - { - return targetEquals(lhs, rhs); - } -}; - - template<typename T, typename U> inline bool targetLess(const T& lhs, const U& rhs) { @@ -49,16 +41,51 @@ inline bool targetLess(const T& lhs, const U& rhs) } } -template<typename T> -struct TargetLess +template<typename T, typename U> +inline bool targetGreater(const T& lhs, const U& rhs) +{ + return targetLess(rhs, lhs); +} + +template<typename T, typename U> +inline bool targetLessEqual(const T& lhs, const U& rhs) +{ + return !targetGreater(lhs, rhs); +} + +template<typename T, typename U> +inline bool targetGreaterEqual(const T& lhs, const U& rhs) +{ + return !targetLess(lhs, rhs); +} + +template<typename T, typename U> +inline bool targetNotEqualTo(const T& lhs, const U& rhs) +{ + return !targetEqualTo(lhs, rhs); +} + +#ifdef ICE_CPP11_MAPPING + +template<typename T, template<typename> class Compare> +struct TargetCompare { bool operator()(const T& lhs, const T& rhs) const { - return targetLess(lhs, rhs); + if(lhs && rhs) + { + return Compare<typename T::element_type>()(*lhs, *rhs); + } + else + { + return Compare<bool>()(static_cast<const bool>(lhs), static_cast<const bool>(rhs)); + } } }; -#ifdef ICE_CPP11_MAPPING +// +// Relational operators for generated structs and classes +// template<class C, typename = std::enable_if<std::is_member_function_pointer<decltype(&C::ice_tuple)>::value>> bool operator<(const C& lhs, const C& rhs) diff --git a/cpp/src/Ice/ConnectionFactory.h b/cpp/src/Ice/ConnectionFactory.h index 46df6067236..92d2d400739 100644 --- a/cpp/src/Ice/ConnectionFactory.h +++ b/cpp/src/Ice/ConnectionFactory.h @@ -165,7 +165,7 @@ private: std::map<ConnectorPtr, std::set<ConnectCallbackPtr> > _pending; #ifdef ICE_CPP11_MAPPING - std::multimap<EndpointIPtr, Ice::ConnectionIPtr, Ice::TargetLess<EndpointIPtr>> _connectionsByEndpoint; + std::multimap<EndpointIPtr, Ice::ConnectionIPtr, Ice::TargetCompare<EndpointIPtr, std::less>> _connectionsByEndpoint; #else std::multimap<EndpointIPtr, Ice::ConnectionIPtr> _connectionsByEndpoint; #endif diff --git a/cpp/src/Ice/LocatorInfo.cpp b/cpp/src/Ice/LocatorInfo.cpp index e212d157552..d13d3f9f54f 100644 --- a/cpp/src/Ice/LocatorInfo.cpp +++ b/cpp/src/Ice/LocatorInfo.cpp @@ -565,7 +565,7 @@ bool IceInternal::LocatorInfo::operator==(const LocatorInfo& rhs) const { #ifdef ICE_CPP11_MAPPING - return Ice::targetEquals(_locator, rhs._locator); + return Ice::targetEqualTo(_locator, rhs._locator); #else return _locator == rhs._locator; #endif diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index b2934ecdaf3..86328e0880a 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -1343,11 +1343,11 @@ IceInternal::RoutableReference::operator==(const Reference& r) const } #ifdef ICE_CPP11_MAPPING // - // TODO: With C++14 we could use the vesion that receives four iterators and we don't need to explicitly - // check the sizesa are equal. + // TODO: With C++14 we could use the version that receives four iterators and we don't need to explicitly + // check the sizes are equal. // if(_endpoints.size() != rhs->_endpoints.size() || - !equal(_endpoints.begin(), _endpoints.end(), rhs->_endpoints.begin(), Ice::TargetEquals<shared_ptr<EndpointI>>())) + !equal(_endpoints.begin(), _endpoints.end(), rhs->_endpoints.begin(), Ice::TargetCompare<shared_ptr<EndpointI>, std::equal_to>())) #else if(_endpoints != rhs->_endpoints) #endif @@ -1474,7 +1474,7 @@ IceInternal::RoutableReference::operator<(const Reference& r) const } #ifdef ICE_CPP11_MAPPING if(lexicographical_compare(_endpoints.begin(), _endpoints.end(), rhs->_endpoints.begin(), rhs->_endpoints.end(), - Ice::TargetLess<shared_ptr<EndpointI>>())) + Ice::TargetCompare<shared_ptr<EndpointI>, std::less>())) #else if(_endpoints < rhs->_endpoints) #endif diff --git a/cpp/src/Ice/RouterInfo.cpp b/cpp/src/Ice/RouterInfo.cpp index 1589e84be90..c5c7b4c5df6 100644 --- a/cpp/src/Ice/RouterInfo.cpp +++ b/cpp/src/Ice/RouterInfo.cpp @@ -130,7 +130,7 @@ bool IceInternal::RouterInfo::operator==(const RouterInfo& rhs) const { #ifdef ICE_CPP11_MAPPING - return Ice::targetEquals(_router, rhs._router); + return Ice::targetEqualTo(_router, rhs._router); #else return _router == rhs._router; #endif diff --git a/cpp/src/Ice/RouterInfo.h b/cpp/src/Ice/RouterInfo.h index 298cbc455f4..6c9cdc8539f 100644 --- a/cpp/src/Ice/RouterInfo.h +++ b/cpp/src/Ice/RouterInfo.h @@ -45,7 +45,7 @@ private: #ifdef ICE_CPP11_MAPPING using RouterTableMap = std::map<std::shared_ptr<Ice::RouterPrx>, RouterInfoPtr, - Ice::TargetLess<std::shared_ptr<::Ice::RouterPrx>>>; + Ice::TargetCompare<std::shared_ptr<::Ice::RouterPrx>, std::less>>; #else typedef std::map<Ice::RouterPrxPtr, RouterInfoPtr> RouterTableMap; #endif diff --git a/cpp/src/Ice/WSEndpoint.cpp b/cpp/src/Ice/WSEndpoint.cpp index 244017087a2..0c41ac4a310 100644 --- a/cpp/src/Ice/WSEndpoint.cpp +++ b/cpp/src/Ice/WSEndpoint.cpp @@ -310,7 +310,7 @@ IceInternal::WSEndpoint::operator==(const Ice::LocalObject& r) const return true; } - if(!Ice::targetEquals(_delegate, p->_delegate)) + if(!Ice::targetEqualTo(_delegate, p->_delegate)) { return false; } diff --git a/cpp/src/IceSSL/EndpointI.cpp b/cpp/src/IceSSL/EndpointI.cpp index 08b78b1317a..73072ddea7a 100644 --- a/cpp/src/IceSSL/EndpointI.cpp +++ b/cpp/src/IceSSL/EndpointI.cpp @@ -258,7 +258,7 @@ IceSSL::EndpointI::operator==(const Ice::LocalObject& r) const return true; } - if(!Ice::targetEquals(_delegate, p->_delegate)) + if(!Ice::targetEqualTo(_delegate, p->_delegate)) { return false; } diff --git a/cpp/test/Ice/adapterDeactivation/AllTests.cpp b/cpp/test/Ice/adapterDeactivation/AllTests.cpp index 3a02ae53b68..3f2f0462247 100644 --- a/cpp/test/Ice/adapterDeactivation/AllTests.cpp +++ b/cpp/test/Ice/adapterDeactivation/AllTests.cpp @@ -27,7 +27,7 @@ allTests(const CommunicatorPtr& communicator) TestIntfPrxPtr obj = ICE_CHECKED_CAST(TestIntfPrx, base); test(obj); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(obj, base)); + test(Ice::targetEqualTo(obj, base)); #else test(obj == base); #endif diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp index 997ef66b9bc..102760f040e 100644 --- a/cpp/test/Ice/custom/AllTests.cpp +++ b/cpp/test/Ice/custom/AllTests.cpp @@ -593,7 +593,7 @@ allTests(const Ice::CommunicatorPtr& communicator) Test::TestIntfPrxPtr t = ICE_CHECKED_CAST(Test::TestIntfPrx, base); test(t); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(t, base)); + test(Ice::targetEqualTo(t, base)); #else test(t == base); #endif @@ -1060,8 +1060,8 @@ allTests(const Ice::CommunicatorPtr& communicator) for(auto i: in) { - test(Ice::targetEquals(*op++, i)); - test(Ice::targetEquals(*rp++, i)); + test(Ice::targetEqualTo(*op++, i)); + test(Ice::targetEqualTo(*rp++, i)); } #else test(out == in); @@ -1085,8 +1085,8 @@ allTests(const Ice::CommunicatorPtr& communicator) for(auto i: in) { - test(Ice::targetEquals(*op++, i)); - test(Ice::targetEquals(*rp++, i)); + test(Ice::targetEqualTo(*op++, i)); + test(Ice::targetEqualTo(*rp++, i)); } #else test(out == in); @@ -1853,8 +1853,8 @@ allTests(const Ice::CommunicatorPtr& communicator) for(auto i: in) { - test(Ice::targetEquals(*op++, i)); - test(Ice::targetEquals(*rp++, i)); + test(Ice::targetEqualTo(*op++, i)); + test(Ice::targetEqualTo(*rp++, i)); } #else deque<Test::CPrx> out; @@ -1884,8 +1884,8 @@ allTests(const Ice::CommunicatorPtr& communicator) for(auto i: in) { - test(Ice::targetEquals(*op++, i)); - test(Ice::targetEquals(*rp++, i)); + test(Ice::targetEqualTo(*op++, i)); + test(Ice::targetEqualTo(*rp++, i)); } #else list<Test::CPrx> out; @@ -2951,8 +2951,8 @@ allTests(const Ice::CommunicatorPtr& communicator) auto rp = ret.begin(); for(auto i: in) { - test(Ice::targetEquals(*op++, i)); - test(Ice::targetEquals(*rp++, i)); + test(Ice::targetEqualTo(*op++, i)); + test(Ice::targetEqualTo(*rp++, i)); } done.set_value(true); }, @@ -2991,8 +2991,8 @@ allTests(const Ice::CommunicatorPtr& communicator) auto rp = ret.begin(); for(auto i: in) { - test(Ice::targetEquals(*op++, i)); - test(Ice::targetEquals(*rp++, i)); + test(Ice::targetEqualTo(*op++, i)); + test(Ice::targetEqualTo(*rp++, i)); } done.set_value(true); }, diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp index 3f047784a12..990f735a805 100644 --- a/cpp/test/Ice/exceptions/AllTests.cpp +++ b/cpp/test/Ice/exceptions/AllTests.cpp @@ -690,7 +690,7 @@ allTests(const Ice::CommunicatorPtr& communicator) ThrowerPrxPtr thrower = ICE_CHECKED_CAST(ThrowerPrx, base); test(thrower); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(thrower, base)); + test(Ice::targetEqualTo(thrower, base)); #else test(thrower == base); #endif diff --git a/cpp/test/Ice/facets/AllTests.cpp b/cpp/test/Ice/facets/AllTests.cpp index 5b542de8a85..01cd33cf1d6 100644 --- a/cpp/test/Ice/facets/AllTests.cpp +++ b/cpp/test/Ice/facets/AllTests.cpp @@ -192,7 +192,7 @@ allTests(const Ice::CommunicatorPtr& communicator) d = ICE_CHECKED_CAST(DPrx, db); test(d); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(d, db)); + test(Ice::targetEqualTo(d, db)); #else test(d == db); #endif diff --git a/cpp/test/Ice/faultTolerance/AllTests.cpp b/cpp/test/Ice/faultTolerance/AllTests.cpp index f50229d8cdb..5a861677c08 100644 --- a/cpp/test/Ice/faultTolerance/AllTests.cpp +++ b/cpp/test/Ice/faultTolerance/AllTests.cpp @@ -126,7 +126,7 @@ allTests(const Ice::CommunicatorPtr& communicator, const vector<int>& ports) TestIntfPrxPtr obj = ICE_CHECKED_CAST(TestIntfPrx, base); test(obj); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(obj, base)); + test(Ice::targetEqualTo(obj, base)); #else test(obj == base); #endif diff --git a/cpp/test/Ice/hold/AllTests.cpp b/cpp/test/Ice/hold/AllTests.cpp index 789562c8d1f..d08764d57d8 100644 --- a/cpp/test/Ice/hold/AllTests.cpp +++ b/cpp/test/Ice/hold/AllTests.cpp @@ -93,7 +93,7 @@ allTests(const Ice::CommunicatorPtr& communicator) HoldPrxPtr hold = ICE_CHECKED_CAST(HoldPrx, base); test(hold); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(hold, base)); + test(Ice::targetEqualTo(hold, base)); #else test(hold == base); #endif @@ -101,7 +101,7 @@ allTests(const Ice::CommunicatorPtr& communicator) test(holdSerialized); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(holdSerialized, baseSerialized)); + test(Ice::targetEqualTo(holdSerialized, baseSerialized)); #else test(holdSerialized == baseSerialized); #endif diff --git a/cpp/test/Ice/inheritance/AllTests.cpp b/cpp/test/Ice/inheritance/AllTests.cpp index 3e6be927b77..6fc955d7eb8 100644 --- a/cpp/test/Ice/inheritance/AllTests.cpp +++ b/cpp/test/Ice/inheritance/AllTests.cpp @@ -27,7 +27,7 @@ allTests(const Ice::CommunicatorPtr& communicator) InitialPrxPtr initial = ICE_CHECKED_CAST(InitialPrx, base); test(initial); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(initial, base)); + test(Ice::targetEqualTo(initial, base)); #else test(initial == base); #endif @@ -39,12 +39,12 @@ allTests(const Ice::CommunicatorPtr& communicator) MA::CCPrxPtr cc = initial->ccop(); MA::CDPrxPtr cd = initial->cdop(); #ifdef ICE_CPP11_MAPPING - test(!Ice::targetEquals(ca, cb)); - test(!Ice::targetEquals(ca, cc)); - test(!Ice::targetEquals(ca, cd)); - test(!Ice::targetEquals(cb, cc)); - test(!Ice::targetEquals(cb, cd)); - test(!Ice::targetEquals(cc, cd)); + test(!Ice::targetEqualTo(ca, cb)); + test(!Ice::targetEqualTo(ca, cc)); + test(!Ice::targetEqualTo(ca, cd)); + test(!Ice::targetEqualTo(cb, cc)); + test(!Ice::targetEqualTo(cb, cd)); + test(!Ice::targetEqualTo(cc, cd)); #else test(ca != cb); test(ca != cc); @@ -61,11 +61,11 @@ allTests(const Ice::CommunicatorPtr& communicator) MB::IB2PrxPtr ib2 = initial->ib2op(); MA::ICPrxPtr ic = initial->icop(); #ifdef ICE_CPP11_MAPPING - test(!Ice::targetEquals(ia, ib1)); - test(!Ice::targetEquals(ia, ib2)); - test(!Ice::targetEquals(ia, ic)); - test(!Ice::targetEquals(ib1, ic)); - test(!Ice::targetEquals(ib2, ic)); + test(!Ice::targetEqualTo(ia, ib1)); + test(!Ice::targetEqualTo(ia, ib2)); + test(!Ice::targetEqualTo(ia, ic)); + test(!Ice::targetEqualTo(ib1, ic)); + test(!Ice::targetEqualTo(ib2, ic)); #else test(ia != ib1); test(ia != ib2); @@ -82,140 +82,140 @@ allTests(const Ice::CommunicatorPtr& communicator) cao = ca->caop(ca); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, ca)); + test(Ice::targetEqualTo(cao, ca)); #else test(cao == ca); #endif cao = ca->caop(cb); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cb)); + test(Ice::targetEqualTo(cao, cb)); #else test(cao == cb); #endif cao = ca->caop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cc)); + test(Ice::targetEqualTo(cao, cc)); #else test(cao == cc); #endif cao = cb->caop(ca); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, ca)); + test(Ice::targetEqualTo(cao, ca)); #else test(cao == ca); #endif cao = cb->caop(cb); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cb)); + test(Ice::targetEqualTo(cao, cb)); #else test(cao == cb); #endif cao = cb->caop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cc)); + test(Ice::targetEqualTo(cao, cc)); #else test(cao == cc); #endif cao = cc->caop(ca); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, ca)); + test(Ice::targetEqualTo(cao, ca)); #else test(cao == ca); #endif cao = cc->caop(cb); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cb)); + test(Ice::targetEqualTo(cao, cb)); #else test(cao == cb); #endif cao = cc->caop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cc)); + test(Ice::targetEqualTo(cao, cc)); #else test(cao == cc); #endif cao = cb->cbop(cb); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cb)); + test(Ice::targetEqualTo(cao, cb)); #else test(cao == cb); #endif cbo = cb->cbop(cb); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cbo, cb)); + test(Ice::targetEqualTo(cbo, cb)); #else test(cbo == cb); #endif cao = cb->cbop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cc)); + test(Ice::targetEqualTo(cao, cc)); #else test(cao == cc); #endif cbo = cb->cbop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cbo, cc)); + test(Ice::targetEqualTo(cbo, cc)); #else test(cbo == cc); #endif cao = cc->cbop(cb); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cb)); + test(Ice::targetEqualTo(cao, cb)); #else test(cao == cb); #endif cbo = cc->cbop(cb); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cbo, cb)); + test(Ice::targetEqualTo(cbo, cb)); #else test(cbo == cb); #endif cao = cc->cbop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cc)); + test(Ice::targetEqualTo(cao, cc)); #else test(cao == cc); #endif cbo = cc->cbop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cbo, cc)); + test(Ice::targetEqualTo(cbo, cc)); #else test(cbo == cc); #endif cao = cc->ccop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cc)); + test(Ice::targetEqualTo(cao, cc)); #else test(cao == cc); #endif cbo = cc->ccop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cbo, cc)); + test(Ice::targetEqualTo(cbo, cc)); #else test(cbo == cc); #endif cco = cc->ccop(cc); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cco, cc)); + test(Ice::targetEqualTo(cco, cc)); #else test(cco == cc); #endif @@ -229,251 +229,251 @@ allTests(const Ice::CommunicatorPtr& communicator) iao = ia->iaop(ia); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ia)); + test(Ice::targetEqualTo(iao, ia)); #else test(iao == ia); #endif iao = ia->iaop(ib1); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib1)); + test(Ice::targetEqualTo(iao, ib1)); #else test(iao == ib1); #endif iao = ia->iaop(ib2); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib2)); + test(Ice::targetEqualTo(iao, ib2)); #else test(iao == ib2); #endif iao = ia->iaop(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ic)); + test(Ice::targetEqualTo(iao, ic)); #else test(iao == ic); #endif iao = ib1->iaop(ia); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ia)); + test(Ice::targetEqualTo(iao, ia)); #else test(iao == ia); #endif iao = ib1->iaop(ib1); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib1)); + test(Ice::targetEqualTo(iao, ib1)); #else test(iao == ib1); #endif iao = ib1->iaop(ib2); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib2)); + test(Ice::targetEqualTo(iao, ib2)); #else test(iao == ib2); #endif iao = ib1->iaop(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ic)); + test(Ice::targetEqualTo(iao, ic)); #else test(iao == ic); #endif iao = ib2->iaop(ia); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ia)); + test(Ice::targetEqualTo(iao, ia)); #else test(iao == ia); #endif iao = ib2->iaop(ib1); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib1)); + test(Ice::targetEqualTo(iao, ib1)); #else test(iao == ib1); #endif iao = ib2->iaop(ib2); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib2)); + test(Ice::targetEqualTo(iao, ib2)); #else test(iao == ib2); #endif iao = ib2->iaop(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ic)); + test(Ice::targetEqualTo(iao, ic)); #else test(iao == ic); #endif iao = ic->iaop(ia); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ia)); + test(Ice::targetEqualTo(iao, ia)); #else test(iao == ia); #endif iao = ic->iaop(ib1); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib1)); + test(Ice::targetEqualTo(iao, ib1)); #else test(iao == ib1); #endif iao = ic->iaop(ib2); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib2)); + test(Ice::targetEqualTo(iao, ib2)); #else test(iao == ib2); #endif iao = ic->iaop(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ic)); + test(Ice::targetEqualTo(iao, ic)); #else test(iao == ic); #endif iao = ib1->ib1op(ib1); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib1)); + test(Ice::targetEqualTo(iao, ib1)); #else test(iao == ib1); #endif ib1o = ib1->ib1op(ib1); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib1o, ib1)); + test(Ice::targetEqualTo(ib1o, ib1)); #else test(ib1o == ib1); #endif iao = ib1->ib1op(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ic)); + test(Ice::targetEqualTo(iao, ic)); #else test(iao == ic); #endif ib1o = ib1->ib1op(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib1o, ic)); + test(Ice::targetEqualTo(ib1o, ic)); #else test(ib1o == ic); #endif iao = ic->ib1op(ib1); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib1)); + test(Ice::targetEqualTo(iao, ib1)); #else test(iao == ib1); #endif ib1o = ic->ib1op(ib1); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib1o, ib1)); + test(Ice::targetEqualTo(ib1o, ib1)); #else test(ib1o == ib1); #endif iao = ic->ib1op(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ic)); + test(Ice::targetEqualTo(iao, ic)); #else test(iao == ic); #endif ib1o = ic->ib1op(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib1o, ic)); + test(Ice::targetEqualTo(ib1o, ic)); #else test(ib1o == ic); #endif iao = ib2->ib2op(ib2); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib2)); + test(Ice::targetEqualTo(iao, ib2)); #else test(iao == ib2); #endif ib2o = ib2->ib2op(ib2); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib2o, ib2)); + test(Ice::targetEqualTo(ib2o, ib2)); #else test(ib2o == ib2); #endif iao = ib2->ib2op(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ic)); + test(Ice::targetEqualTo(iao, ic)); #else test(iao == ic); #endif ib2o = ib2->ib2op(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib2o, ic)); + test(Ice::targetEqualTo(ib2o, ic)); #else test(ib2o == ic); #endif iao = ic->ib2op(ib2); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ib2)); + test(Ice::targetEqualTo(iao, ib2)); #else test(iao == ib2); #endif ib2o = ic->ib2op(ib2); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib2o, ib2)); + test(Ice::targetEqualTo(ib2o, ib2)); #else test(ib2o == ib2); #endif iao = ic->ib2op(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ic)); + test(Ice::targetEqualTo(iao, ic)); #else test(iao == ic); #endif ib2o = ic->ib2op(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib2o, ic)); + test(Ice::targetEqualTo(ib2o, ic)); #else test(ib2o == ic); #endif iao = ic->icop(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, ic)); + test(Ice::targetEqualTo(iao, ic)); #else test(iao == ic); #endif ib1o = ic->icop(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib1o, ic)); + test(Ice::targetEqualTo(ib1o, ic)); #else test(ib1o == ic); #endif ib2o = ic->icop(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib2o, ic)); + test(Ice::targetEqualTo(ib2o, ic)); #else test(ib2o == ic); #endif ico = ic->icop(ic); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ico, ic)); + test(Ice::targetEqualTo(ico, ic)); #else test(ico == ic); #endif @@ -485,84 +485,84 @@ allTests(const Ice::CommunicatorPtr& communicator) cao = cd->caop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cd)); + test(Ice::targetEqualTo(cao, cd)); #else test(cao == cd); #endif cbo = cd->cbop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cbo, cd)); + test(Ice::targetEqualTo(cbo, cd)); #else test(cbo == cd); #endif cco = cd->ccop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cco, cd)); + test(Ice::targetEqualTo(cco, cd)); #else test(cco == cd); #endif iao = cd->iaop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, cd)); + test(Ice::targetEqualTo(iao, cd)); #else test(iao == cd); #endif ib1o = cd->ib1op(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib1o, cd)); + test(Ice::targetEqualTo(ib1o, cd)); #else test(ib1o == cd); #endif ib2o = cd->ib2op(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib2o, cd)); + test(Ice::targetEqualTo(ib2o, cd)); #else test(ib2o == cd); #endif cao = cd->cdop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cao, cd)); + test(Ice::targetEqualTo(cao, cd)); #else test(cao == cd); #endif cbo = cd->cdop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cbo, cd)); + test(Ice::targetEqualTo(cbo, cd)); #else test(cbo == cd); #endif cco = cd->cdop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(cco, cd)); + test(Ice::targetEqualTo(cco, cd)); #else test(cco == cd); #endif iao = cd->cdop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(iao, cd)); + test(Ice::targetEqualTo(iao, cd)); #else test(iao == cd); #endif ib1o = cd->cdop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib1o, cd)); + test(Ice::targetEqualTo(ib1o, cd)); #else test(ib1o == cd); #endif ib2o = cd->cdop(cd); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(ib2o, cd)); + test(Ice::targetEqualTo(ib2o, cd)); #else test(ib2o == cd); #endif diff --git a/cpp/test/Ice/objects/AllTests.cpp b/cpp/test/Ice/objects/AllTests.cpp index 63da17959e3..414a8c59f45 100644 --- a/cpp/test/Ice/objects/AllTests.cpp +++ b/cpp/test/Ice/objects/AllTests.cpp @@ -74,7 +74,7 @@ allTests(const Ice::CommunicatorPtr& communicator) InitialPrxPtr initial = ICE_CHECKED_CAST(InitialPrx, base); test(initial); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(initial, base)); + test(Ice::targetEqualTo(initial, base)); #else test(initial == base); #endif diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index a8fbe72f7e9..0e501f435eb 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -389,7 +389,7 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) test(rso.e == ICE_ENUM(MyEnum, enum2)); test(rso.s.s == "def"); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(so.p, p)); + test(Ice::targetEqualTo(so.p, p)); #else test(so.p == p); #endif diff --git a/cpp/test/Ice/optional/AllTests.cpp b/cpp/test/Ice/optional/AllTests.cpp index a3fbd96a8ee..72b6e4122cb 100644 --- a/cpp/test/Ice/optional/AllTests.cpp +++ b/cpp/test/Ice/optional/AllTests.cpp @@ -393,7 +393,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool) test(initial); #ifdef ICE_CPP11_MAPPING - test(targetEquals(initial, base)); + test(targetEqualTo(initial, base)); #else test(initial == base); #endif @@ -595,7 +595,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool) test(mo5->h == mo1->h); test(mo5->i == mo1->i); #ifdef ICE_CPP11_MAPPING - test(targetEquals(mo5->j.value(), mo1->j.value())); + test(targetEqualTo(mo5->j.value(), mo1->j.value())); #else test(mo5->j == mo1->j); #endif @@ -617,7 +617,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool) test(mo5->oops.value().size() == mo1->oops.value().size()); for(size_t i = 0; i< mo5->oops.value().size(); ++i) { - test(targetEquals(mo5->oops.value()[i], mo1->oops.value()[i])); + test(targetEqualTo(mo5->oops.value()[i], mo1->oops.value()[i])); } #else test(mo5->oops == mo1->oops); @@ -632,7 +632,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool) test(mo5->ioopd.value().size() == mo1->ioopd.value().size()); for(auto& v : mo5->ioopd.value()) { - test(targetEquals(mo1->ioopd.value()[v.first], v.second)); + test(targetEqualTo(mo1->ioopd.value()[v.first], v.second)); } #else test(mo5->ioopd == mo1->ioopd); @@ -671,7 +671,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool) test(mo7->h == mo1->h); test(!mo7->i); #ifdef ICE_CPP11_MAPPING - test(targetEquals(mo7->j.value(), mo1->j.value())); + test(targetEqualTo(mo7->j.value(), mo1->j.value())); #else test(mo7->j == mo1->j); #endif @@ -743,7 +743,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool) test(mo8->oops.value().size() == mo1->oops.value().size()); for(size_t i = 0; i< mo8->oops.value().size(); ++i) { - test(targetEquals(mo8->oops.value()[i], mo1->oops.value()[i])); + test(targetEqualTo(mo8->oops.value()[i], mo1->oops.value()[i])); } #else test(mo8->oops == mo1->oops); @@ -1461,7 +1461,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool) p2 = initial->opOneOptionalProxy(p1, p3); #ifdef ICE_CPP11_MAPPING - test(targetEquals(p2.value(), p1.value()) && targetEquals(p3.value(), p1.value())); + test(targetEqualTo(p2.value(), p1.value()) && targetEqualTo(p3.value(), p1.value())); #else test(p2 == p1 && p3 == p1); #endif @@ -1479,7 +1479,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool) in.endEncapsulation(); #ifdef ICE_CPP11_MAPPING - test(targetEquals(p2.value(), p1.value()) && targetEquals(p3.value(), p1.value())); + test(targetEqualTo(p2.value(), p1.value()) && targetEqualTo(p3.value(), p1.value())); #else test(p2 == p1 && p3 == p1); #endif diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp index bcded5cb5b2..d967c33a0d2 100644 --- a/cpp/test/Ice/proxy/AllTests.cpp +++ b/cpp/test/Ice/proxy/AllTests.cpp @@ -553,146 +553,146 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing proxy comparison... " << flush; #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(communicator->stringToProxy("foo"), communicator->stringToProxy("foo"))); - test(!Ice::targetEquals(communicator->stringToProxy("foo"), communicator->stringToProxy("foo2"))); + test(Ice::targetEqualTo(communicator->stringToProxy("foo"), communicator->stringToProxy("foo"))); + test(Ice::targetNotEqualTo(communicator->stringToProxy("foo"), communicator->stringToProxy("foo2"))); test(Ice::targetLess(communicator->stringToProxy("foo"), communicator->stringToProxy("foo2"))); - test(!Ice::targetLess(communicator->stringToProxy("foo2"), communicator->stringToProxy("foo"))); + test(Ice::targetGreaterEqual(communicator->stringToProxy("foo2"), communicator->stringToProxy("foo"))); Ice::ObjectPrxPtr compObj = communicator->stringToProxy("foo"); - test(Ice::targetEquals(compObj->ice_facet("facet"), compObj->ice_facet("facet"))); - test(!Ice::targetEquals(compObj->ice_facet("facet"), compObj->ice_facet("facet1"))); + test(Ice::targetEqualTo(compObj->ice_facet("facet"), compObj->ice_facet("facet"))); + test(Ice::targetNotEqualTo(compObj->ice_facet("facet"), compObj->ice_facet("facet1"))); test(Ice::targetLess(compObj->ice_facet("facet"), compObj->ice_facet("facet1"))); - test(!Ice::targetLess(compObj->ice_facet("facet"), compObj->ice_facet("facet"))); + test(Ice::targetGreaterEqual(compObj->ice_facet("facet"), compObj->ice_facet("facet"))); - test(Ice::targetEquals(compObj->ice_oneway(), compObj->ice_oneway())); - test(!Ice::targetEquals(compObj->ice_oneway(), compObj->ice_twoway())); + test(Ice::targetEqualTo(compObj->ice_oneway(), compObj->ice_oneway())); + test(Ice::targetNotEqualTo(compObj->ice_oneway(), compObj->ice_twoway())); test(Ice::targetLess(compObj->ice_twoway(), compObj->ice_oneway())); - test(!Ice::targetLess(compObj->ice_oneway(), compObj->ice_twoway())); + test(Ice::targetGreaterEqual(compObj->ice_oneway(), compObj->ice_twoway())); - test(Ice::targetEquals(compObj->ice_secure(true), compObj->ice_secure(true))); - test(!Ice::targetEquals(compObj->ice_secure(false), compObj->ice_secure(true))); + test(Ice::targetEqualTo(compObj->ice_secure(true), compObj->ice_secure(true))); + test(Ice::targetNotEqualTo(compObj->ice_secure(false), compObj->ice_secure(true))); test(Ice::targetLess(compObj->ice_secure(false), compObj->ice_secure(true))); - test(!Ice::targetLess(compObj->ice_secure(true), compObj->ice_secure(false))); + test(Ice::targetGreaterEqual(compObj->ice_secure(true), compObj->ice_secure(false))); - test(Ice::targetEquals(compObj->ice_collocationOptimized(true), compObj->ice_collocationOptimized(true))); - test(!Ice::targetEquals(compObj->ice_collocationOptimized(false), compObj->ice_collocationOptimized(true))); + test(Ice::targetEqualTo(compObj->ice_collocationOptimized(true), compObj->ice_collocationOptimized(true))); + test(Ice::targetNotEqualTo(compObj->ice_collocationOptimized(false), compObj->ice_collocationOptimized(true))); test(Ice::targetLess(compObj->ice_collocationOptimized(false), compObj->ice_collocationOptimized(true))); - test(!Ice::targetLess(compObj->ice_collocationOptimized(true), compObj->ice_collocationOptimized(false))); + test(Ice::targetGreaterEqual(compObj->ice_collocationOptimized(true), compObj->ice_collocationOptimized(false))); - test(Ice::targetEquals(compObj->ice_connectionCached(true), compObj->ice_connectionCached(true))); - test(!Ice::targetEquals(compObj->ice_connectionCached(false), compObj->ice_connectionCached(true))); + test(Ice::targetEqualTo(compObj->ice_connectionCached(true), compObj->ice_connectionCached(true))); + test(Ice::targetNotEqualTo(compObj->ice_connectionCached(false), compObj->ice_connectionCached(true))); test(Ice::targetLess(compObj->ice_connectionCached(false), compObj->ice_connectionCached(true))); - test(!Ice::targetLess(compObj->ice_connectionCached(true), compObj->ice_connectionCached(false))); + test(Ice::targetGreaterEqual(compObj->ice_connectionCached(true), compObj->ice_connectionCached(false))); - test(Ice::targetEquals(compObj->ice_endpointSelection(Ice::Random), compObj->ice_endpointSelection(Ice::Random))); - test(!Ice::targetEquals(compObj->ice_endpointSelection(Ice::Random), compObj->ice_endpointSelection(Ice::Ordered))); + test(Ice::targetEqualTo(compObj->ice_endpointSelection(Ice::Random), compObj->ice_endpointSelection(Ice::Random))); + test(Ice::targetNotEqualTo(compObj->ice_endpointSelection(Ice::Random), compObj->ice_endpointSelection(Ice::Ordered))); test(Ice::targetLess(compObj->ice_endpointSelection(Ice::Random), compObj->ice_endpointSelection(Ice::Ordered))); - test(!Ice::targetLess(compObj->ice_endpointSelection(Ice::Ordered), compObj->ice_endpointSelection(Ice::Random))); + test(Ice::targetGreaterEqual(compObj->ice_endpointSelection(Ice::Ordered), compObj->ice_endpointSelection(Ice::Random))); - test(Ice::targetEquals(compObj->ice_connectionId("id2"), compObj->ice_connectionId("id2"))); - test(!Ice::targetEquals(compObj->ice_connectionId("id1"), compObj->ice_connectionId("id2"))); + test(Ice::targetEqualTo(compObj->ice_connectionId("id2"), compObj->ice_connectionId("id2"))); + test(Ice::targetNotEqualTo(compObj->ice_connectionId("id1"), compObj->ice_connectionId("id2"))); test(Ice::targetLess(compObj->ice_connectionId("id1"), compObj->ice_connectionId("id2"))); - test(!Ice::targetLess(compObj->ice_connectionId("id2"), compObj->ice_connectionId("id1"))); + test(Ice::targetGreaterEqual(compObj->ice_connectionId("id2"), compObj->ice_connectionId("id1"))); test(compObj->ice_connectionId("id1")->ice_getConnectionId() == "id1"); test(compObj->ice_connectionId("id2")->ice_getConnectionId() == "id2"); - test(Ice::targetEquals(compObj->ice_compress(true), compObj->ice_compress(true))); - test(!Ice::targetEquals(compObj->ice_compress(false), compObj->ice_compress(true))); + test(Ice::targetEqualTo(compObj->ice_compress(true), compObj->ice_compress(true))); + test(Ice::targetNotEqualTo(compObj->ice_compress(false), compObj->ice_compress(true))); test(Ice::targetLess(compObj->ice_compress(false), compObj->ice_compress(true))); - test(!Ice::targetLess(compObj->ice_compress(true), compObj->ice_compress(false))); + test(Ice::targetGreaterEqual(compObj->ice_compress(true), compObj->ice_compress(false))); - test(Ice::targetEquals(compObj->ice_timeout(20), compObj->ice_timeout(20))); - test(!Ice::targetEquals(compObj->ice_timeout(10), compObj->ice_timeout(20))); + test(Ice::targetEqualTo(compObj->ice_timeout(20), compObj->ice_timeout(20))); + test(Ice::targetNotEqualTo(compObj->ice_timeout(10), compObj->ice_timeout(20))); test(Ice::targetLess(compObj->ice_timeout(10), compObj->ice_timeout(20))); - test(!Ice::targetLess(compObj->ice_timeout(20), compObj->ice_timeout(10))); + test(Ice::targetGreaterEqual(compObj->ice_timeout(20), compObj->ice_timeout(10))); auto loc1 = Ice::uncheckedCast<Ice::LocatorPrx>(communicator->stringToProxy("loc1:default -p 10000")); auto loc2 = Ice::uncheckedCast<Ice::LocatorPrx>(communicator->stringToProxy("loc2:default -p 10000")); - test(Ice::targetEquals(compObj->ice_locator(0), compObj->ice_locator(0))); - test(Ice::targetEquals(compObj->ice_locator(loc1), compObj->ice_locator(loc1))); - test(!Ice::targetEquals(compObj->ice_locator(loc1), compObj->ice_locator(0))); - test(!Ice::targetEquals(compObj->ice_locator(0), compObj->ice_locator(loc2))); - test(!Ice::targetEquals(compObj->ice_locator(loc1), compObj->ice_locator(loc2))); + test(Ice::targetEqualTo(compObj->ice_locator(0), compObj->ice_locator(0))); + test(Ice::targetEqualTo(compObj->ice_locator(loc1), compObj->ice_locator(loc1))); + test(Ice::targetNotEqualTo(compObj->ice_locator(loc1), compObj->ice_locator(0))); + test(Ice::targetNotEqualTo(compObj->ice_locator(0), compObj->ice_locator(loc2))); + test(Ice::targetNotEqualTo(compObj->ice_locator(loc1), compObj->ice_locator(loc2))); test(Ice::targetLess(compObj->ice_locator(0), compObj->ice_locator(loc1))); - test(!Ice::targetLess(compObj->ice_locator(loc1), compObj->ice_locator(0))); + test(Ice::targetGreaterEqual(compObj->ice_locator(loc1), compObj->ice_locator(0))); test(Ice::targetLess(compObj->ice_locator(loc1), compObj->ice_locator(loc2))); - test(!Ice::targetLess(compObj->ice_locator(loc2), compObj->ice_locator(loc1))); + test(Ice::targetGreaterEqual(compObj->ice_locator(loc2), compObj->ice_locator(loc1))); auto rtr1 = Ice::uncheckedCast<Ice::RouterPrx>(communicator->stringToProxy("rtr1:default -p 10000")); auto rtr2 = Ice::uncheckedCast<Ice::RouterPrx>(communicator->stringToProxy("rtr2:default -p 10000")); - test(Ice::targetEquals(compObj->ice_router(0), compObj->ice_router(0))); - test(Ice::targetEquals(compObj->ice_router(rtr1), compObj->ice_router(rtr1))); - test(!Ice::targetEquals(compObj->ice_router(rtr1), compObj->ice_router(0))); - test(!Ice::targetEquals(compObj->ice_router(0), compObj->ice_router(rtr2))); - test(!Ice::targetEquals(compObj->ice_router(rtr1), compObj->ice_router(rtr2))); + test(Ice::targetEqualTo(compObj->ice_router(0), compObj->ice_router(0))); + test(Ice::targetEqualTo(compObj->ice_router(rtr1), compObj->ice_router(rtr1))); + test(Ice::targetNotEqualTo(compObj->ice_router(rtr1), compObj->ice_router(0))); + test(Ice::targetNotEqualTo(compObj->ice_router(0), compObj->ice_router(rtr2))); + test(Ice::targetNotEqualTo(compObj->ice_router(rtr1), compObj->ice_router(rtr2))); test(Ice::targetLess(compObj->ice_router(0), compObj->ice_router(rtr1))); - test(!Ice::targetLess(compObj->ice_router(rtr1), compObj->ice_router(0))); + test(Ice::targetGreaterEqual(compObj->ice_router(rtr1), compObj->ice_router(0))); test(Ice::targetLess(compObj->ice_router(rtr1), compObj->ice_router(rtr2))); - test(!Ice::targetLess(compObj->ice_router(rtr2), compObj->ice_router(rtr1))); + test(Ice::targetGreaterEqual(compObj->ice_router(rtr2), compObj->ice_router(rtr1))); Ice::Context ctx1; ctx1["ctx1"] = "v1"; Ice::Context ctx2; ctx2["ctx2"] = "v2"; - test(Ice::targetEquals(compObj->ice_context(Ice::Context()), compObj->ice_context(Ice::Context()))); - test(Ice::targetEquals(compObj->ice_context(ctx1), compObj->ice_context(ctx1))); - test(!Ice::targetEquals(compObj->ice_context(ctx1), compObj->ice_context(Ice::Context()))); - test(!Ice::targetEquals(compObj->ice_context(Ice::Context()), compObj->ice_context(ctx2))); - test(!Ice::targetEquals(compObj->ice_context(ctx1), compObj->ice_context(ctx2))); + test(Ice::targetEqualTo(compObj->ice_context(Ice::Context()), compObj->ice_context(Ice::Context()))); + test(Ice::targetEqualTo(compObj->ice_context(ctx1), compObj->ice_context(ctx1))); + test(Ice::targetNotEqualTo(compObj->ice_context(ctx1), compObj->ice_context(Ice::Context()))); + test(Ice::targetNotEqualTo(compObj->ice_context(Ice::Context()), compObj->ice_context(ctx2))); + test(Ice::targetNotEqualTo(compObj->ice_context(ctx1), compObj->ice_context(ctx2))); test(Ice::targetLess(compObj->ice_context(ctx1), compObj->ice_context(ctx2))); - test(!Ice::targetLess(compObj->ice_context(ctx2), compObj->ice_context(ctx1))); + test(Ice::targetGreaterEqual(compObj->ice_context(ctx2), compObj->ice_context(ctx1))); - test(Ice::targetEquals(compObj->ice_preferSecure(true), compObj->ice_preferSecure(true))); - test(!Ice::targetEquals(compObj->ice_preferSecure(true), compObj->ice_preferSecure(false))); + test(Ice::targetEqualTo(compObj->ice_preferSecure(true), compObj->ice_preferSecure(true))); + test(Ice::targetNotEqualTo(compObj->ice_preferSecure(true), compObj->ice_preferSecure(false))); test(Ice::targetLess(compObj->ice_preferSecure(false), compObj->ice_preferSecure(true))); - test(!Ice::targetLess(compObj->ice_preferSecure(true), compObj->ice_preferSecure(false))); + test(Ice::targetGreaterEqual(compObj->ice_preferSecure(true), compObj->ice_preferSecure(false))); auto compObj1 = communicator->stringToProxy("foo:tcp -h 127.0.0.1 -p 10000"); auto compObj2 = communicator->stringToProxy("foo:tcp -h 127.0.0.1 -p 10001"); - test(!Ice::targetEquals(compObj1, compObj2)); + test(Ice::targetNotEqualTo(compObj1, compObj2)); test(Ice::targetLess(compObj1, compObj2)); - test(!Ice::targetLess(compObj2, compObj1)); + test(Ice::targetGreaterEqual(compObj2, compObj1)); compObj1 = communicator->stringToProxy("foo@MyAdapter1"); compObj2 = communicator->stringToProxy("foo@MyAdapter2"); - test(!Ice::targetEquals(compObj1, compObj2)); + test(Ice::targetNotEqualTo(compObj1, compObj2)); test(Ice::targetLess(compObj1, compObj2)); - test(!Ice::targetLess(compObj2, compObj1)); + test(Ice::targetGreaterEqual(compObj2, compObj1)); - test(Ice::targetEquals(compObj1->ice_locatorCacheTimeout(20), compObj1->ice_locatorCacheTimeout(20))); - test(!Ice::targetEquals(compObj1->ice_locatorCacheTimeout(10), compObj1->ice_locatorCacheTimeout(20))); + test(Ice::targetEqualTo(compObj1->ice_locatorCacheTimeout(20), compObj1->ice_locatorCacheTimeout(20))); + test(Ice::targetNotEqualTo(compObj1->ice_locatorCacheTimeout(10), compObj1->ice_locatorCacheTimeout(20))); test(Ice::targetLess(compObj1->ice_locatorCacheTimeout(10), compObj1->ice_locatorCacheTimeout(20))); - test(!Ice::targetLess(compObj1->ice_locatorCacheTimeout(20), compObj1->ice_locatorCacheTimeout(10))); + test(Ice::targetGreaterEqual(compObj1->ice_locatorCacheTimeout(20), compObj1->ice_locatorCacheTimeout(10))); - test(Ice::targetEquals(compObj1->ice_invocationTimeout(20), compObj1->ice_invocationTimeout(20))); - test(!Ice::targetEquals(compObj1->ice_invocationTimeout(10), compObj1->ice_invocationTimeout(20))); + test(Ice::targetEqualTo(compObj1->ice_invocationTimeout(20), compObj1->ice_invocationTimeout(20))); + test(Ice::targetNotEqualTo(compObj1->ice_invocationTimeout(10), compObj1->ice_invocationTimeout(20))); test(Ice::targetLess(compObj1->ice_invocationTimeout(10), compObj1->ice_invocationTimeout(20))); - test(!Ice::targetLess(compObj1->ice_invocationTimeout(20), compObj1->ice_invocationTimeout(10))); + test(Ice::targetGreaterEqual(compObj1->ice_invocationTimeout(20), compObj1->ice_invocationTimeout(10))); compObj1 = communicator->stringToProxy("foo:tcp -h 127.0.0.1 -p 1000"); compObj2 = communicator->stringToProxy("foo@MyAdapter1"); - test(!Ice::targetEquals(compObj1, compObj2)); + test(Ice::targetNotEqualTo(compObj1, compObj2)); test(Ice::targetLess(compObj1, compObj2)); - test(!Ice::targetLess(compObj2, compObj1)); + test(Ice::targetGreaterEqual(compObj2, compObj1)); Ice::EndpointSeq endpts1 = communicator->stringToProxy("foo:tcp -h 127.0.0.1 -p 10000")->ice_getEndpoints(); Ice::EndpointSeq endpts2 = communicator->stringToProxy("foo:tcp -h 127.0.0.1 -p 10001")->ice_getEndpoints(); - test(endpts1.size() != endpts2.size() || !equal(endpts1.begin(), endpts1.end(), endpts2.begin(), Ice::TargetEquals<shared_ptr<Ice::Endpoint>>())); - test(lexicographical_compare(endpts1.begin(), endpts1.end(), endpts2.begin(), endpts2.end(), Ice::TargetLess<shared_ptr<Ice::Endpoint>>())); - test(!lexicographical_compare(endpts2.begin(), endpts2.end(), endpts1.begin(), endpts1.end(), Ice::TargetLess<shared_ptr<Ice::Endpoint>>())); + test(endpts1.size() != endpts2.size() || !equal(endpts1.begin(), endpts1.end(), endpts2.begin(), Ice::TargetCompare<shared_ptr<Ice::Endpoint>, std::equal_to>())); + test(lexicographical_compare(endpts1.begin(), endpts1.end(), endpts2.begin(), endpts2.end(), Ice::TargetCompare<shared_ptr<Ice::Endpoint>, std::less>())); + test(!lexicographical_compare(endpts2.begin(), endpts2.end(), endpts1.begin(), endpts1.end(), Ice::TargetCompare<shared_ptr<Ice::Endpoint>, std::less>())); Ice::EndpointSeq endpts3 = communicator->stringToProxy("foo:tcp -h 127.0.0.1 -p 10000")->ice_getEndpoints(); - test(endpts1.size() == endpts3.size() && equal(endpts1.begin(), endpts1.end(), endpts3.begin(), Ice::TargetEquals<shared_ptr<Ice::Endpoint>>())); + test(endpts1.size() == endpts3.size() && equal(endpts1.begin(), endpts1.end(), endpts3.begin(), Ice::TargetCompare<shared_ptr<Ice::Endpoint>, std::equal_to>())); - test(Ice::targetEquals(compObj1->ice_encodingVersion(Ice::Encoding_1_0), compObj1->ice_encodingVersion(Ice::Encoding_1_0))); - test(!Ice::targetEquals(compObj1->ice_encodingVersion(Ice::Encoding_1_0), compObj1->ice_encodingVersion(Ice::Encoding_1_1))); + test(Ice::targetEqualTo(compObj1->ice_encodingVersion(Ice::Encoding_1_0), compObj1->ice_encodingVersion(Ice::Encoding_1_0))); + test(Ice::targetNotEqualTo(compObj1->ice_encodingVersion(Ice::Encoding_1_0), compObj1->ice_encodingVersion(Ice::Encoding_1_1))); test(Ice::targetLess(compObj->ice_encodingVersion(Ice::Encoding_1_0), compObj->ice_encodingVersion(Ice::Encoding_1_1))); - test(!Ice::targetLess(compObj->ice_encodingVersion(Ice::Encoding_1_1), compObj->ice_encodingVersion(Ice::Encoding_1_0))); + test(Ice::targetGreaterEqual(compObj->ice_encodingVersion(Ice::Encoding_1_1), compObj->ice_encodingVersion(Ice::Encoding_1_0))); // // TODO: Ideally we should also test comparison of fixed proxies. @@ -706,9 +706,9 @@ allTests(const Ice::CommunicatorPtr& communicator) auto derived = Ice::checkedCast<Test::MyDerivedClassPrx>(cl); test(derived); - test(Ice::targetEquals(cl, base)); - test(Ice::targetEquals(derived, base)); - test(Ice::targetEquals(cl, derived)); + test(Ice::targetEqualTo(cl, base)); + test(Ice::targetEqualTo(derived, base)); + test(Ice::targetEqualTo(cl, derived)); auto loc = Ice::checkedCast<Ice::LocatorPrx>(base); test(loc == nullptr); @@ -720,8 +720,8 @@ allTests(const Ice::CommunicatorPtr& communicator) auto obj = Ice::checkedCast<Ice::ObjectPrx>(derived); test(cl2); test(obj); - test(Ice::targetEquals(cl2, obj)); - test(Ice::targetEquals(cl2, derived)); + test(Ice::targetEqualTo(cl2, obj)); + test(Ice::targetEqualTo(cl2, derived)); #else test(communicator->stringToProxy("foo") == communicator->stringToProxy("foo")); test(communicator->stringToProxy("foo") != communicator->stringToProxy("foo2")); diff --git a/cpp/test/Ice/retry/AllTests.cpp b/cpp/test/Ice/retry/AllTests.cpp index bf2469e3be9..27283363481 100644 --- a/cpp/test/Ice/retry/AllTests.cpp +++ b/cpp/test/Ice/retry/AllTests.cpp @@ -102,14 +102,14 @@ allTests(const Ice::CommunicatorPtr& communicator, const Ice::CommunicatorPtr& c RetryPrxPtr retry1 = ICE_CHECKED_CAST(RetryPrx, base1); test(retry1); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(retry1, base1)); + test(Ice::targetEqualTo(retry1, base1)); #else test(retry1 == base1); #endif RetryPrxPtr retry2 = ICE_CHECKED_CAST(RetryPrx, base2); test(retry2); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(retry2, base2)); + test(Ice::targetEqualTo(retry2, base2)); #else test(retry2 == base2); #endif diff --git a/cpp/test/Ice/servantLocator/AllTests.cpp b/cpp/test/Ice/servantLocator/AllTests.cpp index c028bdd6562..18ec1b87d1a 100644 --- a/cpp/test/Ice/servantLocator/AllTests.cpp +++ b/cpp/test/Ice/servantLocator/AllTests.cpp @@ -227,7 +227,7 @@ allTests(const CommunicatorPtr& communicator) TestIntfPrxPtr obj = ICE_CHECKED_CAST(TestIntfPrx, base); test(obj); #ifdef ICE_CPP11_MAPPING - test(Ice::targetEquals(obj, base)); + test(Ice::targetEqualTo(obj, base)); #else test(obj == base); #endif diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp index 35d60785ebf..4fa930b62dd 100644 --- a/cpp/test/IceSSL/configuration/AllTests.cpp +++ b/cpp/test/IceSSL/configuration/AllTests.cpp @@ -24,9 +24,9 @@ #endif #ifdef ICE_CPP11_MAPPING -# define ICE_TARGET_EQUALS(A,B) Ice::targetEquals(A, B) +# define ICE_TARGET_EQUAL_TO(A,B) Ice::targetEqualTo(A, B) #else -# define ICE_TARGET_EQUALS(A,B) A == B +# define ICE_TARGET_EQUAL_TO(A,B) A == B #endif using namespace std; @@ -753,8 +753,8 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12) // Validate some aspects of the Certificate class. // IceSSL::CertificatePtr serverCert = IceSSL::Certificate::load(defaultDir + "/s_rsa_ca1_pub.pem"); - test(ICE_TARGET_EQUALS(IceSSL::Certificate::decode(serverCert->encode()), serverCert)); - test(ICE_TARGET_EQUALS(serverCert, serverCert)); + test(ICE_TARGET_EQUAL_TO(IceSSL::Certificate::decode(serverCert->encode()), serverCert)); + test(ICE_TARGET_EQUAL_TO(serverCert, serverCert)); #if !defined(__APPLE__) || TARGET_OS_IPHONE == 0 test(serverCert->checkValidity()); test(!serverCert->checkValidity(IceUtil::Time::seconds(0))); @@ -762,7 +762,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12) IceSSL::CertificatePtr caCert = IceSSL::Certificate::load(defaultDir + "/cacert1.pem"); IceSSL::CertificatePtr caCert2 = IceSSL::Certificate::load(defaultDir + "/cacert2.pem"); - test(ICE_TARGET_EQUALS(caCert, caCert)); + test(ICE_TARGET_EQUAL_TO(caCert, caCert)); #if !defined(__APPLE__) || TARGET_OS_IPHONE == 0 test(caCert->checkValidity()); test(!caCert->checkValidity(IceUtil::Time::seconds(0))); @@ -777,11 +777,11 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12) test(info->nativeCerts.size() == 2); test(info->verified); - test(ICE_TARGET_EQUALS(caCert, info->nativeCerts[1])); - test(ICE_TARGET_EQUALS(serverCert, info->nativeCerts[0])); + test(ICE_TARGET_EQUAL_TO(caCert, info->nativeCerts[1])); + test(ICE_TARGET_EQUAL_TO(serverCert, info->nativeCerts[0])); - test(!(ICE_TARGET_EQUALS(serverCert, info->nativeCerts[1]))); - test(!(ICE_TARGET_EQUALS(caCert, info->nativeCerts[0]))); + test(!(ICE_TARGET_EQUAL_TO(serverCert, info->nativeCerts[1]))); + test(!(ICE_TARGET_EQUAL_TO(caCert, info->nativeCerts[0]))); #if !defined(__APPLE__) || TARGET_OS_IPHONE == 0 test(info->nativeCerts[0]->checkValidity() && info->nativeCerts[1]->checkValidity()); |