summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-01-17 17:06:54 -0500
committerBernard Normier <bernard@zeroc.com>2017-01-17 17:06:54 -0500
commit154566dbe9af9b58f24c81697c0f6d644cbdff1a (patch)
treeac2ee022c38db1b8d9c144ca7a1f39b3af122f7b /cpp
parentFixed ICE-7512 and ICE-7511 - make distclean issues with Xcode IceSDK build (diff)
downloadice-154566dbe9af9b58f24c81697c0f6d644cbdff1a.tar.bz2
ice-154566dbe9af9b58f24c81697c0f6d644cbdff1a.tar.xz
ice-154566dbe9af9b58f24c81697c0f6d644cbdff1a.zip
"to string" on a fixed proxy no longer raise FixedProxyException
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/Ice/Reference.cpp9
-rw-r--r--cpp/src/Ice/Reference.h1
-rw-r--r--cpp/test/Ice/proxy/AllTests.cpp19
3 files changed, 19 insertions, 10 deletions
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index c55b3037a33..188ad33e5ee 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -734,15 +734,6 @@ IceInternal::FixedReference::streamWrite(OutputStream*) const
throw FixedProxyException(__FILE__, __LINE__);
}
-string
-IceInternal::FixedReference::toString() const
-{
- throw FixedProxyException(__FILE__, __LINE__);
-
- assert(false); // Cannot be reached.
- return string(); // To keep the compiler from complaining.
-}
-
PropertyDict
IceInternal::FixedReference::toProperty(const string&) const
{
diff --git a/cpp/src/Ice/Reference.h b/cpp/src/Ice/Reference.h
index d3612f6cedd..a48a61c66e4 100644
--- a/cpp/src/Ice/Reference.h
+++ b/cpp/src/Ice/Reference.h
@@ -212,7 +212,6 @@ public:
virtual bool isWellKnown() const;
virtual void streamWrite(Ice::OutputStream*) const;
- virtual std::string toString() const;
virtual Ice::PropertyDict toProperty(const std::string&) const;
virtual RequestHandlerPtr getRequestHandler(const Ice::ObjectPrxPtr&) const;
diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp
index 82655d278e5..285dc5fae3f 100644
--- a/cpp/test/Ice/proxy/AllTests.cpp
+++ b/cpp/test/Ice/proxy/AllTests.cpp
@@ -380,6 +380,25 @@ allTests(const Ice::CommunicatorPtr& communicator)
cout << "ok" << endl;
+ cout << "testing proxyToString... " << flush;
+ b1 = communicator->stringToProxy(ref);
+ Ice::ObjectPrxPtr b2 = communicator->stringToProxy(communicator->proxyToString(b1));
+ test(Ice::targetEqualTo(b1, b2));
+
+ if(b1->ice_getConnection()) // not colloc-optimized target
+ {
+ b2 = b1->ice_getConnection()->createProxy(Ice::stringToIdentity("fixed"));
+ string str = communicator->proxyToString(b2);
+ test(b2->ice_toString() == str);
+ string str2 = b1->ice_identity(b2->ice_getIdentity())->ice_toString();
+
+ // Verify that the stringified fixed proxy is the same as a regular stringified proxy
+ // but without endpoints
+ test(str2.substr(0, str.size()) == str);
+ test(str2[str.size()] == ':');
+ }
+ cout << "ok" << endl;
+
cout << "testing propertyToProxy... " << flush;
Ice::PropertiesPtr prop = communicator->getProperties();
string propertyPrefix = "Foo.Proxy";